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

Update for python 3.10 compatibility #480

Merged
merged 3 commits into from
Dec 7, 2021
Merged

Conversation

inglor
Copy link
Contributor

@inglor inglor commented Dec 5, 2021

Signed-off-by: Leonidas Spyropoulos artafinde@gmail.com

Please fill in the fields below to submit a pull request. The more information
that is provided, the better.

**Fixes issue #00:
N/A

Description of the changes being introduced by the pull request:
Fix compatibility with Python 3.10

Please verify and check that the pull request fulfills the following
requirements
:

  • The code follows the Code Style Guidelines
  • Tests have been added for the bug fix or new feature
  • Docs have been added for the bug fix or new feature

Copy link
Member

@lukpueh lukpueh left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution, @inglor! Would you mind adding 3.10 to CI/CD? IIRC, this should be a matter of patching...

python-version: [3.6, 3.7, 3.8, 3.9]

and
envlist = lint,py{36,37,38,39}

Also, it would be nice if we performed the version case handling only once, e.g. define a global in common_args.py along the lines of:

 OPTS_TITLE = "Optional Arguments" if sys.version_info < (3, 10) else "Options"

which could be used in all other files (and maybe lower()ed in the usage texts)

Optional Arguments was renamed to Options in python 3.10 release [1]

[1]: python/cpython#23858

Signed-off-by: Leonidas Spyropoulos <artafinde@gmail.com>
Seems like pylint 2.12.2 doesn't like the `keys()` anymore [1], [2]

[1]: https://github.com/PyCQA/pylint/releases/tag/v2.12.2
[2]: https://pycodequ.al/docs/pylint-messages/c0201-consider-iterating-dictionary.html

Signed-off-by: Leonidas Spyropoulos <artafinde@gmail.com>
@inglor
Copy link
Contributor Author

inglor commented Dec 6, 2021

Hi @lukpueh thanks for the review! Changes applied. I've modified the CI/CD to include 3.10 now - hope checks pass again :)

Signed-off-by: Leonidas Spyropoulos <artafinde@gmail.com>
@lukpueh
Copy link
Member

lukpueh commented Dec 7, 2021

Many thanks, @inglor!

@lukpueh lukpueh merged commit cb56216 into in-toto:develop Dec 7, 2021
@inglor inglor deleted the python-310 branch December 7, 2021 09:18
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.

None yet

3 participants