Skip to content

Commit

Permalink
version up, switch to uv, more airac functions fix #116
Browse files Browse the repository at this point in the history
  • Loading branch information
xoolive committed Nov 18, 2024
1 parent 8540c21 commit 1056a5b
Show file tree
Hide file tree
Showing 8 changed files with 912 additions and 912 deletions.
6 changes: 6 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
$schema: "https://docs.renovatebot.com/renovate-schema.json",
lockFileMaintenance: {
enabled: true,
},
}
24 changes: 8 additions & 16 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,25 @@ on:
types: [published]
workflow_dispatch:

env:
POETRY_VERSION: "1.6.1"
PYTHON_VERSION: "3.10"

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
python-version: ${{ env.PYTHON_VERSION }}
enable-cache: true

- name: Install and configure Poetry
uses: snok/[email protected]
- name: Set up Python
uses: actions/setup-python@v5
with:
version: ${{ env.POETRY_VERSION }}
virtualenvs-create: true
virtualenvs-in-project: true

- name: Display Python version
run: poetry run python -c "import sys; print(sys.version)"
python-version: "3.12"

- name: Build packages
run: poetry build
run: |
uvx hatchling build
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
55 changes: 17 additions & 38 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,69 +5,48 @@ on:
pull_request_target:
workflow_dispatch:

env:
POETRY_VERSION: "1.6.1"

jobs:
deploy:
runs-on: ubuntu-latest # ${{ matrix.os }}
strategy:
matrix:
# os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
env:
PYTHON_VERSION: ${{ matrix.python-version }}
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true

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

# Update full Python version
- name: Full Python version
run: |
echo "PYTHON_VERSION=$(python -c "import platform; print(platform.python_version())")"
echo "PYTHON_VERSION=$(python -c "import platform; print(platform.python_version())")" >> $GITHUB_ENV
# virtualenv cache should depends on OS, Python version and `poetry.lock` (and optionally workflow files).
- name: Cache Packages
uses: actions/cache@v4
with:
path: |
~/.local
.venv
key: poetry-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/poetry.lock') }}

- name: Install and configure Poetry
uses: snok/[email protected]
with:
version: ${{ env.POETRY_VERSION }}
virtualenvs-create: true
virtualenvs-in-project: true

- name: Display Python version
run: poetry run python -c "import sys; print(sys.version)"

- name: Install dependencies
run: |
poetry install
- name: Install the project
run: uv sync --all-extras --dev

- name: Style checking
if: ${{ matrix.python-version == '3.10' }}
run: |
poetry run ruff check src tests
poetry run ruff format --check src tests
uv run ruff check src tests
uv run ruff format --check src tests
- name: Type checking
if: ${{ matrix.python-version == '3.10' }}
run: |
poetry run mypy src tests
uv run mypy src tests
- name: Run tests
run: |
poetry run pytest --cov --cov-report xml
uv run pytest --cov --cov-report xml
- name: Upload coverage to Codecov
if: ${{ github.event_name != 'pull_request_target' && matrix.python-version == '3.10' }}
Expand Down
12 changes: 2 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,14 @@ repos:
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/python-poetry/poetry
rev: 1.7.0
hooks:
- id: poetry-check
- repo: https://github.com/floatingpurr/sync_with_poetry
rev: 1.1.0
hooks:
- id: sync_with_poetry
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.5.5"
rev: "v0.7.4"
hooks:
- id: ruff
- id: ruff-format
args: [--check]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
rev: v1.13.0
hooks:
- id: mypy
exclude: ^docs/conf.py
Expand Down
Loading

0 comments on commit 1056a5b

Please sign in to comment.