Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
4 changes: 3 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
[flake8]
max-line-length = 88
ignore = E501, E203, W503, E265
per-file-ignores = __init__.py:F401
per-file-ignores =
__init__.py:F401
pycombo/pyCombo.py:E704
exclude =
.git
__pycache__
Expand Down
107 changes: 51 additions & 56 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,85 +6,80 @@ on:
branches: [ master ]

jobs:

test_and_build:
# The type of runner that the job will run on

test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
poetry-version: ['1.8.3']
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
os: [ubuntu-latest, macos-latest]
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up Poetry ${{ matrix.poetry-version }}
uses: abatilo/actions-poetry@v2
uses: actions/setup-python@v5
with:
poetry-version: ${{ matrix.poetry-version }}
python-version: ${{ matrix.python-version }}

- name: Set up cache
uses: actions/cache@v1
id: cache
- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}

- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
enable-cache: true

- name: Install dependencies
run: |
poetry install
run: uv sync

- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
poetry run flake8 . --count --max-line-length=127 --show-source --statistics
run: uv run flake8 . --count --max-line-length=127 --show-source --statistics

- name: Run tests
run: |
poetry run pytest
run: uv run pytest

build-wheels:
needs: test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

- name: Build
run: poetry build -f wheel
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Archive production artifacts
- name: Build wheels
uses: pypa/cibuildwheel@v2.23.2

- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ matrix.python-version }}
path: |
dist

name: wheels-${{ matrix.os }}
path: wheelhouse/*.whl

gather_n_publish:
runs-on: ubuntu-latest
needs: test_and_build
needs: build-wheels

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Python 3.12
uses: actions/setup-python@v4
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'

- name: Set up Poetry 1.8.3
uses: abatilo/actions-poetry@v2
- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
poetry-version: '1.8.3'
enable-cache: true

- uses: actions/download-artifact@v4
with:
Expand All @@ -93,19 +88,19 @@ jobs:
path: dist/

- name: Install dependencies
run: |
poetry install
run: uv sync

- name: Build sdist
run: poetry build -f sdist
run: uv build --sdist

- name: Display structure of downloaded files
run: ls -R
working-directory: ./


- run: poetry config repositories.testpypi https://test.pypi.org/legacy/
- run: poetry config pypi-token.testpypi ${{ secrets.TEST_PYPI_TOKEN }}
run: ls -la dist/

- name: Publish package
run: poetry publish --no-interaction --dry-run -r testpypi -vvv
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
password: ${{ secrets.TEST_PYPI_TOKEN }}
packages-dir: dist/
skip-existing: true
verbose: true
110 changes: 49 additions & 61 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,115 +7,103 @@ on:
types: [released]

jobs:
test_and_build:
# The type of runner that the job will run on
test:
if: "!github.event.release.prerelease"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
poetry-version: ['1.8.3']
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
os: [ubuntu-latest, macos-latest]
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up Poetry ${{ matrix.poetry-version }}
uses: abatilo/actions-poetry@v2
uses: actions/setup-python@v5
with:
poetry-version: ${{ matrix.poetry-version }}
python-version: ${{ matrix.python-version }}

- name: Set up cache
uses: actions/cache@v1
id: cache
- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}

- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
enable-cache: true

- name: Install dependencies
run: poetry install
run: uv sync

- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
poetry run flake8 . --count --max-line-length=127 --show-source --statistics
run: uv run flake8 . --count --max-line-length=127 --show-source --statistics

- name: Run tests
run: |
poetry run pytest
run: uv run pytest

- name: Build
run: poetry build -f wheel
build-wheels:
if: "!github.event.release.prerelease"
needs: test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

- name: Archive production artifacts
uses: actions/upload-artifact@v4
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
name: wheels-${{ matrix.os }}-${{ matrix.python-version }}
path: |
dist
submodules: recursive

- name: Build wheels
uses: pypa/cibuildwheel@v2.23.2

- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: wheelhouse/*.whl

gather_n_publish:
runs-on: ubuntu-latest
needs: test_and_build
needs: build-wheels

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Python 3.12
uses: actions/setup-python@v4
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'

- name: Set up Poetry 1.8.3
uses: abatilo/actions-poetry@v2
- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
poetry-version: '1.8.3'

- name: Set up cache
uses: actions/cache@v1
id: cache
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}

- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
enable-cache: true

- uses: actions/download-artifact@v4
with:
pattern: wheels-*
merge-multiple: true
path: dist/


- name: Install dependencies
run: |
poetry install
run: uv sync

- name: Build sdist
run: poetry build -f sdist
run: uv build --sdist

- name: Display structure of downloaded files
run: ls -la
working-directory: dist/

- run: poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}

- name: Publish package
run: poetry publish --no-interaction -vvv
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
packages-dir: dist/
skip-existing: true
verbose: true
Loading
Loading