Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasr8 committed Mar 24, 2024
1 parent 4bfb993 commit 4a36053
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 41 deletions.
36 changes: 17 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python package
name: Lint & Test

on:
push:
branches: [ "master" ]
branches: ["master"]
pull_request:
branches: [ "master" ]
branches: ["master"]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11"]
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install -e .[dev]
- name: Run linters
run: |
pre-commit run --all-files
- name: Test with pytest
run: |
pytest
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: python -m pip install -e .[dev]
- name: Run ruff
run: ruff check --verbose
- name: Run linters
run: pre-commit run --all-files
- name: Test with pytest
run: pytest
35 changes: 16 additions & 19 deletions .github/workflows/pypi_upload.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Based on flake8-bugbear
name: pypi_upload
name: Upload to PyPI

on:
release:
Expand All @@ -9,26 +9,23 @@ jobs:
upload:
name: PyPI Upload
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11

- name: Install latest pip, twine & build
run: |
python -m pip install --upgrade pip twine build
- name: Install latest pip, twine & build
run: python -m pip install --upgrade pip twine build

- name: Build Python package
run: |
python -m build
twine check dist/*
- name: Build Python package
run: |
python -m build
twine check dist/*
- name: Upload to PyPI
env:
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
twine upload --verbose -u '__token__' dist/*
- name: Upload to PyPI
env:
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: twine upload --verbose -u '__token__' dist/*
4 changes: 1 addition & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ repos:
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format
args: [--fix, --verbose]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ line_length = 120
lines_after_imports = 2

[tool.ruff.lint]
select = ["ALL"]
ignore = [
"D",
"ANN002",
Expand Down

0 comments on commit 4a36053

Please sign in to comment.