-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Python package metadata (#64)
* Replace Poetry with PDM. * Rewrite `pyproject.toml` to make it fully PEP-621 compliant, with some PDM options defined such as development dependencies. * Switch to dynamic version management using [`setuptools-scm`](https://setuptools-scm.readthedocs.io). * Replace Black with the Ruff formatter. * Update Ruff configuration to take into account option changes. * Rewrite GitHub Actions workflows to use PDM. * Switch the release workflow to getting the PyPI token using GItHub Actions OIDC, instead of passing it in as a repository secret. * Publish the source dist and wheels to the GitHub release. * Include non-functional changes resulting from the changed pre-commit hooks.
- Loading branch information
Showing
35 changed files
with
1,179 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,14 +6,68 @@ on: | |
- published | ||
|
||
jobs: | ||
release: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Clone full tree, and checkout tag | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Python and PDM | ||
uses: pdm-project/setup-pdm@v4 | ||
with: | ||
python-version: "3.12" | ||
version: "2.15.1" | ||
- name: Build source dist and wheels | ||
run: pdm build --verbose | ||
- name: Upload source dist and wheels to artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: dist | ||
path: dist/ | ||
retention-days: 5 | ||
if-no-files-found: error | ||
|
||
publish-pypi: | ||
needs: build | ||
runs-on: ubuntu-22.04 | ||
environment: pypi | ||
permissions: | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build and publish to PyPI | ||
uses: JRubics/[email protected] | ||
with: | ||
python_version: "3.11" | ||
poetry_version: "==1.8.1" | ||
ignore_dev_requirements: "yes" | ||
pypi_token: ${{ secrets.PYPI_TOKEN }} | ||
- name: Clone full tree, and checkout tag | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Download source dist and wheels from artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: dist | ||
- name: Setup Python and PDM | ||
uses: pdm-project/setup-pdm@v4 | ||
with: | ||
python-version: "3.12" | ||
version: "2.15.1" | ||
- name: Publish source dist and wheels to PyPI | ||
run: pdm publish --no-build --verbose | ||
|
||
publish-github-release: | ||
needs: build | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Clone and checkout tag | ||
uses: actions/checkout@v4 | ||
- name: Download source dist and wheels from artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: dist | ||
- name: Publish source dist and wheels to GitHub Release | ||
uses: xresloader/upload-to-github-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
file: dist/* | ||
release_id: ${{ github.event.release.id }} | ||
overwrite: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: test | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Clone and checkout branch | ||
uses: actions/checkout@v4 | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
cache: "pip" | ||
- name: Run pre-commit hooks | ||
uses: pre-commit/[email protected] | ||
|
||
build: | ||
needs: pre-commit | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Clone full tree, and checkout branch | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Python and PDM | ||
uses: pdm-project/setup-pdm@v4 | ||
with: | ||
python-version: "3.12" | ||
version: "2.15.1" | ||
- name: Build source dist and wheels | ||
run: pdm build --verbose | ||
- name: Upload source dist and wheels to artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: dist | ||
path: dist/ | ||
retention-days: 5 | ||
if-no-files-found: error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,6 +109,7 @@ venv/ | |
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
.pdm-python | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,6 @@ | |
Sonarr plugin API functions. | ||
""" | ||
|
||
|
||
from __future__ import annotations | ||
|
||
import re | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,6 @@ | |
Sonarr plugin CLI commands. | ||
""" | ||
|
||
|
||
from __future__ import annotations | ||
|
||
import functools | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,6 @@ | |
Sonarr plugin import list settings configuration. | ||
""" | ||
|
||
|
||
from __future__ import annotations | ||
|
||
import re | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,6 @@ | |
Sonarr plugin release profile configuration. | ||
""" | ||
|
||
|
||
from __future__ import annotations | ||
|
||
import json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.