Skip to content

Commit

Permalink
ci: faster with uv
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <[email protected]>
  • Loading branch information
henryiii committed Oct 2, 2024
1 parent 12dccba commit b1e4c88
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 58 deletions.
32 changes: 0 additions & 32 deletions .github/matchers/pylint.json

This file was deleted.

25 changes: 12 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,17 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: astral-sh/setup-uv@v3
- uses: pre-commit/[email protected]
with:
extra_args: --all-files --hook-stage manual
- name: PyLint
run: |
echo "::add-matcher::$GITHUB_WORKSPACE/.github/matchers/pylint.json"
pipx run nox -s pylint
run: uvx nox -s pylint -- --output-format=github


checks:
name: Check ${{ matrix.os }} Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
Expand All @@ -41,7 +40,6 @@ jobs:
- {os: macos-13, python-version: '3.9'}
- {os: windows-latest, python-version: '3.8'}
- {os: windows-latest, python-version: '3.11'}
name: Check ${{ matrix.os }} Python ${{ matrix.python-version }}

steps:
- uses: actions/checkout@v4
Expand All @@ -51,8 +49,10 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- uses: astral-sh/setup-uv@v3

- name: Install package
run: python -m pip install -e .[test]
run: uv pip install --system -e .[test]

- name: Pytest
if: runner.os == 'Linux'
Expand Down Expand Up @@ -82,17 +82,16 @@ jobs:
with:
python-version: "3.x"

- name: Install package
run: python -m pip install -e .[test]

- name: Install notebook requirements
run: python -m pip install nbconvert jupyter_client ipykernel
- uses: astral-sh/setup-uv@v3

- name: Install dot
run: sudo apt-get install graphviz

- name: Install pydot
run: python -m pip install pydot
- name: Install package
run: uv pip install --system -e .[test]

- name: Install notebook requirements
run: uv pip install --system nbconvert jupyter_client ipykernel pydot

- name: Run the notebooks inplace
run: jupyter nbconvert --execute --inplace notebooks/DecayLanguageDemo.ipynb notebooks/ExampleDecFileParsingWithLark.ipynb
11 changes: 1 addition & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,14 @@ repos:
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
types_or: [python, pyi, jupyter]
- id: ruff-format
types_or: [python, pyi, jupyter]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
hooks:
- id: mypy
files: '^src/decaylanguage/(decay|dec|utils)/'
additional_dependencies: [attrs, particle, importlib_resources, numpy>=1.26]
additional_dependencies: [attrs, particle, importlib_resources, numpy]

- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
Expand All @@ -55,10 +53,3 @@ repos:
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal

- repo: https://github.com/hadialqattan/pycln
rev: "v2.4.0"
hooks:
- id: pycln
args: [--all]
stages: [manual]
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@ messages_control.disable = [
"unused-argument", # covered by Ruff
]

[tool.ruff]
src = ["src"]

[tool.ruff.lint]
extend-select = [
"B", # flake8-bugbear
Expand Down

0 comments on commit b1e4c88

Please sign in to comment.