Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix artifact creation, modernise tooling #51

Merged
merged 47 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
64c0672
Attempt to fix artifact creation
tpgillam Aug 6, 2024
28e7702
Even more unique
tpgillam Aug 6, 2024
94ad1a4
Merge branch 'master' into tg/fix_artifact
tpgillam Aug 6, 2024
3b82440
Try to test built wheels
tpgillam Aug 6, 2024
46cbe21
Try again
tpgillam Aug 6, 2024
d2e2c35
Try again
tpgillam Aug 6, 2024
458e20f
Pass location of tox.ini
tpgillam Aug 6, 2024
ead2963
Minimise test requirements
tpgillam Aug 6, 2024
bb72bed
Different way of getting test requirements
tpgillam Aug 6, 2024
4903d7c
Fix typo
tpgillam Aug 6, 2024
b508cd8
Switch to uv
tpgillam Aug 6, 2024
39774f8
Explicitly install uv too
tpgillam Aug 6, 2024
0e08656
Don't install pip
tpgillam Aug 6, 2024
6d28ec9
Consolidate configuration into pyproject.toml
tpgillam Aug 6, 2024
ac59ee6
Don't need an issue template
tpgillam Aug 6, 2024
d6290fc
Consolidate AUTHORS and README
tpgillam Aug 6, 2024
d5952b3
Ignore uv.lock
tpgillam Aug 6, 2024
74c95f5
Remove editorconfig and flake8, which wasn't being run
tpgillam Aug 6, 2024
c75666d
Simplify post-wheel-build tes
tpgillam Aug 6, 2024
4594151
Sane tracebacks
tpgillam Aug 6, 2024
f6d804e
Cleaner Makefile
tpgillam Aug 6, 2024
7edf147
Try to include C code
tpgillam Aug 6, 2024
9196ce4
Maybe fix?
tpgillam Aug 6, 2024
675269d
Loosen check for MacOS
tpgillam Aug 6, 2024
9521d73
Verbose mode
tpgillam Aug 6, 2024
69b3ec7
Cleaner for `upload_pypi` to depend on the `pass` job
tpgillam Aug 6, 2024
e9bf05b
Try to work around issue
tpgillam Aug 6, 2024
722b789
cleaner
tpgillam Aug 8, 2024
9116a42
CONTRIBUTING.rst is too stale
tpgillam Aug 8, 2024
882231e
Add test extra to dev dependencies
tpgillam Aug 8, 2024
1b217f3
Don't use tox
tpgillam Aug 8, 2024
0780eec
Add to history
tpgillam Aug 8, 2024
05d6789
`make test` will also sync
tpgillam Aug 8, 2024
e00ca55
Shouldn't need this extra now
tpgillam Aug 8, 2024
ad83b18
We don't format with black
tpgillam Aug 8, 2024
829cee6
Restore version info to _mt2 module
tpgillam Aug 8, 2024
7b81940
Switch to unittest
tpgillam Aug 8, 2024
2330e7a
Clean up gitignore
tpgillam Aug 8, 2024
539bdc4
unittest
tpgillam Aug 8, 2024
22badaa
See if we can get away without the setuppython step
tpgillam Aug 8, 2024
3b95967
Keep $PATH between steps
tpgillam Aug 8, 2024
f8b3af8
Typo
tpgillam Aug 8, 2024
9a5a872
Try again
tpgillam Aug 8, 2024
56b6d7a
Try to fix windows build
tpgillam Aug 8, 2024
1ccad0c
Try again
tpgillam Aug 8, 2024
37ff0d3
Don't need an author here
tpgillam Aug 8, 2024
d4586fe
Add pyversions shield
tpgillam Aug 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions .editorconfig

This file was deleted.

15 changes: 0 additions & 15 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

68 changes: 40 additions & 28 deletions .github/workflows/ci.yml
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: ["*"]
tpgillam marked this conversation as resolved.
Show resolved Hide resolved


concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true


jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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')
tpgillam marked this conversation as resolved.
Show resolved Hide resolved
with:
name: artifact-source
path: dist/*.tar.gz

pass:
Expand All @@ -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')
Expand All @@ -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:
Expand Down
51 changes: 2 additions & 49 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,55 +28,8 @@ wheels/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# dotenv
.env

# virtualenv
.venv
venv/
ENV/

# Rope project settings
.ropeproject

# mypy
.mypy_cache/

# IDE settings
.idea/
.vscode/
# package manager lock file
uv.lock
7 changes: 0 additions & 7 deletions AUTHORS.rst

This file was deleted.

127 changes: 0 additions & 127 deletions CONTRIBUTING.rst

This file was deleted.

1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ History
------------------

* Move support to Python 3.9-3.12. Support numpy 2. Thanks to @lgray
* Various build system & package modernisation.

1.2.0 (2021-05-05)
------------------
Expand Down
11 changes: 0 additions & 11 deletions MANIFEST.in

This file was deleted.

Loading