Skip to content

Commit af7adea

Browse files
authored
Add publish.yml to simplify publishing (#161)
* Add publish.yml to simplify publishing Also add support for Python 3.14
1 parent 28c5687 commit af7adea

File tree

4 files changed

+70
-7
lines changed

4 files changed

+70
-7
lines changed

.github/workflows/checks.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
- "3.11"
1515
- "3.12"
1616
- "3.13"
17+
- "3.14"
1718
django-version:
1819
- ">=4.2,<4.3"
1920
- ">=5.0,<5.3"

.github/workflows/publish.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Publish to PyPI
2+
on:
3+
release:
4+
types: [published]
5+
workflow_dispatch:
6+
permissions:
7+
contents: read
8+
id-token: write # For Trusted Publishing
9+
jobs:
10+
build-and-publish:
11+
name: Build and publish package
12+
runs-on: ubuntu-latest
13+
environment:
14+
name: PyPI
15+
url: https://pypi.org/project/django-import-export-extensions/
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
- name: Set up Python
20+
uses: actions/setup-python@v6
21+
with:
22+
python-version: '3.14'
23+
- name: Install Poetry
24+
uses: snok/install-poetry@v1
25+
with:
26+
version: latest
27+
virtualenvs-create: true
28+
virtualenvs-in-project: true
29+
installer-parallel: true
30+
- name: Cache virtualenv
31+
id: cache-venv
32+
uses: actions/cache@v4
33+
with:
34+
path: .venv
35+
key: ${{ runner.os }}-publish-${{ hashFiles('**/poetry.lock') }}
36+
- name: Install only main dependencies
37+
if: steps.cache-venv.outputs.cache-hit != 'true'
38+
run: |
39+
poetry install --only main --no-interaction --no-root
40+
- name: Ensure tag matches pyproject version
41+
id: version-check
42+
run: |
43+
TAG="${GITHUB_REF_NAME}"
44+
VERSION=$(poetry version -s)
45+
echo "Tag: $TAG | pyproject: $VERSION"
46+
if [ "$TAG" != "$VERSION" ]; then
47+
echo "::error::Git tag ($TAG) does not match pyproject version ($VERSION)" >&2
48+
exit 1
49+
fi
50+
echo "package_version=$VERSION" >> "$GITHUB_OUTPUT"
51+
- name: Build artifacts (dist)
52+
run: |
53+
poetry build
54+
- name: Publish to PyPI (Trusted Publisher)
55+
uses: pypa/gh-action-pypi-publish@release/v1
56+
with:
57+
print-hash: true

HISTORY.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
History
33
=======
44

5+
1.9.1 (2025-10-28)
6+
7+
* Support Python 3.14
8+
59
1.9.0 (2025-09-16)
610
------------------
711

pyproject.toml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "django-import-export-extensions"
3-
version = "1.9.0"
3+
version = "1.9.1"
44
description = "Extend functionality of `django-import-export`"
55
license = "MIT"
66
authors = ["Saritasa <[email protected]>"]
@@ -39,6 +39,7 @@ classifiers = [
3939
"Programming Language :: Python :: 3.11",
4040
"Programming Language :: Python :: 3.12",
4141
"Programming Language :: Python :: 3.13",
42+
"Programming Language :: Python :: 3.14",
4243
"Programming Language :: Python :: 3 :: Only",
4344
]
4445
packages = [{ include = "import_export_extensions" }]
@@ -413,12 +414,12 @@ python_files = [
413414
"*_tests.py",
414415
]
415416
addopts = [
416-
"--ff",
417-
"--capture=no",
418-
"--verbose",
419-
"--cov-config=pyproject.toml",
420-
"--cov-report=lcov:coverage.lcov",
421-
"--cov-report=term-missing:skip-covered",
417+
"--ff",
418+
"--capture=no",
419+
"--verbose",
420+
"--cov-config=pyproject.toml",
421+
"--cov-report=lcov:coverage.lcov",
422+
"--cov-report=term-missing:skip-covered",
422423
]
423424

424425
[tool.coverage.run]

0 commit comments

Comments
 (0)