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

[InvalidVersion]: Invalid version: '' #3020

Closed
1 task done
raxod502 opened this issue Jul 15, 2024 · 1 comment · Fixed by #3021
Closed
1 task done

[InvalidVersion]: Invalid version: '' #3020

raxod502 opened this issue Jul 15, 2024 · 1 comment · Fixed by #3021
Assignees
Labels
🐛 bug Something isn't working

Comments

@raxod502
Copy link

raxod502 commented Jul 15, 2024

  • 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

{raxod502@cephandrius} pdm-example % pdm init -n
Creating a pyproject.toml for PDM...
Virtualenv is created successfully at /home/raxod502/files/temp/pdm-example/.venv
Project is initialized successfully
{raxod502@cephandrius} pdm-example % pdm add git+https://github.com/evanpurkhiser/venmo-auto-cashout.git
Adding packages to default dependencies: git+https://github.com/evanpurkhiser/venmo-auto-cashout.git
See /home/raxod502/.local/state/pdm/log/pdm-lock-cqi0vajl.log for detailed debug log.
[InvalidVersion]: Invalid version: ''
WARNING: Add '-v' to see the detailed traceback
Verbose output
{raxod502@cephandrius} pdm-example % pdm add git+https://github.com/evanpurkhiser/venmo-auto-cashout.git -v
Adding packages to default dependencies: git+https://github.com/evanpurkhiser/venmo-auto-cashout.git
STATUS: Resolving dependencies
pdm.termui: ======== Start resolving requirements ========
pdm.termui:   git+https://github.com/evanpurkhiser/venmo-auto-cashout.git
pdm.termui:   python==3.10.*
pdm.termui:   Adding requirement git+https://github.com/evanpurkhiser/venmo-auto-cashout.git
unearth.vcs.git: Cloning https://github.com/evanpurkhiser/venmo-auto-cashout.git to /tmp/pdm-build-abwn7_ca
unearth.vcs.git: Resolved https://github.com/evanpurkhiser/venmo-auto-cashout.git to commit 4857f4ce4c5c2ba674125cf542bc0fc7e3810520
pdm.termui:   Adding requirement python==3.10.*
pdm.termui: ======== Starting round 0 ========
STATUS: Resolving: new pin python==3.10.*
pdm.termui: Pinning: python None
pdm.termui: ======== Ending round 0 ========
pdm.termui: ======== Starting round 1 ========
pdm.termui:   Adding requirement venmo-api-unofficial @ https://github.com/evanpurkhiser/venmo-api-unofficial/archive/13bf98aa9b12f4b48f3326028bfd12dc5dfbbdce.tar.gz(from venmo-auto-cashout 1.0)
pdm.termui:   Adding requirement sentry-sdk~=1.5(from venmo-auto-cashout 1.0)
pdm.termui:   Adding requirement lunchable>=0.8.2(from venmo-auto-cashout 1.0)
STATUS: Resolving: new pin venmo-auto-cashout 1.0
pdm.termui: Pinning: venmo-auto-cashout 1.0
pdm.termui: ======== Ending round 1 ========
pdm.termui: ======== Starting round 2 ========
unearth.preparer: Downloading <Link https://github.com/evanpurkhiser/venmo-api-unofficial/archive/13bf98aa9b12f4b48f3326028bfd12dc5dfbbdce.tar.gz (from None)> (31 kB)
pdm.termui:   Adding requirement requests>=2.19.0(from venmo-api-unofficial )
STATUS: Resolving: new pin venmo-api-unofficial 
pdm.termui: Pinning: venmo-api-unofficial 
pdm.termui: ======== Ending round 2 ========
pdm.termui: ======== Starting round 3 ========
pdm.termui:   Adding requirement click-plugins>=1.1.1(from lunchable 1.3.3)
pdm.termui:   Adding requirement click>=8.0.1(from lunchable 1.3.3)
pdm.termui:   Adding requirement httpx(from lunchable 1.3.3)
pdm.termui:   Adding requirement importlib-metadata>=3.6(from lunchable 1.3.3)
pdm.termui:   Adding requirement pydantic<3,>=2(from lunchable 1.3.3)
pdm.termui:   Adding requirement rich>=10.0.0(from lunchable 1.3.3)
STATUS: Resolving: new pin lunchable 1.3.3
pdm.termui: Pinning: lunchable 1.3.3
pdm.termui: ======== Ending round 3 ========
pdm.termui: ======== Starting round 4 ========
pdm.termui:   Adding requirement certifi(from sentry-sdk 1.45.0)
pdm.termui:   Adding requirement urllib3>=1.26.11; python_version >= "3.6"(from sentry-sdk 1.45.0)
STATUS: Resolving: new pin sentry-sdk 1.45.0
pdm.termui: Pinning: sentry-sdk 1.45.0
pdm.termui: ======== Ending round 4 ========
pdm.termui: ======== Starting round 5 ========
pdm.termui:   Adding requirement annotated-types>=0.4.0(from pydantic 2.8.2)
pdm.termui:   Adding requirement pydantic-core==2.20.1(from pydantic 2.8.2)
pdm.termui:   Adding requirement typing-extensions>=4.6.1; python_version < "3.13"(from pydantic 2.8.2)
STATUS: Resolving: new pin pydantic 2.8.2
pdm.termui: Pinning: pydantic 2.8.2
pdm.termui: ======== Ending round 5 ========
pdm.termui: ======== Starting round 6 ========
pdm.termui:   Adding requirement typing-extensions!=4.7.0,>=4.6.0(from pydantic-core 2.20.1)
STATUS: Resolving: new pin pydantic-core 2.20.1
pdm.termui: Pinning: pydantic-core 2.20.1
pdm.termui: ======== Ending round 6 ========
pdm.termui: ======== Starting round 7 ========
pdm.termui:   Adding requirement colorama; platform_system == "Windows"(from click 8.1.7)
STATUS: Resolving: new pin click 8.1.7
pdm.termui: Pinning: click 8.1.7
pdm.termui: ======== Ending round 7 ========
pdm.termui: ======== Starting round 8 ========
pdm.termui:   Adding requirement click>=4.0(from click-plugins 1.1.1)
STATUS: Resolving: new pin click-plugins 1.1.1
pdm.termui: Pinning: click-plugins 1.1.1
pdm.termui: ======== Ending round 8 ========
pdm.termui: ======== Starting round 9 ========
pdm.termui:   Adding requirement zipp>=0.5(from importlib-metadata 8.0.0)
STATUS: Resolving: new pin importlib-metadata 8.0.0
pdm.termui: Pinning: importlib-metadata 8.0.0
pdm.termui: ======== Ending round 9 ========
pdm.termui: ======== Starting round 10 ========
pdm.termui:   Adding requirement charset-normalizer<4,>=2(from requests 2.32.3)
pdm.termui:   Adding requirement idna<4,>=2.5(from requests 2.32.3)
pdm.termui:   Adding requirement urllib3<3,>=1.21.1(from requests 2.32.3)
pdm.termui:   Adding requirement certifi>=2017.4.17(from requests 2.32.3)
STATUS: Resolving: new pin requests 2.32.3
pdm.termui: Pinning: requests 2.32.3
pdm.termui: ======== Ending round 10 ========
pdm.termui: ======== Starting round 11 ========
STATUS: Resolving: new pin urllib3 2.2.2
pdm.termui: Pinning: urllib3 2.2.2
pdm.termui: ======== Ending round 11 ========
pdm.termui: ======== Starting round 12 ========
STATUS: Resolving: new pin certifi 2024.7.4
pdm.termui: Pinning: certifi 2024.7.4
pdm.termui: ======== Ending round 12 ========
pdm.termui: ======== Starting round 13 ========
pdm.termui:   Adding requirement markdown-it-py>=2.2.0(from rich 13.7.1)
pdm.termui:   Adding requirement pygments<3.0.0,>=2.13.0(from rich 13.7.1)
STATUS: Resolving: new pin rich 13.7.1
pdm.termui: Pinning: rich 13.7.1
pdm.termui: ======== Ending round 13 ========
pdm.termui: ======== Starting round 14 ========
pdm.termui:   Adding requirement anyio(from httpx 0.27.0)
pdm.termui:   Adding requirement certifi(from httpx 0.27.0)
pdm.termui:   Adding requirement httpcore==1.*(from httpx 0.27.0)
pdm.termui:   Adding requirement idna(from httpx 0.27.0)
pdm.termui:   Adding requirement sniffio(from httpx 0.27.0)
STATUS: Resolving: new pin httpx 0.27.0
pdm.termui: Pinning: httpx 0.27.0
pdm.termui: ======== Ending round 14 ========
pdm.termui: ======== Starting round 15 ========
pdm.termui:   Adding requirement certifi(from httpcore 1.0.5)
pdm.termui:   Adding requirement h11<0.15,>=0.13(from httpcore 1.0.5)
STATUS: Resolving: new pin httpcore 1.0.5
pdm.termui: Pinning: httpcore 1.0.5
pdm.termui: ======== Ending round 15 ========
pdm.termui: ======== Starting round 16 ========
STATUS: Resolving: new pin typing-extensions 4.12.2
pdm.termui: Pinning: typing-extensions 4.12.2
pdm.termui: ======== Ending round 16 ========
pdm.termui: ======== Starting round 17 ========
STATUS: Resolving: new pin charset-normalizer 3.3.2
pdm.termui: Pinning: charset-normalizer 3.3.2
pdm.termui: ======== Ending round 17 ========
pdm.termui: ======== Starting round 18 ========
STATUS: Resolving: new pin idna 3.7
pdm.termui: Pinning: idna 3.7
pdm.termui: ======== Ending round 18 ========
pdm.termui: ======== Starting round 19 ========
STATUS: Resolving: new pin pygments 2.18.0
pdm.termui: Pinning: pygments 2.18.0
pdm.termui: ======== Ending round 19 ========
pdm.termui: ======== Starting round 20 ========
STATUS: Resolving: new pin annotated-types 0.7.0
pdm.termui: Pinning: annotated-types 0.7.0
pdm.termui: ======== Ending round 20 ========
pdm.termui: ======== Starting round 21 ========
pdm.termui:   Adding requirement mdurl~=0.1(from markdown-it-py 3.0.0)
STATUS: Resolving: new pin markdown-it-py 3.0.0
pdm.termui: Pinning: markdown-it-py 3.0.0
pdm.termui: ======== Ending round 21 ========
pdm.termui: ======== Starting round 22 ========
STATUS: Resolving: new pin zipp 3.19.2
pdm.termui: Pinning: zipp 3.19.2
pdm.termui: ======== Ending round 22 ========
pdm.termui: ======== Starting round 23 ========
pdm.termui:   Adding requirement idna>=2.8(from anyio 4.4.0)
pdm.termui:   Adding requirement sniffio>=1.1(from anyio 4.4.0)
pdm.termui:   Adding requirement exceptiongroup>=1.0.2; python_version < "3.11"(from anyio 4.4.0)
pdm.termui:   Adding requirement typing-extensions>=4.1; python_version < "3.11"(from anyio 4.4.0)
STATUS: Resolving: new pin anyio 4.4.0
pdm.termui: Pinning: anyio 4.4.0
pdm.termui: ======== Ending round 23 ========
pdm.termui: ======== Starting round 24 ========
STATUS: Resolving: new pin sniffio 1.3.1
pdm.termui: Pinning: sniffio 1.3.1
pdm.termui: ======== Ending round 24 ========
pdm.termui: ======== Starting round 25 ========
STATUS: Resolving: new pin colorama 0.4.6
pdm.termui: Pinning: colorama 0.4.6
pdm.termui: ======== Ending round 25 ========
pdm.termui: ======== Starting round 26 ========
STATUS: Resolving: new pin h11 0.14.0
pdm.termui: Pinning: h11 0.14.0
pdm.termui: ======== Ending round 26 ========
pdm.termui: ======== Starting round 27 ========
STATUS: Resolving: new pin exceptiongroup 1.2.2
pdm.termui: Pinning: exceptiongroup 1.2.2
pdm.termui: ======== Ending round 27 ========
pdm.termui: ======== Starting round 28 ========
STATUS: Resolving: new pin mdurl 0.1.2
pdm.termui: Pinning: mdurl 0.1.2
pdm.termui: ======== Ending round 28 ========
pdm.termui: ======== Starting round 29 ========
pdm.termui: ======== Resolution Result ========
pdm.termui: Stable pins:
pdm.termui:                 python None
pdm.termui:     :empty:ufo5TeU5Y2M git+https://github.com/evanpurkhiser/venmo-auto-cashout.git@4857f4ce4c5c2ba674125cf542bc0fc7e3810520
pdm.termui:   venmo-api-unofficial https://github.com/evanpurkhiser/venmo-api-unofficial/archive/13bf98aa9b12f4b48f3326028bfd12dc5dfbbdce.tar.gz
pdm.termui:              lunchable 1.3.3
pdm.termui:             sentry-sdk 1.45.0
pdm.termui:               pydantic 2.8.2
pdm.termui:          pydantic-core 2.20.1
pdm.termui:                  click 8.1.7
pdm.termui:          click-plugins 1.1.1
pdm.termui:     importlib-metadata 8.0.0
pdm.termui:               requests 2.32.3
pdm.termui:                urllib3 2.2.2
pdm.termui:                certifi 2024.7.4
pdm.termui:                   rich 13.7.1
pdm.termui:                  httpx 0.27.0
pdm.termui:               httpcore 1.0.5
pdm.termui:      typing-extensions 4.12.2
pdm.termui:     charset-normalizer 3.3.2
pdm.termui:                   idna 3.7
pdm.termui:               pygments 2.18.0
pdm.termui:        annotated-types 0.7.0
pdm.termui:         markdown-it-py 3.0.0
pdm.termui:                   zipp 3.19.2
pdm.termui:                  anyio 4.4.0
pdm.termui:                sniffio 1.3.1
pdm.termui:               colorama 0.4.6
pdm.termui:                    h11 0.14.0
pdm.termui:         exceptiongroup 1.2.2
pdm.termui:                  mdurl 0.1.2
STATUS: Fetching hashes for resolved packages...
pdm.termui: Fetching hashes for venmo-api-unofficial@https://github.com/evanpurkhiser/venmo-api-unofficial/archive/13bf98aa9b12f4b48f3326028bfd12dc5dfbbdce.tar.gz
pdm.termui: Fetching hashes for [email protected]
pdm.termui: Fetching hashes for [email protected]
pdm.termui: Fetching hashes for [email protected]
pdm.termui: Fetching hashes for [email protected]
pdm.termui: Fetching hashes for [email protected]
pdm.termui: Fetching hashes for [email protected]
pdm.termui: Fetching hashes for [email protected]
pdm.termui: Fetching hashes for [email protected]
pdm.termui: Fetching hashes for [email protected]
pdm.termui: Fetching hashes for [email protected]
pdm.termui: Fetching hashes for [email protected]
pdm.termui: Fetching hashes for [email protected]
pdm.termui: Fetching hashes for [email protected]
pdm.termui: Fetching hashes for [email protected]
pdm.termui: Fetching hashes for [email protected]
pdm.termui: Fetching hashes for [email protected]
pdm.termui: Fetching hashes for [email protected]
pdm.termui: Fetching hashes for [email protected]
pdm.termui: Fetching hashes for [email protected]
pdm.termui: Fetching hashes for [email protected]
pdm.termui: Fetching hashes for [email protected]
pdm.termui: Fetching hashes for [email protected]
pdm.termui: Fetching hashes for [email protected]
pdm.termui: Fetching hashes for [email protected]
pdm.termui: Fetching hashes for [email protected]
pdm.termui: Fetching hashes for [email protected]
Traceback (most recent call last):
  File "/usr/bin/pdm", line 12, in <module>
    sys.exit(main())
  File "/opt/pdm/local/lib/python3.10/dist-packages/pdm/core.py", line 363, in main
    return core.main(args or sys.argv[1:])
  File "/opt/pdm/local/lib/python3.10/dist-packages/pdm/core.py", line 281, in main
    raise cast(Exception, err).with_traceback(traceback) from None
  File "/opt/pdm/local/lib/python3.10/dist-packages/pdm/core.py", line 276, in main
    self.handle(project, options)
  File "/opt/pdm/local/lib/python3.10/dist-packages/pdm/core.py", line 212, in handle
    command.handle(project, options)
  File "/opt/pdm/local/lib/python3.10/dist-packages/pdm/cli/commands/add.py", line 69, in handle
    self.do_add(
  File "/opt/pdm/local/lib/python3.10/dist-packages/pdm/cli/commands/add.py", line 162, in do_add
    resolved = do_lock(
  File "/opt/pdm/local/lib/python3.10/dist-packages/pdm/cli/actions.py", line 126, in do_lock
    data = format_lockfile(project, mapping, dependencies, groups=groups, strategy=lock_strategy)
  File "/opt/pdm/local/lib/python3.10/dist-packages/pdm/cli/utils.py", line 533, in format_lockfile
    base.update(v.as_lockfile_entry(project.root))
  File "/opt/pdm/local/lib/python3.10/dist-packages/pdm/models/candidates.py", line 265, in as_lockfile_entry
    version = str(comparable_version(version))
  File "/opt/pdm/local/lib/python3.10/dist-packages/pdm/utils.py", line 351, in comparable_version
    parsed = parse_version(version)
  File "/opt/pdm/local/lib/python3.10/dist-packages/pdm/utils.py", line 47, in parse_version
    return Version(version)
  File "/opt/pdm/local/lib/python3.10/dist-packages/packaging/version.py", line 202, in __init__
    raise InvalidVersion(f"Invalid version: '{version}'")
packaging.version.InvalidVersion: Invalid version: ''

Actual behavior

Presumably, the error comes from some dependency. However, the error message doesn't help identify which one.

I ran into a different error when trying to use Poetry to add the same dependency, and submitted a PR upstream at evanpurkhiser/venmo-api-unofficial#1. Maybe this error in PDM has the same root cause, but the error message doesn't make it clear if that is the case or not.

Notably the project in question (https://github.com/evanpurkhiser/venmo-auto-cashout) actually uses PDM, and pdm install works fine in that repository. But for some reason trying to add the same repository as a dependency does not work.

Expected behavior

The reason for the error should be surfaced in the error.

Environment Information

{raxod502@cephandrius} pdm-example % pdm info      
PDM version:
  2.16.1
Python Interpreter:
  /home/raxod502/files/temp/pdm-example/.venv/bin/python (3.10)
Project Root:
  /home/raxod502/files/temp/pdm-example
Local Packages:
  
{raxod502@cephandrius} pdm-example % pdm info --env
{
  "implementation_name": "cpython",
  "implementation_version": "3.10.12",
  "os_name": "posix",
  "platform_machine": "x86_64",
  "platform_release": "6.9.3-76060903-generic",
  "platform_system": "Linux",
  "platform_version": "#202405300957~1718348209~22.04~7817b67 SMP PREEMPT_DYNAMIC Mon J",
  "python_full_version": "3.10.12",
  "platform_python_implementation": "CPython",
  "python_version": "3.10",
  "sys_platform": "linux"
}
@raxod502 raxod502 added the 🐛 bug Something isn't working label Jul 15, 2024
@frostming frostming self-assigned this Jul 15, 2024
frostming added a commit that referenced this issue Jul 15, 2024
@frostming
Copy link
Collaborator

Maybe this error in PDM has the same root cause, but the error message doesn't make it clear if that is the case or not.

The same package has an invalid version ('')

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

Successfully merging a pull request may close this issue.

2 participants