update python to 311, 312 #308
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
name: Build | |
on: | |
workflow_dispatch: | |
pull_request: | |
release: | |
types: | |
- released | |
push: | |
env: | |
Python_Version: 3.9 | |
jobs: | |
build_sdist: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
name: Install Python | |
with: | |
python-version: ${{env.Python_Version}} | |
- name: Build sdist | |
run: | | |
pip install -r requirements.txt | |
python setup.py sdist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: artifact | |
path: dist/*.tar.gz | |
retention-days: 1 | |
codecov: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
name: Install Python | |
with: | |
python-version: ${{env.Python_Version}} | |
- name: Install PyQUBO | |
run: | | |
python -m pip install . | |
- name: Generate Codecov Report | |
run: | | |
pip install -r requirements.txt | |
python -m coverage run -m unittest discover . | |
- name: Upload Codecov Report | |
run: | | |
codecov | |
doctest: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
name: Install Python | |
with: | |
python-version: ${{env.Python_Version}} | |
- name: Install PyQUBO | |
run: | | |
python -m pip install . | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
pip install -r requirements_doctest.txt | |
sphinx-build -W -b html docs docs/_build/html | |
- name: Run Doctest | |
run: | | |
make doctest | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} ${{matrix.arch}} | |
runs-on: ${{ matrix.os }} | |
env: | |
CIBW_DEPENDENCY_VERSIONS: pinned | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
arch: [x86_64, AMD64, i686, arm64] | |
python: [38, 39, 310, 311, 312, 313] | |
exclude: | |
- os: ubuntu-latest | |
arch: AMD64 | |
- os: ubuntu-latest | |
arch: arm64 | |
- os: macos-latest | |
arch: AMD64 | |
- os: macos-latest | |
arch: i686 | |
# - os: macos-latest | |
# arch: arm64 | |
# python: 36 | |
# - os: macos-latest | |
# arch: arm64 | |
# python: 37 | |
- os: windows-latest | |
arch: x86_64 | |
- os: windows-latest | |
arch: i686 | |
- os: windows-latest | |
arch: arm64 | |
include: | |
- os: ubuntu-latest | |
CIBW_PLATFORM: linux | |
CIBW_BUILD: "cp3*-manylinux*" | |
CIBW_BEFORE_ALL: "" | |
CIBW_BEFORE_BUILD: "" | |
CIBW_REPAIR_WHEEL_COMMAND: "auditwheel repair -w {dest_dir} {wheel}" | |
- os: macos-latest | |
CIBW_PLATFORM: macos | |
CIBW_BUILD: "cp3*-macosx*" | |
CIBW_BEFORE_ALL: "" | |
CIBW_BEFORE_BUILD: "" | |
- os: windows-latest | |
CIBW_PLATFORM: windows | |
CIBW_BUILD: "cp3*-win_amd64*" | |
CIBW_BEFORE_ALL: "" | |
CIBW_BEFORE_BUILD: "pip install delvewheel" | |
CIBW_REPAIR_WHEEL_COMMAND: "delvewheel repair -w {dest_dir} {wheel}" | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
name: Install Python | |
with: | |
python-version: ${{env.Python_Version}} | |
- name: Build wheels on ${{ matrix.CIBW_PLATFORM }} ${{matrix.arch}} | |
uses: pypa/cibuildwheel@v2.21.3 | |
env: | |
CIBW_PLATFORM: ${{ matrix.CIBW_PLATFORM }} | |
CIBW_BUILD: cp${{matrix.python}}-* | |
CIBW_ENVIRONMENT: | |
CFLAGS="-flto -Ofast -pipe" | |
CXXFLAGS="-flto -Ofast -pipe" | |
CIBW_ARCHS: ${{matrix.arch}} | |
CIBW_SKIP: "*-musllinux_*" | |
CIBW_BEFORE_TEST: "pip install -r requirements.txt" | |
CIBW_TEST_COMMAND: "python -m coverage run -m unittest discover {package}" | |
CIBW_DEPENDENCY_VERSIONS: ${{ env.CIBW_DEPENDENCY_VERSIONS }} | |
CIBW_BEFORE_BUILD: ${{matrix.CIBW_BEFORE_BUILD}} | |
CIBW_BEFORE_ALL: ${{matrix.CIBW_BEFORE_ALL}} | |
CIBW_REPAIR_WHEEL_COMMAND: ${{matrix.CIBW_REPAIR_WHEEL_COMMAND}} | |
CIBW_BUILD_VERBOSITY: 3 | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: artifact | |
path: ./wheelhouse/*.whl | |
retention-days: 1 | |
upload_pypi: | |
needs: [build_wheels, build_sdist] | |
runs-on: ubuntu-latest | |
if: github.event_name == 'release' | |
steps: | |
- uses: actions/download-artifact@v2 | |
with: | |
name: artifact | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_PASSWORD }} | |
upload_test_pypi: | |
needs: [build_wheels, build_sdist] | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- uses: actions/download-artifact@v2 | |
with: | |
name: artifact | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_TEST_PASSWORD }} | |
repository_url: https://test.pypi.org/legacy/ | |
skip_existing: true | |
verbose: true |