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

Remove PY3.8 support; Add PY3.13 support #979

Merged
merged 7 commits into from
Dec 18, 2024
Merged

Remove PY3.8 support; Add PY3.13 support #979

merged 7 commits into from
Dec 18, 2024

Conversation

ktbyers
Copy link
Collaborator

@ktbyers ktbyers commented Dec 16, 2024

Update GH actions to reflect this.

Switch to types-setuptools since pypi removed the previously used types-pkg-resources.

Update GH actions to reflect this.

Switch to `types-setuptools` since pypi removed the previously
used types-pkg-resources.
@coveralls
Copy link

coveralls commented Dec 16, 2024

Pull Request Test Coverage Report for Build 12379257832

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 34 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.01%) to 56.799%

Files with Coverage Reduction New Missed Lines %
core/configuration.py 34 51.01%
Totals Coverage Status
Change from base Build 11785367801: -0.01%
Covered Lines: 543
Relevant Lines: 956

💛 - Coveralls

@ktbyers
Copy link
Collaborator Author

ktbyers commented Dec 17, 2024

Closer, but now breaking at a nbval test (on PY3.13).

@ktbyers
Copy link
Collaborator Author

ktbyers commented Dec 17, 2024

Note, for some reason the docs/tutorial/processors.ipynb test was failing on PY3.13 due to Hosts being in a different order. I assumed this in some way pertained to a threading change i.e. that insertion order was changing.

I just added a sort_keys=True on the json.dumps() call to ensure that dictionary order of the hosts was the same (on the output).

@ktbyers
Copy link
Collaborator Author

ktbyers commented Dec 17, 2024

@dbarrosop @ogenstad I think this should be good to go, if one of you want to review/approve.

Note, I will plan on doing a release once this is approved.

Note also, I pinned to a test version of PyEZ for Nornir testing purposes. This test version of PyEZ fixes the underlying PY3.13 breaking issue. This is only in Nornir dev dependencies.

This does imply that anyone using Nornir-napalm and PY3.13 will still run into breakage due to PYEZ, but I don't think we should block all other Nornir users while waiting for PyEZ to fix their underlying issue.

@@ -16,7 +16,7 @@
T = TypeVar("T")


class Parameter:
class Parameter(Generic[T]):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looked like the recommended way to enforce type consistency i.e. that a Parameter that was a 'str' was consistently required to be a 'str').

There were some mypy issues until I did this.

return v


class SSHConfig:
__slots__ = ("config_file",)

class Parameters:
config_file = Parameter(default=DEFAULT_SSH_CONFIG, envvar="NORNIR_SSH_CONFIG_FILE")
config_file = Parameter[str](default=DEFAULT_SSH_CONFIG, envvar="NORNIR_SSH_CONFIG_FILE")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a secondary requirement of using Parameter(Generic[T])

requires = ["poetry==1.3.2"]
build-backend = "poetry.masonry.api"
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New Poetry build format.

@@ -41,10 +41,15 @@ pytest-cov = "*"
requests-mock = "*"
mypy = "^1.5.1"
types-Jinja2 = "^2.11.9"
types-pkg-resources = "^0.1.3"
types-setuptools= ">=75.5.0.20241116"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

types-pkg-resources was completely removed from pypi--all versions. Was fairly annoyed by that.

@dbarrosop
Copy link
Contributor

Great job, thanks!

This does imply that anyone using Nornir-napalm and PY3.13 will still run into breakage due to PYEZ, but I don't think we should block all other Nornir users while waiting for PyEZ to fix their underlying issue.

Agreed, that shouldn't block nornir core.

@ktbyers ktbyers merged commit e110299 into main Dec 18, 2024
32 checks passed
@ktbyers ktbyers deleted the py313_support branch December 18, 2024 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants