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

pdm crashes with python build from source #1631

Closed
1 task done
ssbarnea opened this issue Jan 18, 2023 · 2 comments
Closed
1 task done

pdm crashes with python build from source #1631

ssbarnea opened this issue Jan 18, 2023 · 2 comments
Labels
🐛 bug Something isn't working

Comments

@ssbarnea
Copy link

ssbarnea commented Jan 18, 2023

  • I have searched the issue tracker and believe that this is not a duplicate.

Make sure you run commands with -v flag before pasting the output.

Steps to reproduce

Build python from source, using pyenv to install a -dev edition suck 3.11-dev should suffice.

Actual behavior

Traceback (most recent call last):
  File "/Users/ssbarnea/.pyenv/versions/3.11-dev/bin/pdm", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/ssbarnea/.pyenv/versions/3.11-dev/lib/python3.11/site-packages/pdm/core.py", line 259, in main
    return Core().main(args)
           ^^^^^^^^^^^^^^^^^
  File "/Users/ssbarnea/.pyenv/versions/3.11-dev/lib/python3.11/site-packages/pdm/core.py", line 205, in main
    check_update(project)
  File "/Users/ssbarnea/.pyenv/versions/3.11-dev/lib/python3.11/site-packages/pdm/cli/actions.py", line 862, in check_update
    latest_version = get_latest_version(project)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ssbarnea/.pyenv/versions/3.11-dev/lib/python3.11/site-packages/pdm/cli/actions.py", line 848, in get_latest_version
    latest_version = get_latest_pdm_version_from_pypi(project)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ssbarnea/.pyenv/versions/3.11-dev/lib/python3.11/site-packages/pdm/cli/actions.py", line 830, in get_latest_pdm_version_from_pypi
    with environment.get_finder([project.default_source]) as finder:
  File "/Users/ssbarnea/.pyenv/versions/3.11-dev/lib/python3.11/contextlib.py", line 137, in __enter__
    return next(self.gen)
           ^^^^^^^^^^^^^^
  File "/Users/ssbarnea/.pyenv/versions/3.11-dev/lib/python3.11/site-packages/pdm/models/environment.py", line 166, in get_finder
    target_python=self.target_python,
                  ^^^^^^^^^^^^^^^^^^
  File "/Users/ssbarnea/.pyenv/versions/3.11-dev/lib/python3.11/functools.py", line 1001, in __get__
    val = self.func(instance)
          ^^^^^^^^^^^^^^^^^^^
  File "/Users/ssbarnea/.pyenv/versions/3.11-dev/lib/python3.11/site-packages/pdm/models/environment.py", line 116, in target_python
    python_version = self.interpreter.version_tuple
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ssbarnea/.pyenv/versions/3.11-dev/lib/python3.11/site-packages/pdm/models/python.py", line 64, in version_tuple
    return (self.major, self.minor, self.micro)
            ^^^^^^^^^^
  File "/Users/ssbarnea/.pyenv/versions/3.11-dev/lib/python3.11/site-packages/pdm/models/python.py", line 52, in major
    return self._py_ver.major
           ^^^^^^^^^^^^^^^^^^
  File "/Users/ssbarnea/.pyenv/versions/3.11-dev/lib/python3.11/site-packages/findpython/python.py", line 71, in major
    return self.version.major
           ^^^^^^^^^^^^
  File "/Users/ssbarnea/.pyenv/versions/3.11-dev/lib/python3.11/site-packages/findpython/python.py", line 65, in version
    self._version = self._get_version()
                    ^^^^^^^^^^^^^^^^^^^
  File "/Users/ssbarnea/.pyenv/versions/3.11-dev/lib/python3.11/site-packages/findpython/python.py", line 165, in _get_version
    return Version(version)
           ^^^^^^^^^^^^^^^^
  File "/Users/ssbarnea/.pyenv/versions/3.11-dev/lib/python3.11/site-packages/packaging/version.py", line 197, in __init__
    raise InvalidVersion(f"Invalid version: '{version}'")
packaging.version.InvalidVersion: Invalid version: '3.11.0+'
make: *** [check] Error 1

Expected behavior

Environment Information

# Paste the output of `pdm info && pdm info --env` below:
N/A due to crash, but installed latest using pip

$ python3 --version
Python 3.11.0+

Apparently the bug is caused by frostming/findpython#12 but the fact that it was not addressed in more than 3 months makes me wonder about how safe is to add pdm as a project dependency.

@ssbarnea ssbarnea added the 🐛 bug Something isn't working label Jan 18, 2023
@frostming
Copy link
Collaborator

Apparently the bug is caused by frostming/findpython#12 but the fact that it was not addressed in more than 3 months makes me wonder about how safe is to add pdm as a project dependency.

It is not clear how we should fix the issue, the version parser and the version range depend on packaging which doesn't support the version as such.

@ssbarnea
Copy link
Author

Duplicate of #1510

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants