Skip to content

Commit

Permalink
Support the [project] section (PEP 621)
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed May 19, 2024
1 parent 983f69f commit 13c6397
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ jobs:
poetry-version: '1.7.1'
- python-version: '3.7'
poetry-version: '1.8.1'
include:
- python-version: '3.11'
poetry-version: 'git+https://github.com/radoering/poetry.git@pep621-support'
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -52,7 +55,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- run: |
pip install pipx
pipx install poetry==${{ matrix.poetry-version }}
pipx install ${{ startsWith(matrix.poetry-version, 'git') && matrix.poetry-version || format('poetry=={0}', matrix.poetry-version) }}
pipx install invoke
poetry install --extras plugin
Expand Down
3 changes: 2 additions & 1 deletion poetry_dynamic_versioning/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ def _apply_version_via_plugin(
io: bool = True
# fmt: on
) -> None:
project_section = poetry.pyproject.data.get("project", {})
name = _get_and_apply_version(
name=poetry.local_config["name"],
name=project_section.get("name") or poetry.local_config["name"],
original=poetry.local_config["version"],
pyproject=poetry.pyproject.data,
pyproject_path=_get_pyproject_path_from_poetry(poetry.pyproject),
Expand Down

0 comments on commit 13c6397

Please sign in to comment.