Skip to content

Commit

Permalink
ci: Lint requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Sep 6, 2024
1 parent 893c998 commit d1a807d
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 34 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,30 @@ 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
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/[email protected]
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
run: curl -s -S --retry 3 $BASEDIR/tests/script.sh | bash -
- run: pip install -r requirements_dev.txt
- run: pytest /tmp/test_requirements.py
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ci:
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
Expand All @@ -16,4 +16,4 @@ repos:
- id: pip-compile
name: pip-compile requirements_dev.in
args: [requirements_dev.in, -o, requirements_dev.txt]
files: ^requirements_dev\.(in|txt)$
files: ^requirements(_dev)?\.(in|txt)$
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ 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", # ignore incompatible rules
"D200", # documentation preferences
"C901", "PLR0912", # complexity preferences
"C901", "PLR091", # complexity preferences
"D1", # docstrings
"PTH", # pathlib
"ARG002", # Scrapy keyword arguments
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file was autogenerated by uv via the following command:
# uv pip compile requirements.in -o requirements.txt --no-strip-extras
# uv pip compile requirements.in -o requirements.txt
attrs==23.1.0
# via
# automat
Expand Down
3 changes: 0 additions & 3 deletions requirements_dev.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
-r requirements.txt
coverage[toml]
coveralls
pre-commit
pytest
pytest-cov
ruff
26 changes: 0 additions & 26 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ cffi==1.15.1
# via
# -r requirements.txt
# cryptography
cfgv==3.4.0
# via pre-commit
charset-normalizer==3.2.0
# via
# -r requirements.txt
Expand All @@ -31,10 +29,7 @@ constantly==15.1.0
coverage==6.5.0
# via
# -r requirements_dev.in
# coveralls
# pytest-cov
coveralls==3.3.1
# via -r requirements_dev.in
cryptography==42.0.4
# via
# -r requirements.txt
Expand All @@ -50,21 +45,14 @@ defusedxml==0.7.1
# via
# -r requirements.txt
# scrapy
distlib==0.3.7
# via virtualenv
docopt==0.6.2
# via coveralls
filelock==3.12.2
# via
# -r requirements.txt
# tldextract
# virtualenv
hyperlink==21.0.0
# via
# -r requirements.txt
# twisted
identify==2.5.27
# via pre-commit
idna==3.7
# via
# -r requirements.txt
Expand Down Expand Up @@ -96,8 +84,6 @@ lxml==4.9.3
# -r requirements.txt
# parsel
# scrapy
nodeenv==1.8.0
# via pre-commit
numpy==1.25.2
# via
# -r requirements.txt
Expand All @@ -115,12 +101,8 @@ parsel==1.8.1
# -r requirements.txt
# itemloaders
# scrapy
platformdirs==3.10.0
# via virtualenv
pluggy==1.2.0
# via pytest
pre-commit==3.3.3
# via -r requirements_dev.in
protego==0.3.0
# via
# -r requirements.txt
Expand Down Expand Up @@ -160,24 +142,19 @@ pytz==2023.3
# via
# -r requirements.txt
# pandas
pyyaml==6.0.1
# via pre-commit
queuelib==1.6.2
# via
# -r requirements.txt
# scrapy
requests==2.32.3
# via
# -r requirements.txt
# coveralls
# requests-file
# tldextract
requests-file==1.5.1
# via
# -r requirements.txt
# tldextract
ruff==0.6.3
# via -r requirements_dev.in
scrapy==2.11.2
# via -r requirements.txt
service-identity==24.1.0
Expand All @@ -188,7 +165,6 @@ setuptools==74.1.1
# via
# -r requirements.txt
# incremental
# nodeenv
# scrapy
# zope-interface
six==1.16.0
Expand Down Expand Up @@ -217,8 +193,6 @@ urllib3==2.2.2
# via
# -r requirements.txt
# requests
virtualenv==20.24.3
# via pre-commit
w3lib==2.1.2
# via
# -r requirements.txt
Expand Down

0 comments on commit d1a807d

Please sign in to comment.