Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New resolver for getting parameter types from *.pyi files #220

Merged
merged 2 commits into from
Dec 22, 2022

Conversation

mauvilsa
Copy link
Member

What does this PR do?

See title.

Before submitting

  • Did you read the contributing guideline?
  • Did you update the documentation? (readme and public docstrings)
  • Did you write unit tests such that there is 100% coverage on related code? (required for bug fixes and new features)
  • Did you verify that new and existing tests pass locally?
  • Did you make sure that all changes preserve backward compatibility?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or minor internal changes/refactors)

…*.pyi.

- The signatures extras now installs the typeshed-client package.
@mauvilsa mauvilsa added the enhancement New feature or request label Dec 20, 2022
jsonargparse/_stubs_resolver.py Fixed Show fixed Hide fixed
Comment on lines +9 to +14
from .optionals import (
import_typeshed_client,
typeshed_client_support,
typing_extensions_import,
)

Check notice

Code scanning / CodeQL

Cyclic import

Import of module [jsonargparse.optionals](1) begins an import cycle.
typeshed_client_support,
typing_extensions_import,
)
from .util import unique

Check notice

Code scanning / CodeQL

Cyclic import

Import of module [jsonargparse.util](1) begins an import cycle.
@@ -68,7 +68,7 @@
import_fsspec,
import_jsonnet,
)
from .parameter_resolvers import ConditionalDefault
from .parameter_resolvers import UnknownDefault

Check notice

Code scanning / CodeQL

Cyclic import

Import of module [jsonargparse.parameter_resolvers](1) begins an import cycle.

from ._stubs_resolver import get_stub_types

Check notice

Code scanning / CodeQL

Cyclic import

Import of module [jsonargparse._stubs_resolver](1) begins an import cycle.

def test_get_mro_method_parent(self):
class WithoutParent:
...

Check notice

Code scanning / CodeQL

Statement has no effect

This statement has no effect.
- When stub type fails to parse, keep it with empty type if not among known parameters.
- Avoid issues with invalid value defaults, e.g. torch.optim.optimizer.required.
- Fixed fail_untyped=False not propagated to subclass --*.help actions.
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant