Skip to content

Poetry 2.0 compatibility #201

@dalito

Description

@dalito

Today poetry 2.0 came out and it seems that your plugin does not yet work with PEP-621 pyproject.toml where for example the project name is in the [project] section.

[project]
# Storing project metadata in pyproject.toml 
name = "mything"

I get an unbound local error with poetry-dynamic-versioning version 1.4.1:

 UnboundLocalError

  cannot access local variable 'name' where it is not associated with a value

  at ~\.local\pipx\venvs\poetry\Lib\site-packages\poetry_dynamic_versioning\__init__.py:668 in _get_and_apply_version
      664│         name = pyproject["project"]["name"]
      665│         original = pyproject["project"].get("version")
      666│         dynamic_index = pyproject["project"]["dynamic"].index("version")
      667│     else:
    → 668│         return name if name in _state.projects else None
      669│
      670│     if name in _state.projects:
      671│         return name
      672│

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions