Skip to content

Commit

Permalink
Replace to flake8 by ruff to fully migrate to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
coldfix committed Dec 28, 2024
1 parent 25c9100 commit c37643c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 16 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@ on:
pull_request:

jobs:
# Quickly check with flake8 without having to go through the whole build:
flake8:
name: "Fast flake8"
# Quickly check with ruff without having to go through the whole build:
ruff:
name: "Fast lint"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Check on lowest supported python version to catch syntax errors:
- uses: actions/setup-python@v5
with: { python-version: "3.7" }
- run: pip install flake8
- run: flake8
- run: pip install ruff
- run: ruff check src

build_linux:
name: "Build: Linux (x64)"
Expand Down Expand Up @@ -323,9 +321,9 @@ jobs:
pip install cpymad -f dist --no-index --no-deps
pip install cpymad
- run: pip install flake8 twine coverage coveralls pytest
- run: pip install ruff twine coverage coveralls pytest
- run: twine check dist/*
- run: flake8
- run: ruff check src

- run: coverage run --source=cpymad -p -m pytest -v -k "not dframe"
- run: pip install pandas
Expand Down
19 changes: 18 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ optional-dependencies.doc = [
]
optional-dependencies.dev = [
"cython",
"flake8",
"ruff",
"pytest",
]

Expand Down Expand Up @@ -78,3 +78,20 @@ paths.source = [
"*/site-packages/cpymad-*.egg/cpymad",
"*/site-packages/cpymad/",
]

[tool.ruff]
line-length = 84
lint.ignore = [
"E701",
"E731",
"E741",
]
exclude = [
".git",
"__pycache__",
"doc/conf.py",
"build",
"dist",
".eggs",
"src/MAD-X",
]
6 changes: 0 additions & 6 deletions setup.cfg

This file was deleted.

0 comments on commit c37643c

Please sign in to comment.