Skip to content

Commit

Permalink
ci: Lint requirements. chore: Remove pip-tools. Add .python-version.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Sep 6, 2024
1 parent 31c064a commit c97182e
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 22 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,27 @@ jobs:
build:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
env:
PAT: ${{ secrets.PAT }}
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
with:
token: ${{ secrets.PAT || github.token }}
- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: pip
cache-dependency-path: '**/requirements*.txt'
- id: changed-files
uses: tj-actions/changed-files@v45
- uses: pre-commit/action@v3.0.1
continue-on-error: true
with:
extra_args: pip-compile --files ${{ steps.changed-files.outputs.all_changed_files }}
- if: ${{ env.PAT }}
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: '[github-actions] pre-commit autoupdate'
- shell: bash
run: curl -s -S --retry 3 $BASEDIR/tests/install.sh | bash -
- shell: bash
Expand Down
9 changes: 5 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
ci:
autoupdate_schedule: quarterly
skip: [pip-compile]
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.0
rev: v0.6.3
hooks:
- id: ruff
- id: ruff-format
- repo: https://github.com/jazzband/pip-tools
rev: 7.4.1
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.4.4
hooks:
- id: pip-compile
name: pip-compile requirements_dev.in
args: [requirements_dev.in, -o, requirements_dev.txt]
files: ^requirements(_dev)?\.(in|txt)$
args: [requirements_dev.in]

1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ select = ["ALL"]
ignore = [
"ANN", "COM", "EM",
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"W191", "E501", "D206", "Q000", "Q001", "Q002", "Q003", "ISC001",
"W191", "D206", "Q000", "Q001", "Q002", "Q003", "ISC001",
"D203", "D212", # incompatible rules
"D200", # documentation preferences
"C901", "PLR0912", # complexity preferences
"D100", "D103", "D400", "D415",
"C901", "PLR091", # complexity preferences
"D100", "D103", # docstrings
"S113", # requests timeout
"S603", # subprocess
]
1 change: 0 additions & 1 deletion requirements_dev.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ click
gitpython
ocdsextensionregistry[cli]
requests
ruff
sphinx-intl
19 changes: 6 additions & 13 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile requirements_dev.in
#
# This file was autogenerated by uv via the following command:
# uv pip compile requirements_dev.in -o requirements_dev.txt
alabaster==0.7.16
# via sphinx
attrs==23.2.0
Expand Down Expand Up @@ -61,9 +57,9 @@ mdurl==0.1.2
# via markdown-it-py
myst-parser==3.0.1
# via ocdsextensionregistry
ocds-babel[markdown]==0.3.5
ocds-babel==0.3.5
# via ocdsextensionregistry
ocdsextensionregistry[cli]==0.3.8
ocdsextensionregistry==0.3.8
# via -r requirements_dev.in
packaging==24.0
# via sphinx
Expand All @@ -81,8 +77,8 @@ requests==2.32.3
# sphinx
requests-cache==1.2.0
# via ocdsextensionregistry
ruff==0.4.6
# via -r requirements_dev.in
setuptools==74.1.1
# via sphinx-intl
six==1.16.0
# via url-normalize
smmap==5.0.1
Expand Down Expand Up @@ -114,6 +110,3 @@ urllib3==2.2.2
# via
# requests
# requests-cache

# The following packages are considered to be unsafe in a requirements file:
# setuptools

0 comments on commit c97182e

Please sign in to comment.