-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix artifact creation, modernise tooling (#51)
* Attempt to fix artifact creation * Even more unique * Try to test built wheels * Try again * Try again * Pass location of tox.ini * Minimise test requirements * Different way of getting test requirements * Fix typo * Switch to uv * Explicitly install uv too * Don't install pip * Consolidate configuration into pyproject.toml * Don't need an issue template * Consolidate AUTHORS and README * Ignore uv.lock * Remove editorconfig and flake8, which wasn't being run * Simplify post-wheel-build tes * Sane tracebacks * Cleaner Makefile * Try to include C code * Maybe fix? * Loosen check for MacOS * Verbose mode * Cleaner for `upload_pypi` to depend on the `pass` job * Try to work around issue * cleaner * CONTRIBUTING.rst is too stale * Add test extra to dev dependencies * Don't use tox * Add to history * `make test` will also sync * Shouldn't need this extra now * We don't format with black * Restore version info to _mt2 module * Switch to unittest * Clean up gitignore * unittest * See if we can get away without the setuppython step * Keep $PATH between steps * Typo * Try again * Try to fix windows build * Try again * Don't need an author here * Add pyversions shield
- Loading branch information
Showing
20 changed files
with
378 additions
and
689 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,11 +1,17 @@ | ||
name: Build | ||
|
||
on: [push, pull_request] | ||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
tags: ["*"] | ||
|
||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
@@ -15,22 +21,26 @@ jobs: | |
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
|
||
- name: Install uv | ||
run: curl -LsSf https://astral.sh/uv/install.sh | sh | ||
|
||
- name: Install & activate | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -U -r requirements_dev.txt | ||
pip install tox tox-gh-actions | ||
- name: Test with tox numpy>=2 | ||
run: tox -e latestnpy | ||
- name: Test with tox numpy<2 | ||
run: tox -e oldestnpy | ||
uv sync --python ${{ matrix.python-version }} | ||
. .venv/bin/activate | ||
echo PATH=$PATH >> $GITHUB_ENV | ||
- name: Test | ||
run: python -m unittest discover tests | ||
|
||
- name: Test with oldest-supported-numpy | ||
run: | | ||
uv pip install oldest-supported-numpy | ||
python -m unittest discover tests | ||
build_wheels: | ||
name: Build wheel for ${{ matrix.os }}-cp${{ matrix.python }}-${{ matrix.arch }} | ||
name: Build wheel for ${{ matrix.os }}-${{ matrix.build }}${{ matrix.python }}-${{ matrix.arch }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
# Ensure that a wheel builder finishes even if another fails | ||
|
@@ -51,18 +61,20 @@ jobs: | |
- name: Checkout mt2 | ||
uses: actions/checkout@v4 | ||
|
||
# Used to host cibuildwheel | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
# Needed within cibuildwheel | ||
- name: Install uv | ||
run: curl -LsSf https://astral.sh/uv/install.sh | sh | ||
|
||
- uses: pypa/[email protected] | ||
env: | ||
CIBW_BUILD_FRONTEND: "build[uv]" | ||
CIBW_BUILD: "${{ matrix.build }}${{ matrix.python }}*" | ||
CIBW_ARCHS: ${{ matrix.arch }} | ||
CIBW_TEST_COMMAND: python -m unittest discover -t {project} -s {project}/tests | ||
|
||
- uses: actions/upload-artifact@v4 | ||
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') | ||
with: | ||
name: "artifact-${{ matrix.os }}-${{ matrix.build }}-${{ matrix.python }}-${{ matrix.arch }}" | ||
path: ./wheelhouse/*.whl | ||
|
||
build_sdist: | ||
|
@@ -71,20 +83,20 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
name: Install Python | ||
with: | ||
python-version: "3.12" | ||
- name: Install uv | ||
run: curl -LsSf https://astral.sh/uv/install.sh | sh | ||
|
||
- name: Install numpy and setuptools | ||
run: python -m pip install numpy setuptools | ||
- name: Install environment & setuptools | ||
run: | | ||
uv sync | ||
uv pip install setuptools | ||
- name: Build sdist | ||
run: python setup.py sdist | ||
run: uv run python setup.py sdist | ||
|
||
- uses: actions/upload-artifact@v4 | ||
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') | ||
with: | ||
name: artifact-source | ||
path: dist/*.tar.gz | ||
|
||
pass: | ||
|
@@ -94,7 +106,7 @@ jobs: | |
- run: echo "All jobs passed" | ||
|
||
upload_pypi: | ||
needs: [build_wheels, build_sdist, test] | ||
needs: [pass] | ||
runs-on: ubuntu-latest | ||
# upload to PyPI on every tag starting with 'v' | ||
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') | ||
|
@@ -103,8 +115,8 @@ jobs: | |
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: artifact | ||
path: dist | ||
merge-multiple: true | ||
|
||
- uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
|
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 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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.