Skip to content

Commit

Permalink
Merge pull request #223 from romgar/upgrade_setuptools_only
Browse files Browse the repository at this point in the history
Upgrade setuptools, improve build testing
  • Loading branch information
LincolnPuzey authored May 29, 2024
2 parents 200e90b + 2064be6 commit 205e5ae
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 25 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -33,4 +33,4 @@ jobs:
# queries: ./path/to/local/query, your-org/your-repo/queries@main

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
8 changes: 4 additions & 4 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8

Expand All @@ -39,10 +39,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8

Expand Down
43 changes: 30 additions & 13 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Publish to PyPI"
name: "Build and Publish"

on:
push:
Expand All @@ -11,32 +11,49 @@ on:
- cron: '30 22 15 * *'

jobs:
build-and-publish:
name: Build and publish Python distributions to PyPI
build:
name: Build Python distributions
runs-on: ubuntu-latest
strategy:
# Matrix to exercise the build backend on all versions of python supported
matrix:
python: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python 3.9
uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: ${{ matrix.python }}

- name: Install pypa/build
run: |
pip install build
python --version
pip list
- name: Build a binary wheel and a source tarball
run: python -m build

- uses: actions/upload-artifact@v4
with:
name: distributions-built-with-py${{ matrix.python }}
path: dist/

publish:
name: "Publish to PyPI"
# Only upload for an actual tag
if: ${{ startsWith(github.ref, 'refs/tags') }}
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/download-artifact@v4
with:
# Download distributions from one job of the matrix
name: "distributions-built-with-py-3.12"
path: "dist"

- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}

- uses: actions/upload-artifact@v3
with:
name: pypi-packages
path: dist/
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

Expand Down
3 changes: 1 addition & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
include LICENSE
include README.rst
include ChangeLog.rst
graft tests
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools ~= 63.4"]
requires = ["setuptools ~= 70.0"]
build-backend = "setuptools.build_meta"

[tool.pytest.ini_options]
Expand Down

0 comments on commit 205e5ae

Please sign in to comment.