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

Support for comma separated multiple version requirements #79

Open
radusuciu opened this issue May 25, 2023 · 3 comments
Open

Support for comma separated multiple version requirements #79

radusuciu opened this issue May 25, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@radusuciu
Copy link
Contributor

Hi, thanks for the great project -- really awesome tool!

I encountered an error because in my pyproject.toml I specify some dependency ranges using the comma separated syntax which is supported by poetry as well as pdm and documented in PEP440. For example, this is a valid PDM pyproject.toml:

[project]
name = "test_pcu"
version="0.0.1"
dependencies = [
    "svglib>=1.5.0,<2.0.0",
]
requires-python = ">=3.11"
license = {text = "MIT"}

However, pip-check-updates fails to parse this, giving this error:

Traceback (most recent call last):
  File "/usr/local/bin/pcu", line 8, in <module>
    sys.exit(run())
             ^^^^^
  File "/usr/local/lib/python3.11/site-packages/pip_check_updates/__main__.py", line 70, in run
    deps = load_dependencies(req_path, not no_recursive, extra)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pip_check_updates/parser.py", line 167, in load_dependencies
    load_toml(deps, f, p, pyproject=True, extras=extras)
  File "/usr/local/lib/python3.11/site-packages/pip_check_updates/parser.py", line 111, in load_toml
    packages = parse_requirements_lines(config.get(package_key, []))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pip_check_updates/parser.py", line 101, in parse_requirements_lines
    requirements = [
                   ^
  File "/usr/local/lib/python3.11/site-packages/pip_check_updates/parser.py", line 102, in <listcomp>
    get_current_version(clean_requirements_line(requirement_line))
  File "/usr/local/lib/python3.11/site-packages/pip_check_updates/version.py", line 52, in get_current_version
    name, current_version = split_line
    ^^^^^^^^^^^^^^^^^^^^^
ValueError: too many values to unpack (expected 2)
@zehengl zehengl self-assigned this May 27, 2023
@zehengl zehengl added the enhancement New feature or request label May 27, 2023
@zehengl
Copy link
Owner

zehengl commented May 27, 2023

@all-contributors please add @radusuciu for bug

@allcontributors
Copy link
Contributor

@zehengl

I've put up a pull request to add @radusuciu! 🎉

@radusuciu
Copy link
Contributor Author

Workaround in the meantime: specify dependencies with ~= instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants