Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Migrate to Poetry v2 and project-managed Poetry plugins #34

Merged
merged 13 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .coveragerc

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ concurrency:
jobs:
linux-build-and-test:
name: "Linux"
uses: pronovic/gha-shared-workflows/.github/workflows/poetry-build-and-test.yml@v7
uses: pronovic/gha-shared-workflows/.github/workflows/poetry-build-and-test.yml@v8
secrets: inherit
with:
matrix-os-version: "[ 'ubuntu-latest' ]"
Expand All @@ -25,22 +25,22 @@ jobs:
persist-python-version: "3.10" # persist artifacts for the oldest supported Python version
macos-build-and-test:
name: "MacOS"
uses: pronovic/gha-shared-workflows/.github/workflows/poetry-build-and-test.yml@v7
uses: pronovic/gha-shared-workflows/.github/workflows/poetry-build-and-test.yml@v8
secrets: inherit
with:
matrix-os-version: "[ 'macos-latest' ]"
matrix-python-version: "[ '3.13' ]" # only run MacOS tests on latest Python
windows-build-and-test:
name: "Windows"
uses: pronovic/gha-shared-workflows/.github/workflows/poetry-build-and-test.yml@v7
uses: pronovic/gha-shared-workflows/.github/workflows/poetry-build-and-test.yml@v8
secrets: inherit
with:
matrix-os-version: "[ 'windows-latest' ]"
matrix-python-version: "[ '3.13' ]" # only run Windows tests on latest Python
release:
name: "Release"
if: github.ref_type == 'tag'
uses: pronovic/gha-shared-workflows/.github/workflows/poetry-release.yml@v7
uses: pronovic/gha-shared-workflows/.github/workflows/poetry-release.yml@v8
needs: [ linux-build-and-test, macos-build-and-test, windows-build-and-test ]
secrets: inherit
with:
Expand Down
35 changes: 0 additions & 35 deletions .mypy.ini

This file was deleted.

1 change: 0 additions & 1 deletion .pytest.ini

This file was deleted.

8 changes: 4 additions & 4 deletions .run/commands/bumpchangelog.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# vim: set ft=bash ts=3 sw=3 expandtab:
# Bump the version in the changelog, preparing for a new development cycle

# If pyproject.toml is configured to use the poetry-dynamic-versioning plugin,
# then you need to have it installed locally, or you will get unexpected results
# from this command. The new version in the Changelog will always be "0.0.1",
# because all Poetry is aware of is the hardcoded version "0.0.0".
# This relies on the poetry-dynamic-versioning plugin, which is assumed to be
# installed as a project plugin. If it's not installed, the new version in the
# Changelog will always be "0.0.1", because all Poetry is aware of is the
# hardcoded version "0.0.0".

