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

fix: adjust the inspect.signature behaviour to work with Python 3.8 #188

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "ops-scenario"

version = "7.0.0"
version = "7.0.1"

authors = [
{ name = "Pietro Pasotti", email = "[email protected]" }
Expand Down
3 changes: 2 additions & 1 deletion scenario/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,13 @@ def __new__(cls, *args, **kwargs):
# declared, which aligns with dataclasses. Simpler ways of
# getting the arguments (like __annotations__) do not have that
# guarantee, although in practice it is the case.
parameters = inspect.signature(cls).parameters
parameters = inspect.signature(cls.__init__).parameters
required_args = [
name
for name in tuple(parameters)
if parameters[name].default is inspect.Parameter.empty
and name not in kwargs
and name != "self"
]
n_posargs = len(args)
max_n_posargs = cls._max_positional_args
Expand Down
Loading