Skip to content

Commit

Permalink
Add Github action to verify packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
Delgan committed Dec 3, 2024
1 parent 6161a13 commit cb3314a
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
22 changes: 22 additions & 0 deletions .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Packaging

on: [push, pull_request]

jobs:
packaging:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: Build package
run: |
tox -e packaging
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ dev = [
# Docs.
"Sphinx==8.1.3 ; python_version>='3.11'",
"sphinx-rtd-theme==3.0.2 ; python_version>='3.11'",
# Packaging.
"build==1.2.2 ; python_version>='3.11'",
"twine==6.0.1 ; python_version>='3.11'",
]

[project.urls]
Expand Down
8 changes: 7 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = lint, tests, docs
envlist = lint, tests, docs, packaging
isolated_build = True

[testenv]
Expand All @@ -23,3 +23,9 @@ commands =
description = Build the HTML documentation.
commands =
sphinx-build -a -b html -W --keep-going docs/ docs/build

[testenv:packaging]
description = Build the Python package.
commands =
pyproject-build .
twine check --strict dist/*

0 comments on commit cb3314a

Please sign in to comment.