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

Add more Python version support #88

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
74 changes: 50 additions & 24 deletions .github/workflows/pypi_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,16 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [ubuntu-latest, macos-latest]
# python-version: ["3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest]
python-version: ["3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
# # TODO: Add C++ compliers
# # Fetch CUDA toolkit using Jimver/cuda-toolkit
# - name: Fetch CUDA toolkit
# uses: Jimver/[email protected]
# id: cuda-toolkit
# with:
# cuda: "12.1.0"

# - name: Check nvcc version
# run: nvcc -V

- uses: actions/checkout@v4
with:
fetch-depth: 0

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

Expand All @@ -71,17 +56,28 @@ jobs:
run: |
make
make test
python -m build --sdist

python -m build --sdist --wheel
cd dist
# numpy-2.2.0-pp310-pypy310_pp73-macosx_14_0_x86_64.whl
for file in *.whl; do \
newname=$(echo "$file" | sed -E 's/-py3-none-any//'); \
mv "$file" "${newname%.whl}-${{ matrix.os }}-py${{ matrix.python-version }}.whl"; \
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then \
mv "${newname%.whl}-${{ matrix.os }}-py${{ matrix.python-version }}.whl" "${newname%.whl}-manylinux_x86_64.whl"; \
fi; \
done
cd ..
- name: List the files in dist directory
run: |
ls -l dist/
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
name: qc-pyci-${{ matrix.os }}-py${{ matrix.python-version }}-${{ github.ref_name }}
path: dist/

publish-to-pypi:
name: Publish Python distribution to PyPI
# only publish to PyPI on tag pushes
if: startsWith(github.ref, 'refs/tags/')
needs:
- build
Expand All @@ -96,8 +92,19 @@ jobs:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
pattern: qc-pyci*
path: dist/
merge-multiple: true
- name: List the files in dist directory
run: |
ls -l dist/
# - name: Uncompress the files in dist directory with for loop
# run: |
# for file in dist/*.zip; do unzip -d dist/ $file; done
# - name: List the files in dist directory after uncompressing
# run: |
# ls -l dist/

- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
env:
Expand All @@ -118,8 +125,18 @@ jobs:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
pattern: qc-pyci*
path: dist/
merge-multiple: true
- name: List the files in dist directory
run: |
ls -l dist/
# - name: Uncompress the files in dist directory with for loop
# run: |
# for file in dist/*.zip; do unzip -d dist/ $file; done
# - name: List the files in dist directory after uncompressing
# run: |
# ls -l dist/
- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
with:
Expand All @@ -144,7 +161,6 @@ jobs:

publish-to-testpypi:
name: Publish Python distribution to TestPyPI
# if: ${{ github.ref == "refs/heads/master" && github.repository_owner == "theochem" }}
needs:
- build
runs-on: ubuntu-latest
Expand All @@ -160,8 +176,18 @@ jobs:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
pattern: qc-pyci*
path: dist/
merge-multiple: true
- name: List the files in dist directory
run: |
ls -l dist/
# - name: Uncompress the files in dist directory with for loop
# run: |
# for file in dist/*.zip; do unzip -d dist/ $file; done
# - name: List the files in dist directory after uncompressing
# run: |
# ls -l dist/
- name: Publish distribution to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.13",
"Programming Language :: C++",
]
requires-python = ">=3.9"
Expand Down
Loading