-
-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
migrate to ruff and uv #1986
Comments
Migrating to Should be a separate issue to migrate to ruff |
Afaik ruff configs can be done using |
the only thing i had to do is to add this to [tool.ruff]
line-length = 100 |
I guess we can just matrix the CI against both sets of tools for now |
As far as I see it:
|
Here I have tried to configure Here is an example use of lint-check = [
"echo \"ruff VERSION: `ruff --version`\"",
"ruff format .",
"ruff check . --fix",
"mypy src/ape_utils/",
"echo \"mdformat VERSION: `mdformat --version`\"",
"mdformat README.md docs/examples.md",
"echo \"check VERSION: `check --version`\"",
"cz check --rev-range $(git rev-list --all --reverse | head -1)..HEAD"
] NOTE: I'm using We can easily use on: ["push", "pull_request"]
name: Test
concurrency:
# Cancel older, in-progress jobs from the same PR, same workflow.
# use run_id if the job is triggered by a push to ensure
# push-triggered jobs to not get canceled.
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
# * Don't need to run on all versions as hatch matrix will do the job
python-version: ["3.9"]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install hatch pre-commit
hatch env create
- name: Lint and typecheck
run: |
hatch run lint:lint-check
- name: Run Tests
run: |
hatch run test:test |
it's been uv installable since May #2000 (comment) only ruff is left, and possibly using uv in ci, which has had an attempt recently #2165 |
In my own personal testing I've noticed that That may be okay for our use overall, but a limitation on what can be done for local development (and potentially limiting ourselves on how next release feature branches work) |
Elevator pitch:
this would massively speed up the build process
Value:
test runners and devs get almost instant installation, format and lint times
Dependencies:
make sure it works with
setuptools_scm
Design approach:
Task list:
Estimated completion date:
Design review:
Do not signoff unless:
Design reviewers should consider simpler approaches to achieve goals.
(Please leave a comment to sign off)
The text was updated successfully, but these errors were encountered: