Skip to content

packaging 23.0 breaks the tests #200

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

Closed
sharonyogev opened this issue Mar 12, 2023 · 1 comment
Closed

packaging 23.0 breaks the tests #200

sharonyogev opened this issue Mar 12, 2023 · 1 comment

Comments

@sharonyogev
Copy link
Contributor

in packaging 23.0 the deprecated LegacyVersion was removed, see: pypa/packaging#321
So we have a failing tests:

================================================================================ FAILURES =================================================================================
_______________________________________________________________________ test_parse_default_pattern ________________________________________________________________________

    def test_parse_default_pattern():
        project_path    = util.FIXTURES_DIR / "project_c"
        config_path     = util.FIXTURES_DIR / "project_c" / "pyproject.toml"
        config_rel_path = "pyproject.toml"

        ctx = config.init_project_ctx(project_path)

        assert ctx == config.ProjectContext(project_path, config_path, config_rel_path, "toml", None)

        cfg = config.parse(ctx)

>       assert cfg
E       assert None

test/test_config.py:339: AssertionError
---------------------------------------------------------------------------- Captured log call ----------------------------------------------------------------------------
WARNING  bumpver.config:config.py:480 Couldn't parse pyproject.toml: Invalid version: 'v2017q1.54321'

and this is the traceback:

Traceback (most recent call last):
  File "/home/sharon/work/bumpver/src/bumpver/config.py", line 478, in parse
    return _parse_config(raw_cfg)
  File "/home/sharon/work/bumpver/src/bumpver/config.py", line 377, in _parse_config
    pep440_version = version.to_pep440(current_version)
  File "/home/sharon/work/bumpver/src/bumpver/version.py", line 180, in to_pep440
    return str(parse_version(version))
  File "/home/sharon/work/bumpver/src/bumpver/version.py", line 16, in parse_version
    return pkg_resources.parse_version(version)
  File "/home/sharon/miniconda3/envs/bumpver_py39/lib/python3.9/site-packages/pkg_resources/_vendor/packaging/version.py", line 197, in __init__
    raise InvalidVersion(f"Invalid version: '{version}'")
@mbarkhau
Copy link
Owner

Thanks for the update. Have you looked into how to fix this? Would you be in a position to create a PR?

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

2 participants