From 57abafedeecae1e45989b485e4929d15d90cbcb2 Mon Sep 17 00:00:00 2001 From: Sven Baars Date: Thu, 27 Feb 2025 11:54:59 +0100 Subject: [PATCH 1/3] CI: Sync the CI script with TransiFlow. --- .github/workflows/ci.yml | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2cd8592..6a921dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Python application +name: Run tests on: push: @@ -10,39 +10,25 @@ jobs: build: strategy: matrix: - include: - - os: 'ubuntu-latest' - dependencies: '' - - os: 'macos-latest' - dependencies: '' -# - os: 'macos-latest' -# dependencies: 'nlesc/nlesc/trilinos' + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: [3.8, 3.x] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.9 - uses: actions/setup-python@v2 + - uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: ${{ matrix.python-version }} + cache: 'pip' - name: Install python dependencies run: | python -m pip install --upgrade pip pip install flake8 pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - - name: Install Linux dependencies - run: | - sudo apt-get install ${{ matrix.dependencies }} - if: ${{ matrix.os != 'macos-latest' && matrix.dependencies != '' }} - - - name: Install macOS dependencies - run: | - brew tap nlesc/nlesc - brew install ${{ matrix.dependencies }} - if: ${{ matrix.os == 'macos-latest' && matrix.dependencies != '' }} + pip install -r requirements.txt - name: Lint with flake8 run: | @@ -50,4 +36,4 @@ jobs: - name: Test with pytest run: | - pytest tests + pytest -v -o console_output_style=classic tests From ecc01b793b5e781ffaed51fe7240c25acd6cd6fd Mon Sep 17 00:00:00 2001 From: Sven Baars Date: Thu, 27 Feb 2025 11:56:23 +0100 Subject: [PATCH 2/3] CI: Add continuous deployment workflow for PyPI publication. --- .github/workflows/cd.yml | 57 ++++++++++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 1 + 2 files changed, 58 insertions(+) create mode 100644 .github/workflows/cd.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..7d8c059 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,57 @@ +name: Publish to PyPI + +on: + release: + types: [published] + +jobs: + run-tests: + name: Run tests to avoid a broken release + uses: BIMAU/jadapy/.github/workflows/ci.yml@master + + build: + name: Build packages + runs-on: ubuntu-latest + needs: + - run-tests + + steps: + - name: Set up Python 3.x + uses: actions/setup-python@v4 + with: + python-version: '>=3.8,<4' + + - name: Check out the source code + uses: actions/checkout@v3 + + - name: Build a source package and a wheel + run: python -m build . + + - name: Upload packages as artifact + uses: actions/upload-artifact@v4 + with: + name: packages-for-pypi + path: dist/ + + publish: + name: Publish to PyPI + runs-on: ubuntu-latest + needs: + - build + + environment: + name: pypi + url: https://pypi.org/p/jadapy + + permissions: + id-token: write + + steps: + - name: Download artifact with packages + uses: actions/download-artifact@v4 + with: + name: packages-for-pypi + path: dist/ + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a921dc..6d1abbb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,7 @@ on: branches: [ master ] pull_request: branches: [ master ] + workflow_call: jobs: build: From 9761cf7bcc54a943de28f3398ea5e29bcd0eac05 Mon Sep 17 00:00:00 2001 From: Sven Baars Date: Thu, 27 Feb 2025 11:58:54 +0100 Subject: [PATCH 3/3] Release v1.0.0. --- setup.cfg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index 19c8b64..a6ab8f2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = jadapy -version = 0.0.0 +version = 1.0.0 url = https://github.com/BIMAU/jadapy license = Apache License 2.0 author = Sven Baars @@ -9,7 +9,7 @@ description = Implementations of JDQR and JDQZ with optional integration with Tr long_description = file: README.md long_description_content_type = text/markdown classifiers = - Development Status :: 3 - Alpha + Development Status :: 5 - Production/Stable Environment :: Console Intended Audience :: Developers Intended Audience :: Science/Research @@ -40,4 +40,4 @@ norecursedirs = lib ignore = E226,E261,E302,E731,C901,W503 max-line-length = 127 max-complexity = 10 -exclude = lib \ No newline at end of file +exclude = lib