From 3e133d9bfa911b5a578688e2e91e6d2f30ef71df Mon Sep 17 00:00:00 2001 From: tommyod Date: Sun, 1 Sep 2024 22:19:00 +0200 Subject: [PATCH 01/12] simplify GH actions --- .github/workflows/build.yml | 89 ------------------------------ .github/workflows/build_docs.yml | 28 ---------- .github/workflows/test_base.yml | 33 ----------- .github/workflows/test_develop.yml | 13 ----- .github/workflows/test_master.yml | 13 ----- 5 files changed, 176 deletions(-) delete mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/build_docs.yml delete mode 100644 .github/workflows/test_base.yml delete mode 100644 .github/workflows/test_develop.yml delete mode 100644 .github/workflows/test_master.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index ee7d4de..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,89 +0,0 @@ -name: Build wheels - -on: - workflow_dispatch: - -jobs: - build_wheels: - name: Build wheels on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false # Allow one of the matrix builds to fail without failing others - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: 3.11 - - - name: Install cibuildwheel - run: | - pip install --upgrade pip - pip install cibuildwheel==2.15.0 - - - name: Build wheels - env: - CIBW_BUILD: 'cp38-* cp39-* cp310-* cp311-* cp312-*' - CIBW_ARCHS_MACOS: x86_64 arm64 - CIBW_SKIP: pp* *-musllinux_* *-manylinux_i686 # skip PyPy, musllinux, 32-bit Linux - run: | - pip install cibuildwheel --upgrade; - python -m cibuildwheel --output-dir dist; - - - name: Store artifacts - uses: actions/upload-artifact@v3 - with: - name: python-package-distributions - path: dist/*.whl - - package_source: - name: Package source distribution - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: 3.11 - - - name: Install build - run: python -m pip install build - - - name: Run sdist - run: python -m build --sdist - - - name: Store artifacts - uses: actions/upload-artifact@v3 - with: - name: python-package-distributions - path: ./dist/*.tar.gz - - publish_to_pypi: - needs: - - build_wheels - - package_source - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/master' # Only publish from the master branch - - steps: - - name: Download build files - uses: actions/download-artifact@v3 - with: - name: python-package-distributions - path: dist/ - - # https://github.com/pypa/gh-action-pypi-publish - - name: Publish Python distribution to PyPI - uses: pypa/gh-action-pypi-publish@e53eb8b103ffcb59469888563dc324e3c8ba6f06 - with: - skip-existing: true - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml deleted file mode 100644 index e8f7b14..0000000 --- a/.github/workflows/build_docs.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Build docs - -on: - workflow_dispatch: - -jobs: - build_docs: - name: Build docs - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup python - uses: actions/setup-python@v4 - with: - python-version: 3.11 - - - name: Install packages - run: | - pip install pip --upgrade - pip install --no-cache-dir -e .[dev] - - - name: Build docs - run: | - sudo apt install pandoc -y - sphinx-build docs/source _build/html -W diff --git a/.github/workflows/test_base.yml b/.github/workflows/test_base.yml deleted file mode 100644 index e015ad8..0000000 --- a/.github/workflows/test_base.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Build & test - -on: - workflow_call: - -jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false # Allow one of the matrix builds to fail without failing others - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Install - run: | - pip install pip --upgrade - pip install -e .[dev,test,lint] - - - name: Run tests and linting - run: | - python -m black KDEpy -l 120 --check - python -m flake8 --show-source --ignore=F811,W293,W391,W292,W291,W504,W503,E231 --max-line-length=120 --exclude="*examples.py,testing.py,*kde.py" KDEpy - pytest KDEpy --doctest-modules --capture=sys diff --git a/.github/workflows/test_develop.yml b/.github/workflows/test_develop.yml deleted file mode 100644 index 45d1212..0000000 --- a/.github/workflows/test_develop.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Build & test (develop) - -on: - push: - branches: - - develop - pull_request: - branches: - - develop - -jobs: - test: - uses: tommyod/KDEpy/.github/workflows/test_base.yml@develop diff --git a/.github/workflows/test_master.yml b/.github/workflows/test_master.yml deleted file mode 100644 index 71485a8..0000000 --- a/.github/workflows/test_master.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Build & test (master) - -on: - push: - branches: - - master - pull_request: - branches: - - master - -jobs: - test: - uses: tommyod/KDEpy/.github/workflows/test_base.yml@master From 3913bc9509c48cbcdba94b37b0d6558134d74ddd Mon Sep 17 00:00:00 2001 From: tommyod Date: Sun, 1 Sep 2024 22:20:23 +0200 Subject: [PATCH 02/12] add new --- .github/workflows/build.yaml | 82 ++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..f55b7a9 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,82 @@ +name: CI/CD + +on: + push: + branches: [master, develop] + pull_request: + branches: [master, develop] + workflow_dispatch: + +jobs: + test_and_build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + pip install --upgrade pip + pip install -e .[dev,test,lint] + pip install cibuildwheel==2.15.0 + + - name: Run tests and linting + run: | + black KDEpy -l 120 --check + flake8 --show-source --ignore=F811,W293,W391,W292,W291,W504,W503,E231 --max-line-length=120 --exclude="*examples.py,testing.py,*kde.py" KDEpy + pytest KDEpy --doctest-modules --capture=sys + + - name: Build wheels + env: + CIBW_BUILD: cp${{ matrix.python-version//.}}* + CIBW_ARCHS_MACOS: x86_64 arm64 + CIBW_SKIP: pp* *-musllinux_* *-manylinux_i686 + run: | + python -m cibuildwheel --output-dir dist + + - name: Store artifacts + uses: actions/upload-artifact@v3 + with: + name: python-package-distributions + path: dist/*.whl + + build_docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + - name: Install dependencies + run: | + pip install --upgrade pip + pip install -e .[dev] + sudo apt install pandoc -y + - name: Build docs + run: sphinx-build docs/source _build/html -W + + publish: + needs: [test_and_build, build_docs] + runs-on: ubuntu-latest + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + steps: + - uses: actions/download-artifact@v3 + with: + name: python-package-distributions + path: dist/ + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@e53eb8b103ffcb59469888563dc324e3c8ba6f06 + with: + skip-existing: true + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} From cb4758b98bc2441882a5fa7e3dfb1507837c7949 Mon Sep 17 00:00:00 2001 From: tommyod Date: Sun, 1 Sep 2024 22:21:34 +0200 Subject: [PATCH 03/12] t --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f55b7a9..00282df 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,4 +1,4 @@ -name: CI/CD +name: CI/CD flow on: push: From 18f712e1640d5458b5605e435a82329e2eb028bd Mon Sep 17 00:00:00 2001 From: tommyod Date: Sun, 1 Sep 2024 22:22:05 +0200 Subject: [PATCH 04/12] .yml --- .github/workflows/{build.yaml => build.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{build.yaml => build.yml} (100%) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yml similarity index 100% rename from .github/workflows/build.yaml rename to .github/workflows/build.yml From 89bbe9a3ff4be1b31304f6cc9a8a4560220fca55 Mon Sep 17 00:00:00 2001 From: tommyod Date: Sun, 1 Sep 2024 22:26:17 +0200 Subject: [PATCH 05/12] mre --- .github/workflows/build.yaml | 112 +++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..a922d78 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,112 @@ +name: CI/CD + +on: + push: + branches: [master, develop] + pull_request: + branches: [master, develop] + workflow_dispatch: + +jobs: + test_and_build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Cache pip packages + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: Install dependencies + run: | + pip install --upgrade pip + pip install -e .[dev,test,lint] + pip install cibuildwheel==2.15.0 + + - name: Run tests and linting + run: | + black KDEpy -l 120 --check + flake8 --show-source --ignore=F811,W293,W391,W292,W291,W504,W503,E231 --max-line-length=120 --exclude="*examples.py,testing.py,*kde.py" KDEpy + pytest KDEpy --doctest-modules --capture=sys + + - name: Build wheels + env: + CIBW_BUILD: cp${{ matrix.python-version == '3.10' && '310' || matrix.python-version == '3.11' && '311' || matrix.python-version == '3.12' && '312' || matrix.python-version }}* + CIBW_ARCHS_MACOS: x86_64 arm64 + CIBW_SKIP: pp* *-musllinux_* *-manylinux_i686 + run: | + python -m cibuildwheel --output-dir wheelhouse + + - name: Build source distribution + if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' + run: | + pip install build + python -m build --sdist --outdir dist + + - name: Store artifacts + uses: actions/upload-artifact@v3 + with: + name: python-package-distributions + path: | + wheelhouse/*.whl + dist/*.tar.gz + + build_docs: + runs-on: ubuntu-latest + if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop') + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + - name: Cache pip packages + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-docs-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip-docs- + - name: Install dependencies + run: | + pip install --upgrade pip + pip install -e .[dev] + sudo apt install pandoc -y + - name: Build docs + run: sphinx-build docs/source _build/html -W + - name: Store documentation + uses: actions/upload-artifact@v3 + with: + name: documentation + path: _build/html + + publish: + needs: [test_and_build, build_docs] + runs-on: ubuntu-latest + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + steps: + - uses: actions/download-artifact@v3 + with: + name: python-package-distributions + path: dist/ + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@e53eb8b103ffcb59469888563dc324e3c8ba6f06 + with: + skip-existing: true + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} From ae72c7ad2671b3ed9381861d055ba58c6c5dbb0f Mon Sep 17 00:00:00 2001 From: tommyod Date: Sun, 1 Sep 2024 22:27:34 +0200 Subject: [PATCH 06/12] files --- .github/workflows/build.yaml | 112 ----------------------------------- .github/workflows/build.yml | 38 ++++++++++-- 2 files changed, 34 insertions(+), 116 deletions(-) delete mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml deleted file mode 100644 index a922d78..0000000 --- a/.github/workflows/build.yaml +++ /dev/null @@ -1,112 +0,0 @@ -name: CI/CD - -on: - push: - branches: [master, develop] - pull_request: - branches: [master, develop] - workflow_dispatch: - -jobs: - test_and_build: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Cache pip packages - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Install dependencies - run: | - pip install --upgrade pip - pip install -e .[dev,test,lint] - pip install cibuildwheel==2.15.0 - - - name: Run tests and linting - run: | - black KDEpy -l 120 --check - flake8 --show-source --ignore=F811,W293,W391,W292,W291,W504,W503,E231 --max-line-length=120 --exclude="*examples.py,testing.py,*kde.py" KDEpy - pytest KDEpy --doctest-modules --capture=sys - - - name: Build wheels - env: - CIBW_BUILD: cp${{ matrix.python-version == '3.10' && '310' || matrix.python-version == '3.11' && '311' || matrix.python-version == '3.12' && '312' || matrix.python-version }}* - CIBW_ARCHS_MACOS: x86_64 arm64 - CIBW_SKIP: pp* *-musllinux_* *-manylinux_i686 - run: | - python -m cibuildwheel --output-dir wheelhouse - - - name: Build source distribution - if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' - run: | - pip install build - python -m build --sdist --outdir dist - - - name: Store artifacts - uses: actions/upload-artifact@v3 - with: - name: python-package-distributions - path: | - wheelhouse/*.whl - dist/*.tar.gz - - build_docs: - runs-on: ubuntu-latest - if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop') - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.11' - - name: Cache pip packages - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-docs-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip-docs- - - name: Install dependencies - run: | - pip install --upgrade pip - pip install -e .[dev] - sudo apt install pandoc -y - - name: Build docs - run: sphinx-build docs/source _build/html -W - - name: Store documentation - uses: actions/upload-artifact@v3 - with: - name: documentation - path: _build/html - - publish: - needs: [test_and_build, build_docs] - runs-on: ubuntu-latest - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - steps: - - uses: actions/download-artifact@v3 - with: - name: python-package-distributions - path: dist/ - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@e53eb8b103ffcb59469888563dc324e3c8ba6f06 - with: - skip-existing: true - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 00282df..a922d78 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: CI/CD flow +name: CI/CD on: push: @@ -18,11 +18,20 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + - name: Cache pip packages + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Install dependencies run: | pip install --upgrade pip @@ -37,26 +46,42 @@ jobs: - name: Build wheels env: - CIBW_BUILD: cp${{ matrix.python-version//.}}* + CIBW_BUILD: cp${{ matrix.python-version == '3.10' && '310' || matrix.python-version == '3.11' && '311' || matrix.python-version == '3.12' && '312' || matrix.python-version }}* CIBW_ARCHS_MACOS: x86_64 arm64 CIBW_SKIP: pp* *-musllinux_* *-manylinux_i686 run: | - python -m cibuildwheel --output-dir dist + python -m cibuildwheel --output-dir wheelhouse + + - name: Build source distribution + if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' + run: | + pip install build + python -m build --sdist --outdir dist - name: Store artifacts uses: actions/upload-artifact@v3 with: name: python-package-distributions - path: dist/*.whl + path: | + wheelhouse/*.whl + dist/*.tar.gz build_docs: runs-on: ubuntu-latest + if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop') steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 with: python-version: '3.11' + - name: Cache pip packages + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-docs-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip-docs- - name: Install dependencies run: | pip install --upgrade pip @@ -64,6 +89,11 @@ jobs: sudo apt install pandoc -y - name: Build docs run: sphinx-build docs/source _build/html -W + - name: Store documentation + uses: actions/upload-artifact@v3 + with: + name: documentation + path: _build/html publish: needs: [test_and_build, build_docs] From 845903126d5a6af07d3955e40b74a989d3cea189 Mon Sep 17 00:00:00 2001 From: tommyod Date: Sun, 1 Sep 2024 22:29:05 +0200 Subject: [PATCH 07/12] hash toml --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a922d78..31d2c48 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }} restore-keys: | ${{ runner.os }}-pip- @@ -79,7 +79,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{ runner.os }}-pip-docs-${{ hashFiles('**/requirements.txt') }} + key: ${{ runner.os }}-pip-docs-${{ hashFiles('**/pyproject.toml') }} restore-keys: | ${{ runner.os }}-pip-docs- - name: Install dependencies From 1c5f970de9b2bbbf0cd0112e766c3379fcd8b997 Mon Sep 17 00:00:00 2001 From: tommyod Date: Sun, 1 Sep 2024 22:32:14 +0200 Subject: [PATCH 08/12] try to fix py38 and py39 --- .github/workflows/build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 31d2c48..7f15a07 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,14 +28,14 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }} + key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }} restore-keys: | ${{ runner.os }}-pip- - name: Install dependencies run: | pip install --upgrade pip - pip install -e .[dev,test,lint] + pip install .[dev,test,lint] pip install cibuildwheel==2.15.0 - name: Run tests and linting @@ -46,7 +46,7 @@ jobs: - name: Build wheels env: - CIBW_BUILD: cp${{ matrix.python-version == '3.10' && '310' || matrix.python-version == '3.11' && '311' || matrix.python-version == '3.12' && '312' || matrix.python-version }}* + CIBW_BUILD: cp${{ matrix.python-version == '3.8' && '38' || matrix.python-version == '3.9' && '39' || matrix.python-version == '3.10' && '310' || matrix.python-version == '3.11' && '311' || matrix.python-version == '3.12' && '312' }}* CIBW_ARCHS_MACOS: x86_64 arm64 CIBW_SKIP: pp* *-musllinux_* *-manylinux_i686 run: | @@ -79,13 +79,13 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{ runner.os }}-pip-docs-${{ hashFiles('**/pyproject.toml') }} + key: ${{ runner.os }}-pip-docs-${{ hashFiles('pyproject.toml') }} restore-keys: | ${{ runner.os }}-pip-docs- - name: Install dependencies run: | pip install --upgrade pip - pip install -e .[dev] + pip install .[dev] sudo apt install pandoc -y - name: Build docs run: sphinx-build docs/source _build/html -W From e5f036fb9e9c2b33d65b34de6f78508c19e2dc1b Mon Sep 17 00:00:00 2001 From: tommyod Date: Sun, 1 Sep 2024 22:34:22 +0200 Subject: [PATCH 09/12] use editable installs --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7f15a07..1481b8f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,7 +35,7 @@ jobs: - name: Install dependencies run: | pip install --upgrade pip - pip install .[dev,test,lint] + pip install -e .[dev,test,lint] pip install cibuildwheel==2.15.0 - name: Run tests and linting @@ -85,7 +85,7 @@ jobs: - name: Install dependencies run: | pip install --upgrade pip - pip install .[dev] + pip install -e .[dev] sudo apt install pandoc -y - name: Build docs run: sphinx-build docs/source _build/html -W From 2a69a4082b36014097fc87ff4c1d8176393922e9 Mon Sep 17 00:00:00 2001 From: tommyod Date: Tue, 29 Oct 2024 07:57:56 +0100 Subject: [PATCH 10/12] split multiple lines --- .github/workflows/build.yml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4c8732d..f5c7ecf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,12 +46,15 @@ jobs: - name: Build wheels env: - CIBW_BUILD: cp${{ matrix.python-version == '3.8' && '38' || - matrix.python-version == '3.9' && '39' || - matrix.python-version == '3.10' && '310' || - matrix.python-version == '3.11' && '311' || - matrix.python-version == '3.12' && '312' || - matrix.python-version == '3.32' && '313' }}* + CIBW_BUILD: >- + cp${{ + matrix.python-version == '3.8' && '38' || + matrix.python-version == '3.9' && '39' || + matrix.python-version == '3.10' && '310' || + matrix.python-version == '3.11' && '311' || + matrix.python-version == '3.12' && '312' || + matrix.python-version == '3.13' && '313' + }}* CIBW_ARCHS_MACOS: x86_64 arm64 CIBW_SKIP: pp* *-musllinux_* *-manylinux_i686 run: | @@ -73,9 +76,12 @@ jobs: build_docs: runs-on: ubuntu-latest - if: github.event_name == 'push' && - (github.ref == 'refs/heads/master' || + if: >- + ${{ + github.event_name == 'push' && + (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop') + }} steps: - uses: actions/checkout@v4 - name: Set up Python From 071884e2b99dc61570a81104c6f1e979a20d80c5 Mon Sep 17 00:00:00 2001 From: tommyod Date: Tue, 29 Oct 2024 08:06:16 +0100 Subject: [PATCH 11/12] change pypi push --- .github/workflows/build.yml | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f5c7ecf..2a13096 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,25 +18,19 @@ jobs: steps: - uses: actions/checkout@v4 - + - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - - name: Cache pip packages - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }} - restore-keys: | - ${{ runner.os }}-pip- + cache: 'pip' # Enable built-in pip caching - name: Install dependencies run: | pip install --upgrade pip pip install -e .[dev,test,lint] pip install cibuildwheel==2.21.3 + continue-on-error: false - name: Run tests and linting run: | @@ -118,8 +112,7 @@ jobs: name: python-package-distributions path: dist/ - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@e53eb8b103ffcb59469888563dc324e3c8ba6f06 + uses: pypa/gh-action-pypi-publish@v1 with: skip-existing: true - user: __token__ password: ${{ secrets.PYPI_API_TOKEN }} From 11568929b299a5f402829948ea186e1506e9a768 Mon Sep 17 00:00:00 2001 From: tommyod Date: Tue, 29 Oct 2024 08:06:50 +0100 Subject: [PATCH 12/12] remove references to develop branch --- .github/workflows/build.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2a13096..b64a170 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,9 +2,9 @@ name: CI/CD on: push: - branches: [master, develop] + branches: [master] pull_request: - branches: [master, develop] + branches: [master] workflow_dispatch: jobs: @@ -73,8 +73,7 @@ jobs: if: >- ${{ github.event_name == 'push' && - (github.ref == 'refs/heads/master' || - github.ref == 'refs/heads/develop') + github.ref == 'refs/heads/master' }} steps: - uses: actions/checkout@v4