Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix tests for Python 3.10 #336

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

Merged
merged 2 commits into from
Feb 16, 2021
Merged

Conversation

frenzymadness
Copy link

This simple fix makes tests pass with Python 3.10. Without it, the error is:

453   If the dictionary contains unknown keys, you get a :class:`TypeError` exception::
454 
455     >>> v > dict(major=1, unknown=42)
Differences (ndiff with -expected +actual):
      Traceback (most recent call last):
    - ...
    +   File "/usr/lib64/python3.10/doctest.py", line 1340, in __run
    +     exec(compile(example.source, filename, "single",
    +   File "<doctest usage.rst[75]>", line 1, in <module>
    +     v > dict(major=1, unknown=42)
    +   File "/builddir/build/BUILD/python-semver-2.13.0/semver.py", line 203, in wrapper
    +     return operator(self, other)
    +   File "/builddir/build/BUILD/python-semver-2.13.0/semver.py", line 589, in __gt__
    +     return self.compare(other) > 0
    +   File "/builddir/build/BUILD/python-semver-2.13.0/semver.py", line 495, in compare
    +     other = cls(**other)
    - TypeError: __init__() got an unexpected keyword argument 'unknown'
    + TypeError: VersionInfo.__init__() got an unexpected keyword argument 'unknown'
    ?            ++++++++++++

@tomschr
Copy link
Member

tomschr commented Feb 16, 2021

Thanks @frenzymadness, much appreciated! 👍

Just one thing: the main/v2 branch is mostly the maintenance branch for version 2 of semver. Current development happens in the master branch.

I've compared the file docs/usage.rst in master branch and this is how it looks:

>>> v > dict(major=1, unknown=42)
Traceback (most recent call last):
...
TypeError: ... got an unexpected keyword argument 'unknown'

So it's issue is already fixed in master, but looks very similar. Would you like to adapt your changes so it's consistent with the master branch?

Thanks!

Copy link
Member

@tomschr tomschr left a comment

Choose a reason for hiding this comment

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

Here is my suggestion. 🙂

docs/usage.rst Outdated Show resolved Hide resolved
Co-authored-by: Tom Schraitle <tomschr@users.noreply.github.com>
@frenzymadness
Copy link
Author

Your suggestion works as well and it's closer to master branch. We still maintain version 2 as RPM package in Fedora because the current development version lacks a stable release.

@tomschr
Copy link
Member

tomschr commented Feb 16, 2021

Thank you! 👍

I hope we can publish a stable release soon.

@tomschr tomschr merged commit 3809aed into python-semver:maint/v2 Feb 16, 2021
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.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.