From a738e1650eb27aa7285b599398ac90d7f158a9dc Mon Sep 17 00:00:00 2001 From: Heinz-Alexander Fuetterer Date: Wed, 10 Jul 2024 11:32:29 +0200 Subject: [PATCH 01/23] ci: overhaul ci and cd workflows --- .github/workflows/cd.yml | 49 ++++++++++++++++++++++++++ .github/workflows/{CI.yaml => ci.yaml} | 10 ++++++ .github/workflows/deploy.yml | 42 ---------------------- .github/workflows/gh-release.yml | 19 ---------- 4 files changed, 59 insertions(+), 61 deletions(-) create mode 100644 .github/workflows/cd.yml rename .github/workflows/{CI.yaml => ci.yaml} (86%) delete mode 100644 .github/workflows/deploy.yml delete mode 100644 .github/workflows/gh-release.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 00000000..4b0b958e --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,49 @@ +# This CD workflow is adapted from: +# scientific-python/cookie (2024-06-28), BSD-3-Clause license +# Refs: +# - https://github.com/scientific-python/cookie/blob/23926fe2b88af44377f20afb3b11d63afb7fe315/.github/workflows/cd.yml +# - https://learn.scientific-python.org/development/guides/gha-pure/ + +name: CD + +on: + push: + tags: + - v*.*.* + +jobs: + dist: + # Build the Python SDist and wheel, performs metadata and readme linting + # Ref: https://github.com/hynek/build-and-inspect-python-package + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: hynek/build-and-inspect-python-package@v2 + + release: + # Publish a GitHub release from the given git tag + # Ref: https://github.com/softprops/action-gh-release + needs: [dist] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: softprops/action-gh-release@v2 + with: + generate_release_notes: true + + publish: + # Publish the built SDist and wheel from "dist" job on PyPI + # Ref: https://github.com/pypa/gh-action-pypi-publish + needs: [dist] + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4 + with: + name: Packages + path: dist + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_TOKEN }} diff --git a/.github/workflows/CI.yaml b/.github/workflows/ci.yaml similarity index 86% rename from .github/workflows/CI.yaml rename to .github/workflows/ci.yaml index 1bb2b5c6..9dc906b3 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/ci.yaml @@ -77,3 +77,13 @@ jobs: - name: Upload code coverage report if: matrix.os == 'ubuntu-latest' uses: codecov/codecov-action@v4 + + baipp: + # Build the Python SDist and wheel, performs metadata and readme linting + # Ref: https://github.com/hynek/build-and-inspect-python-package + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: hynek/build-and-inspect-python-package@v2 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 2d96eae6..00000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Deploy Package - -on: - push: - tags: - - v*.*.* - -jobs: - build-n-publish: - name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Fetch all history for all tags and branches (necessary for setuptools_scm) - - - name: Set up Python 3.9 - uses: actions/setup-python@v5 - with: - python-version: 3.9 - - - name: Install pypa/build - run: >- - python -m - pip install - build - --user - - name: Build a binary wheel and a source tarball - run: >- - python -m - build - --sdist - --wheel - --outdir dist/ - . - - - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PYPI_TOKEN }} diff --git a/.github/workflows/gh-release.yml b/.github/workflows/gh-release.yml deleted file mode 100644 index d062006c..00000000 --- a/.github/workflows/gh-release.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Release on GitHub - -on: - push: - tags: - - v*.*.* -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Fetch all history for all tags and branches (necessary for setuptools_scm) - - - name: Release - uses: softprops/action-gh-release@v2 - with: - generate_release_notes: true From 8f75acd902a73f9bd2cf5e9dec7c18ec0c83d7e6 Mon Sep 17 00:00:00 2001 From: lkstrp Date: Wed, 10 Jul 2024 15:23:44 +0200 Subject: [PATCH 02/23] ci: follow up adjustments --- .github/workflows/{cd.yml => release.yml} | 22 ++++++------- .github/workflows/{ci.yaml => test.yaml} | 39 ++++++++++++----------- 2 files changed, 29 insertions(+), 32 deletions(-) rename .github/workflows/{cd.yml => release.yml} (59%) rename .github/workflows/{ci.yaml => test.yaml} (77%) diff --git a/.github/workflows/cd.yml b/.github/workflows/release.yml similarity index 59% rename from .github/workflows/cd.yml rename to .github/workflows/release.yml index 4b0b958e..12493396 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/release.yml @@ -1,10 +1,4 @@ -# This CD workflow is adapted from: -# scientific-python/cookie (2024-06-28), BSD-3-Clause license -# Refs: -# - https://github.com/scientific-python/cookie/blob/23926fe2b88af44377f20afb3b11d63afb7fe315/.github/workflows/cd.yml -# - https://learn.scientific-python.org/development/guides/gha-pure/ - -name: CD +name: Release on: push: @@ -14,7 +8,7 @@ on: jobs: dist: # Build the Python SDist and wheel, performs metadata and readme linting - # Ref: https://github.com/hynek/build-and-inspect-python-package + name: Build distribution runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -24,7 +18,7 @@ jobs: release: # Publish a GitHub release from the given git tag - # Ref: https://github.com/softprops/action-gh-release + name: Create GitHub Release needs: [dist] runs-on: ubuntu-latest steps: @@ -35,15 +29,17 @@ jobs: publish: # Publish the built SDist and wheel from "dist" job on PyPI - # Ref: https://github.com/pypa/gh-action-pypi-publish + name: Publish to PyPI needs: [dist] runs-on: ubuntu-latest + environment: + name: Release + url: https://pypi.org/project/linopy/ + permissions: + id-token: write steps: - uses: actions/download-artifact@v4 with: name: Packages path: dist - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PYPI_TOKEN }} diff --git a/.github/workflows/ci.yaml b/.github/workflows/test.yaml similarity index 77% rename from .github/workflows/ci.yaml rename to .github/workflows/test.yaml index 9dc906b3..ee70391c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/test.yaml @@ -10,26 +10,37 @@ on: jobs: build: + name: Build and verify package + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: hynek/build-and-inspect-python-package@v2 + id: baipp + outputs: + python-versions: ${{ steps.baipp.outputs.supported_python_classifiers_json_array }} + + test: + name: Test package + needs: [build] runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - python-version: - - 3.9 - - "3.10" - - "3.11" - - "3.12" + python-version: ${{ fromJson(needs.build-package.outputs.python-versions) }} os: - ubuntu-latest - macos-latest - windows-latest + steps: - uses: actions/checkout@v4 with: - fetch-depth: 0 # Fetch all history for all tags and branches (necessary for setuptools_scm) + fetch-depth: 0 # Needed for setuptools_scm - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -56,9 +67,9 @@ jobs: run: | choco install glpk - - name: Install dependencies for python ${{ matrix.python-version }} + - name: Install package and dependencies run: | - pip install -e .[dev,solvers] + pip install ${{ fromJson(steps.baipp.outputs.dist_file_paths_json_array)[0] }}[dev,solvers] - name: Lint with flake8 run: | @@ -77,13 +88,3 @@ jobs: - name: Upload code coverage report if: matrix.os == 'ubuntu-latest' uses: codecov/codecov-action@v4 - - baipp: - # Build the Python SDist and wheel, performs metadata and readme linting - # Ref: https://github.com/hynek/build-and-inspect-python-package - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: hynek/build-and-inspect-python-package@v2 From fd7db2890400f3653162f83f08140078066ba1b8 Mon Sep 17 00:00:00 2001 From: lkstrp Date: Wed, 10 Jul 2024 15:31:00 +0200 Subject: [PATCH 03/23] fix: fix version retrieve --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ee70391c..e41ab7c9 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -29,7 +29,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ${{ fromJson(needs.build-package.outputs.python-versions) }} + python-version: ${{ fromJson(needs.build.outputs.python-versions) }} os: - ubuntu-latest - macos-latest From 646cd8f99e64cfca60f5029be210e1e7ba83f84e Mon Sep 17 00:00:00 2001 From: lkstrp Date: Wed, 10 Jul 2024 15:38:13 +0200 Subject: [PATCH 04/23] fix: rename `.yaml` to `.yml` --- .github/workflows/{test.yaml => test.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{test.yaml => test.yml} (100%) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yml similarity index 100% rename from .github/workflows/test.yaml rename to .github/workflows/test.yml From 2d7782e5273d5930e6e680f1b39900e1c09f6bb6 Mon Sep 17 00:00:00 2001 From: Heinz-Alexander Fuetterer Date: Wed, 10 Jul 2024 16:14:43 +0200 Subject: [PATCH 05/23] ci: remove unneeded "fetch-depth: 0" --- .github/workflows/release.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 12493396..1a7d6d1c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,8 +12,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - with: - fetch-depth: 0 - uses: hynek/build-and-inspect-python-package@v2 release: From 5ec2df7b1cbe0b7129d485049d9f04e320ef54b1 Mon Sep 17 00:00:00 2001 From: Heinz-Alexander Fuetterer Date: Wed, 10 Jul 2024 16:17:15 +0200 Subject: [PATCH 06/23] ci: add concurrency settings --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e41ab7c9..fe7dcfa6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,6 +8,10 @@ on: schedule: - cron: "0 5 * * TUE" +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: build: name: Build and verify package From f98e67fb6a9153fa8bed58b55e5e0c9e5ffb94c9 Mon Sep 17 00:00:00 2001 From: lkstrp Date: Wed, 10 Jul 2024 16:30:10 +0200 Subject: [PATCH 07/23] fix: name --- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1a7d6d1c..b8bb6e7d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,7 +26,7 @@ jobs: generate_release_notes: true publish: - # Publish the built SDist and wheel from "dist" job on PyPI + # Publish the built SDist and wheel from "dist" job to PyPI name: Publish to PyPI needs: [dist] runs-on: ubuntu-latest diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fe7dcfa6..4f55ce54 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: CI +name: Test on: push: From dd258c202343fc2c22869353f6521ae1a5adb876 Mon Sep 17 00:00:00 2001 From: Heinz-Alexander Fuetterer Date: Wed, 10 Jul 2024 16:44:57 +0200 Subject: [PATCH 08/23] ci: try to fix failing test job --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4f55ce54..a0532dfd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,12 +28,12 @@ jobs: test: name: Test package - needs: [build] + needs: build runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - python-version: ${{ fromJson(needs.build.outputs.python-versions) }} + python-version: ${{ fromJSON(needs.build.outputs.python-versions) }} os: - ubuntu-latest - macos-latest @@ -73,7 +73,7 @@ jobs: - name: Install package and dependencies run: | - pip install ${{ fromJson(steps.baipp.outputs.dist_file_paths_json_array)[0] }}[dev,solvers] + pip install ${{ fromJSON(steps.baipp.outputs.dist_file_paths_json_array)[0] }}[dev,solvers] - name: Lint with flake8 run: | From 5af5b5a06f8defbdcce1c4fd6e40be2e12dbfafd Mon Sep 17 00:00:00 2001 From: lkstrp Date: Wed, 10 Jul 2024 16:46:32 +0200 Subject: [PATCH 09/23] chore: add trove classifiers with version --- .github/workflows/test.yml | 2 +- pyproject.toml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a0532dfd..6eb7b8b2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,7 +28,7 @@ jobs: test: name: Test package - needs: build + needs: [build] runs-on: ${{ matrix.os }} strategy: fail-fast: false diff --git a/pyproject.toml b/pyproject.toml index c1ba20ca..225cf621 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,6 +10,10 @@ readme = "README.md" authors = [{ name = "Fabian Hofmann", email = "fabianmarikhofmann@gmail.com" }] license = { file = "LICENSE" } classifiers = [ + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Science/Research", From 83d4442a5e1e7b11679d956ffac57035337992f0 Mon Sep 17 00:00:00 2001 From: lkstrp Date: Wed, 10 Jul 2024 16:54:44 +0200 Subject: [PATCH 10/23] fix: add package download --- .github/workflows/release.yml | 8 ++++---- .github/workflows/test.yml | 7 +++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b8bb6e7d..341aa4e9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,9 +6,9 @@ on: - v*.*.* jobs: - dist: + build: # Build the Python SDist and wheel, performs metadata and readme linting - name: Build distribution + name: Build and verify package runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -17,7 +17,7 @@ jobs: release: # Publish a GitHub release from the given git tag name: Create GitHub Release - needs: [dist] + needs: [build] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -28,7 +28,7 @@ jobs: publish: # Publish the built SDist and wheel from "dist" job to PyPI name: Publish to PyPI - needs: [dist] + needs: [build] runs-on: ubuntu-latest environment: name: Release diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6eb7b8b2..5656237d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,6 +13,7 @@ concurrency: cancel-in-progress: true jobs: + # Build the Python SDist and wheel, performs metadata and readme linting build: name: Build and verify package runs-on: ubuntu-latest @@ -71,6 +72,12 @@ jobs: run: | choco install glpk + - name: Download package + uses: actions/download-artifact@v4 + with: + name: Packages + path: dist + - name: Install package and dependencies run: | pip install ${{ fromJSON(steps.baipp.outputs.dist_file_paths_json_array)[0] }}[dev,solvers] From dabf924f7a8131c2f9f8458ad508871c49ad9343 Mon Sep 17 00:00:00 2001 From: Heinz-Alexander Fuetterer Date: Wed, 10 Jul 2024 17:24:03 +0200 Subject: [PATCH 11/23] ci: try to fix failing test job --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5656237d..19b1558a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -80,7 +80,8 @@ jobs: - name: Install package and dependencies run: | - pip install ${{ fromJSON(steps.baipp.outputs.dist_file_paths_json_array)[0] }}[dev,solvers] + ls -R + python -m pip install dist/*.whl[dev,solvers] - name: Lint with flake8 run: | From ac7a2b70726963e86cba1c48761ed9297989ed35 Mon Sep 17 00:00:00 2001 From: Heinz-Alexander Fuetterer Date: Wed, 10 Jul 2024 17:26:09 +0200 Subject: [PATCH 12/23] ci: test --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 19b1558a..5d214585 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -81,6 +81,7 @@ jobs: - name: Install package and dependencies run: | ls -R + ls dist python -m pip install dist/*.whl[dev,solvers] - name: Lint with flake8 From 15a451e2d9cc97454e1f941df09521afc6fc2899 Mon Sep 17 00:00:00 2001 From: Heinz-Alexander Fuetterer Date: Wed, 10 Jul 2024 17:28:22 +0200 Subject: [PATCH 13/23] ci: test --- .github/workflows/test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5d214585..7a051f0e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 0 + fetch-depth: 0 # Needed for setuptools_scm - uses: hynek/build-and-inspect-python-package@v2 id: baipp @@ -80,7 +80,6 @@ jobs: - name: Install package and dependencies run: | - ls -R ls dist python -m pip install dist/*.whl[dev,solvers] From 12c39f33e8d76dbee3534cf7d46d8d1bfde98ecf Mon Sep 17 00:00:00 2001 From: Heinz-Alexander Fuetterer Date: Wed, 10 Jul 2024 17:30:52 +0200 Subject: [PATCH 14/23] ci: test --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7a051f0e..dcd202b9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -81,7 +81,7 @@ jobs: - name: Install package and dependencies run: | ls dist - python -m pip install dist/*.whl[dev,solvers] + python -m pip install -v "dist/*.whl[dev,solvers]" - name: Lint with flake8 run: | From 9c05849d1d636f2b62d2f5a6dea3060f60a42a92 Mon Sep 17 00:00:00 2001 From: Heinz-Alexander Fuetterer Date: Wed, 10 Jul 2024 17:44:27 +0200 Subject: [PATCH 15/23] ci: test --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dcd202b9..649f9f48 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -81,7 +81,7 @@ jobs: - name: Install package and dependencies run: | ls dist - python -m pip install -v "dist/*.whl[dev,solvers]" + python -m pip install -v $(ls dist/*.whl)[dev,solvers] - name: Lint with flake8 run: | From e2726492c5cd9d908f8b398e28708662ee97b6ea Mon Sep 17 00:00:00 2001 From: Heinz-Alexander Fuetterer Date: Wed, 10 Jul 2024 20:57:28 +0200 Subject: [PATCH 16/23] ci: test --- .github/workflows/test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 649f9f48..81e584b7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -81,7 +81,9 @@ jobs: - name: Install package and dependencies run: | ls dist - python -m pip install -v $(ls dist/*.whl)[dev,solvers] + filename=$(ls dist/*.whl) + echo $filename + python -m pip install -v "$filename" - name: Lint with flake8 run: | From 314d8237b2b825f41e4075d33e7458a69c69fd49 Mon Sep 17 00:00:00 2001 From: Heinz-Alexander Fuetterer Date: Wed, 10 Jul 2024 21:04:02 +0200 Subject: [PATCH 17/23] ci: test --- .github/workflows/test.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 81e584b7..290a2cdb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,6 +26,7 @@ jobs: outputs: python-versions: ${{ steps.baipp.outputs.supported_python_classifiers_json_array }} + wheel-path: $(ls dist/*.whl) test: name: Test package @@ -81,9 +82,7 @@ jobs: - name: Install package and dependencies run: | ls dist - filename=$(ls dist/*.whl) - echo $filename - python -m pip install -v "$filename" + echo ${{ needs.build.outputs.wheel-path }} - name: Lint with flake8 run: | From 1aef138d9b54f077b9368747fa64026bea465186 Mon Sep 17 00:00:00 2001 From: Heinz-Alexander Fuetterer Date: Wed, 10 Jul 2024 21:07:04 +0200 Subject: [PATCH 18/23] ci: test --- .github/workflows/test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 290a2cdb..b5eeeffd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -83,6 +83,9 @@ jobs: run: | ls dist echo ${{ needs.build.outputs.wheel-path }} + echo ${{ needs.build.outputs.wheel-path }}[dev] + echo "${{ needs.build.outputs.wheel-path }}[dev]" + python -m pip install "${{ needs.build.outputs.wheel-path }}[dev]" - name: Lint with flake8 run: | From 40aa6c6b4a0476bb25feee7aeab01a64ff30d507 Mon Sep 17 00:00:00 2001 From: Heinz-Alexander Fuetterer Date: Wed, 10 Jul 2024 21:10:18 +0200 Subject: [PATCH 19/23] ci: test --- .github/workflows/test.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b5eeeffd..101d1656 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,7 +26,7 @@ jobs: outputs: python-versions: ${{ steps.baipp.outputs.supported_python_classifiers_json_array }} - wheel-path: $(ls dist/*.whl) + wheel-path: $(ls dist/*.whl) # this is used to "pip install" the wheel in the test job test: name: Test package @@ -81,11 +81,7 @@ jobs: - name: Install package and dependencies run: | - ls dist - echo ${{ needs.build.outputs.wheel-path }} - echo ${{ needs.build.outputs.wheel-path }}[dev] - echo "${{ needs.build.outputs.wheel-path }}[dev]" - python -m pip install "${{ needs.build.outputs.wheel-path }}[dev]" + python -m pip install "${{ needs.build.outputs.wheel-path }}[dev,solvers]" - name: Lint with flake8 run: | From 2acc148b8fa2df5244de6477d1c3c68b0f52e8ed Mon Sep 17 00:00:00 2001 From: Heinz-Alexander Fuetterer Date: Wed, 10 Jul 2024 21:13:00 +0200 Subject: [PATCH 20/23] ci: test --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 101d1656..f83339e6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -81,7 +81,7 @@ jobs: - name: Install package and dependencies run: | - python -m pip install "${{ needs.build.outputs.wheel-path }}[dev,solvers]" + python -m pip install "$(ls dist/*.whl)[dev,solvers]" - name: Lint with flake8 run: | From b11913a687e09f863d0d82000ff6d3b255951b9c Mon Sep 17 00:00:00 2001 From: Heinz-Alexander Fuetterer Date: Wed, 10 Jul 2024 21:15:27 +0200 Subject: [PATCH 21/23] ci: finally --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f83339e6..a71a8cff 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,7 +26,6 @@ jobs: outputs: python-versions: ${{ steps.baipp.outputs.supported_python_classifiers_json_array }} - wheel-path: $(ls dist/*.whl) # this is used to "pip install" the wheel in the test job test: name: Test package From 8e30ad0e2c86bc4e8c03a855f39348b57dd5573e Mon Sep 17 00:00:00 2001 From: lkstrp Date: Thu, 11 Jul 2024 09:27:54 +0200 Subject: [PATCH 22/23] ci: add comment --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a71a8cff..422cf61c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,8 +13,8 @@ concurrency: cancel-in-progress: true jobs: - # Build the Python SDist and wheel, performs metadata and readme linting build: + # Build the Python SDist and wheel, performs metadata and readme linting name: Build and verify package runs-on: ubuntu-latest steps: @@ -28,6 +28,7 @@ jobs: python-versions: ${{ steps.baipp.outputs.supported_python_classifiers_json_array }} test: + # Test package build in matrix of OS and Python versions name: Test package needs: [build] runs-on: ${{ matrix.os }} From c6564a861a04ff6b4a7d82aa83394479392724f0 Mon Sep 17 00:00:00 2001 From: lkstrp Date: Thu, 11 Jul 2024 09:39:22 +0200 Subject: [PATCH 23/23] ci: update readme --- .github/workflows/test.yml | 2 +- README.md | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 422cf61c..05090caa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Test +name: Tests on: push: diff --git a/README.md b/README.md index c36d767c..5f5cb00e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ # linopy: Optimization with array-like variables and constraints -[![PyPI](https://img.shields.io/pypi/v/linopy)](https://pypi.org/project/linopy/) [![CI](https://github.com/FabianHofmann/linopy/actions/workflows/CI.yaml/badge.svg)](https://github.com/FabianHofmann/linopy/actions/workflows/CI.yaml) [![License](https://img.shields.io/pypi/l/linopy.svg)](LICENSE.txt) [![doc](https://readthedocs.org/projects/linopy/badge/?version=latest)](https://linopy.readthedocs.io/en/latest/) [![codecov](https://codecov.io/gh/PyPSA/linopy/branch/master/graph/badge.svg?token=TT4EYFCCZX)](https://codecov.io/gh/PyPSA/linopy) +[![PyPI](https://img.shields.io/pypi/v/linopy)](https://pypi.org/project/linopy/) +[![License](https://img.shields.io/pypi/l/linopy.svg)](LICENSE.txt) +[![Tests](https://github.com/PyPSA/linopy/actions/workflows/test.yml/badge.svg)](https://github.com/PyPSA/linopy/actions/workflows/test.yml) +[![doc](https://readthedocs.org/projects/linopy/badge/?version=latest)](https://linopy.readthedocs.io/en/latest/) +[![codecov](https://codecov.io/gh/PyPSA/linopy/branch/master/graph/badge.svg?token=TT4EYFCCZX)](https://codecov.io/gh/PyPSA/linopy) **linopy** is an open-source python package that facilitates **optimization** with **real world data**. It builds a bridge between data analysis packages like [xarray](https://github.com/pydata/xarray) & [pandas](https://pandas.pydata.org/) and problem solvers like [cbc](https://projects.coin-or.org/Cbc), [gurobi](https://www.gurobi.com/) (see the full list below). **Linopy** supports **Linear, Integer, Mixed-Integer and Quadratic Programming** while aiming to make linear programming in Python easy, highly-flexible and performant.