diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 68a3667..2fc37d9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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/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 run: curl -s -S --retry 3 $BASEDIR/tests/script.sh | bash - + - run: pip install -r requirements_dev.txt + - run: pytest /tmp/test_requirements.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e17e6e8..c416bde 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 @@ -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)$ diff --git a/pyproject.toml b/pyproject.toml index d338c1c..daa37d6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 diff --git a/requirements.txt b/requirements.txt index 476c754..c7e1e29 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/requirements_dev.in b/requirements_dev.in index 98e76d0..dd632b0 100644 --- a/requirements_dev.in +++ b/requirements_dev.in @@ -1,7 +1,4 @@ -r requirements.txt coverage[toml] -coveralls -pre-commit pytest pytest-cov -ruff diff --git a/requirements_dev.txt b/requirements_dev.txt index 89508c8..955825b 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -160,8 +142,6 @@ pytz==2023.3 # via # -r requirements.txt # pandas -pyyaml==6.0.1 - # via pre-commit queuelib==1.6.2 # via # -r requirements.txt @@ -169,15 +149,12 @@ queuelib==1.6.2 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 @@ -188,7 +165,6 @@ setuptools==74.1.1 # via # -r requirements.txt # incremental - # nodeenv # scrapy # zope-interface six==1.16.0 @@ -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