Skip to content

Fix release pipeline #183

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

Merged
merged 39 commits into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
7c87c41
initial cibuildwheel setup
cerrussell Jan 5, 2023
0f46e04
Update pyproject.toml
cerrussell Jan 5, 2023
f08104f
Updated test-command
cerrussell Jan 5, 2023
51051f7
Corrected duplicate code
cerrussell Jan 5, 2023
0a1c4b8
Moved import checks
cerrussell Jan 5, 2023
e8617c6
Removed check commands, limited gen for testing
cerrussell Jan 5, 2023
013dc1a
Specified pytest
cerrussell Jan 5, 2023
cf18945
Update pyproject.toml
cerrussell Jan 5, 2023
1dbbcff
Update pyproject.toml
cerrussell Jan 5, 2023
a2ed7a8
Update pyproject.toml
cerrussell Jan 5, 2023
16ba803
Update pyproject.toml
cerrussell Jan 5, 2023
5446f31
Update pyproject.toml
cerrussell Jan 5, 2023
dc26054
Update pypi.yml
cerrussell Jan 5, 2023
462db14
Update pypi.yml
cerrussell Jan 5, 2023
2113722
Disabling tests for the moment...
cerrussell Jan 6, 2023
af4b026
Update pypi.yml
cerrussell Jan 6, 2023
aa2fa8c
Updated bdist check commands
cerrussell Jan 6, 2023
c7a2988
Corrected misspelling that caused erroneous build warning.
cerrussell Jan 6, 2023
0fd4f67
Trying to resolve check errors...
cerrussell Jan 6, 2023
adca87a
Corrected wheel path
cerrussell Jan 6, 2023
afb5f24
Troubleshooting check bdist command.
cerrussell Jan 6, 2023
e62475e
Update pyproject.toml
cerrussell Jan 6, 2023
624b13b
Fixed typo.
cerrussell Jan 6, 2023
0a3481e
Troubleshooting check bdist
cerrussell Jan 6, 2023
75c50be
Troubleshooting check bdist
cerrussell Jan 6, 2023
9210c9d
Remove 32-bit windows builds
cerrussell Jan 6, 2023
3675356
Enable most builds
cerrussell Jan 6, 2023
37320a7
Revert to automatic runs
cerrussell Jan 6, 2023
b7d0541
Disabled cp37 build, specified arches to build instead of to skip.
cerrussell Jan 7, 2023
1157273
Build only musllinux for testing
cerrussell Jan 7, 2023
7788241
Build everything but PyPy, skip testing of cp37, 32-bit, musllinux
cerrussell Jan 7, 2023
9be2a97
Merge branch 'pymc-devs:main' into issue-173
cerrussell Jan 7, 2023
94c5de7
Apply 2-space indentation
michaelosthege Jan 8, 2023
b13dd8d
Re-enable upload job
michaelosthege Jan 8, 2023
bbcd30c
Skip builds for 32-bit OS
michaelosthege Jan 8, 2023
b1584f9
Merge branch 'pymc-devs:main' into issue-173
cerrussell Jan 9, 2023
39d10f7
Updated upload_pypi action
cerrussell Jan 9, 2023
ab16021
Merge branch 'pymc-devs:main' into issue-173
cerrussell Jan 9, 2023
e04bae1
Corrected upload_pypi needs
cerrussell Jan 9, 2023
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
89 changes: 52 additions & 37 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,53 @@ concurrency:
cancel-in-progress: true

jobs:
# The job to build pypi wheels users can installed precompiled for them.
# At the moment only linux wheels are build, Windows and MacOS will compile on installation
# Before prebuilds all users had to compile code anyway.
build:
# The job to build precompiled pypi wheels.
make_sdist:
name: Make SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true

- name: Build SDist
run: pipx run build --sdist

- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz

build_wheels:
name: Build ${{ matrix.python-version }} wheels on ${{ matrix.platform }}
runs-on: ${{ matrix.platform }}
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
name: Build source distribution
runs-on: ubuntu-latest
platform:
- macos-12
- windows-2022
- ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4

- name: Build wheels
uses: pypa/[email protected]

- uses: actions/upload-artifact@v3
with:
python-version: ${{ matrix.python-version }}
- name: Build the sdist and the wheel
run: |
pip install build
python -m build
- name: Check the sdist installs and imports
path: ./wheelhouse/*.whl

check_dist:
name: Check dist
needs: [make_sdist,build_wheels]
runs-on: ubuntu-22.04
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: Check SDist
run: |
mkdir -p test-sdist
cd test-sdist
Expand All @@ -47,32 +73,21 @@ jobs:
venv-sdist/bin/python -c "import pytensor;print(pytensor.__version__)"
# check import cython module
venv-sdist/bin/python -c 'from pytensor.scan import scan_perform; print(scan_perform.get_version())'
- name: Check the bdist installs and imports
run: |
mkdir -p test-bdist
cd test-bdist
python -m venv venv-bdist
venv-bdist/bin/python -m pip install ../dist/pytensor-*.whl
# check import
venv-bdist/bin/python -c "import pytensor;print(pytensor.__version__)"
# check import cython module
venv-bdist/bin/python -c 'from pytensor.scan import scan_perform; print(scan_perform.get_version())'
- uses: actions/upload-artifact@v3
with:
name: artifact
path: dist/*

- run: pipx run twine check --strict dist/*

upload_pypi:
name: Upload to PyPI on release
needs: [build]
needs: [check_dist]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.pypi_secret }}
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.pypi_password }}
17 changes: 16 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ authors = [
]
description = "Optimizing compiler for evaluating mathematical expressions on CPUs and GPUs."
readme = "README.rst"
license = {file = "LICENCE.txt"}
license = {file = "LICENSE.txt"}
classifiers = [
"Development Status :: 6 - Mature",
"Intended Audience :: Education",
Expand Down Expand Up @@ -206,3 +206,18 @@ show_error_codes = true
allow_redefinition = false
files = ["pytensor", "tests"]
plugins = ["numpy.typing.mypy_plugin"]

[tool.cibuildwheel]
build = "*"
# Uncomment to skip builds that compile but fail when trying to test (maybe due to incompatibility with runner)
# archs = ["auto64"]
# Disable any-platform (pp*), and 32-bit builds.
# Additional options to consider: "*musllinux*"
skip = ["pp*", "*-win32", "*-manylinux_i686"]
build-frontend = "build"
test-command = 'python -c "import pytensor; print(pytensor.__version__); from pytensor.scan import scan_perform; print(scan_perform.get_version())"'
test-skip = ["cp37*", "*musllinux*", "*win32*", "*i686*"]

# Testing seems to be running into issues locating libs where expected
# test-requires = ["pytest", "numba", "jax", "jaxlib"]
# test-command = "pytest {package}/tests"