command_bumpchangelog() {
mv Changelog Changelog.$$
Expand Down
6 changes: 3 additions & 3 deletions .run/commands/outdated.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
command_outdated() {
echo "Updating dependencies with current constraints..."
echo ""
poetry update
poetry update --sync --with=dev
if [ $? != 0 ]; then
echo "*** Failed to update dependencies"
exit 1
Expand All @@ -16,13 +16,13 @@ command_outdated() {
echo "Checking for outdated constraints..."
echo ""

PATTERNS=$(poetry show --tree | grep '^\w' | cut -d' ' -f1 | sed 's/.*/^&\\s/')
PATTERNS=$(poetry show --with=dev --tree | grep '^\w' | cut -d' ' -f1 | sed 's/.*/^&\\s/')
if [ $? != 0 ]; then
echo "*** Failed to run 'poetry show --tree'"
exit 1
fi

OUTDATED=$(poetry show --outdated)
OUTDATED=$(poetry show --with=dev --outdated)
if [ $? != 0 ]; then
echo "*** Failed to run 'poetry show --outdated'"
exit 1
Expand Down
12 changes: 0 additions & 12 deletions .run/commands/poetryplugin.sh

This file was deleted.

2 changes: 1 addition & 1 deletion .run/commands/virtualenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Create and update the virtualenv, synchronizing it to versions in poetry.lock

command_virtualenv() {
poetry install --sync --all-extras
poetry sync --all-extras --all-groups
if [ $? != 0 ]; then
echo "*** Failed to install the virtualenv"
exit 1
Expand Down
1 change: 1 addition & 0 deletions .run/tasks/docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ help_docs() {
}

task_docs() {
run_command virtualenv # work around the fact that Poetry sometimes uninstalls extras
run_command sphinx "$@"
}

7 changes: 7 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
Version 0.1.26 unreleased

* Migrate to Poetry v2 and project-managed Poetry plugins.
* Move configuration into pyproject.toml for pytest, mypy & coverage.
* Upgrade to gha-shared-workflows@v8 for Poetry v2 support.
* Update all dependencies and outdated constraints.

Version 0.1.25 02 Jan 2025

* Add GitHub security policy in SECURITY.md.
Expand Down
18 changes: 6 additions & 12 deletions DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This code should work equivalently on MacOS, Linux, and Windows.

## Packaging and Dependencies

This project uses [Poetry](https://python-poetry.org/) to manage Python packaging and dependencies. Most day-to-day tasks (such as running unit tests from the command line) are orchestrated through Poetry.
This project uses [Poetry v2](https://python-poetry.org/) to manage Python packaging and dependencies. Most day-to-day tasks (such as running unit tests from the command line) are orchestrated through Poetry.

A coding standard is enforced using [Black](https://pypi.org/project/black/), [isort](https://pypi.org/project/isort/) and [Pylint](https://pypi.org/project/pylint/). Python 3 type hinting is validated using [MyPy](https://pypi.org/project/mypy/).

Expand Down Expand Up @@ -34,7 +34,7 @@ sure that you have a working Python 3 enviroment and install Poetry itself.

### Poetry Version

The project is designed to work with Poetry >= 1.8.0. If you already have an older
The project is designed to work with Poetry >= 2.0.0. If you already have an older
version of Poetry installed on your system, upgrade it first.

### MacOS
Expand All @@ -53,14 +53,12 @@ Finally, install Poetry itself and then verify your installation:

```
pipx install poetry
pipx inject poetry poetry-dynamic-versioning
pipx list --include-injected
```

To upgrade this installation later, use:

```
pipx upgrade --include-injected poetry
pipx upgrade poetry
```

### Debian
Expand All @@ -78,14 +76,12 @@ Finally, install Poetry itself and then verify your installation:

```
pipx install poetry
pipx inject poetry poetry-dynamic-versioning
pipx list --include-injected
```

To upgrade this installation later, use:

```
pipx upgrade --include-injected poetry
pipx upgrade poetry
```

### Windows
Expand All @@ -104,14 +100,12 @@ Finally, install Poetry itself and then verify your installation:

```
pipx install poetry
pipx inject poetry poetry-dynamic-versioning
pipx list --include-injected
```

To upgrade this installation later, use:

```
pipx upgrade --include-injected poetry
pipx upgrade poetry
```

> _Note:_ The development environment (the `run` script, etc.) expects a bash
Expand Down Expand Up @@ -193,7 +187,7 @@ Go to the PyCharm settings and find the `uci-parse` project. Under
the **Exclude Files** box, enter the following:

```
LICENSE;NOTICE;PyPI.md;.coverage;.coveragerc;.github;.gitignore;.gitattributes;.htmlcov;.idea;.isort.cfg;.mypy.ini;.mypy_cache;.pre-commit-config.yaml;.pylintrc;.pytest_cache;.pytest.ini;.readthedocs.yml;.tabignore;build;dist;docs/_build;out;poetry.lock;poetry.toml;run;.run;.venv;
LICENSE;NOTICE;PyPI.md;build;dist;docs/_build;out;poetry.lock;poetry.toml;run;.coverage;.coverage.lcov;.coveragerc;.gitattributes;.github;.gitignore;.htmlcov;.idea;.mypy_cache;.poetry;.pre-commit-config.yaml;.pylintrc;.pytest_cache;.readthedocs.yml;.run;.tabignore;.venv
```

When you're done, click **Ok**. Then, go to the gear icon in the project panel
Expand Down
Loading
Loading