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

Semantic_version 2.10.0 is not compatible with Python version 2 #158

Open
damyl4sure opened this issue Dec 5, 2024 · 0 comments
Open

Semantic_version 2.10.0 is not compatible with Python version 2 #158

damyl4sure opened this issue Dec 5, 2024 · 0 comments

Comments

@damyl4sure
Copy link

damyl4sure commented Dec 5, 2024

https://github.com/rbarrois/python-semanticversion/blob/2cbbee3154d9011cee873ae3a020cd17c669f6df/semantic_version/__init__.py#L16C5-L16C25

Since pkg_resources module is now part of setuptools library. Directly importing pkg_resources throws an error on Python version 2.

I think the issue started from version 2.9.0 when this block was added to the semantic_version/init.py:

try:
    # Python 3.8+
    from importlib.metadata import version

    __version__ = version("semantic_version")
except ImportError:
    import pkg_resources

Error logs:

File "/builds/home/project/lib/python2.7/site-packages/semantic_version/__init__.py", line 16, in <module>
      import pkg_resources
    File "/builds/home/project/lib/python2.7/site-packages/pkg_resources/__init__.py", line 124
      f"{v} is an invalid version and will not be supported in "
                                                               ^
  SyntaxError: invalid syntax
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

No branches or pull requests

1 participant