From 796dc8de7e3a0da554d524f49be9aed8e2dd1a53 Mon Sep 17 00:00:00 2001 From: Jair Henrique Date: Sun, 10 Dec 2023 20:31:35 -0300 Subject: [PATCH] Move lint from tox to gh action --- .github/workflows/lint.yml | 22 ++++++++++++++++++++++ docs/contributing.rst | 17 ++++++++--------- tox.ini | 17 +++-------------- 3 files changed, 33 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..88a775ee7 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,22 @@ +name: Lint + +on: + push: + branches: + - master + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + - name: Install dependencies + run: pip install ruff + - name: Lint + run: | + ruff --version + ruff format --check . + ruff check . diff --git a/docs/contributing.rst b/docs/contributing.rst index f8e36d41c..6cbc41d90 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -24,7 +24,7 @@ So whilst reporting issues are valuable, please consider: - contributing an issue with a toy repo that replicates the issue. - contributing PRs is a more valuable donation of your time and effort. -Thanks again for your interest and support in VCRpy. +Thanks again for your interest and support in VCRpy. We really appreciate it. @@ -57,7 +57,7 @@ Simply adding these three labels for incoming issues means a lot for maintaining - Which library does it affect? ``core``, ``aiohttp``, ``requests``, ``urllib3``, ``tornado4``, ``httplib2`` - If it is a bug, is it ``Verified Can Replicate`` or ``Requires Help Replicating`` - Thanking people for raising issues. Feedback is always appreciated. - - Politely asking if they are able to link to an example repo that replicates the issue if they haven't already. Being able to *clone and go* helps the next person and we like that. 😃 + - Politely asking if they are able to link to an example repo that replicates the issue if they haven't already. Being able to *clone and go* helps the next person and we like that. 😃 **Maintainer:** @@ -68,7 +68,7 @@ This involves creating PRs to address bugs and enhancement requests. It also mea The PR reviewer is a second set of eyes to see if: - Are there tests covering the code paths added/modified? - Do the tests and modifications make sense seem appropriate? - - Add specific feedback, even on approvals, why it is accepted. eg "I like how you use a context manager there. 😄 " + - Add specific feedback, even on approvals, why it is accepted. eg "I like how you use a context manager there. 😄 " - Also make sure they add a line to `docs/changelog.rst` to claim credit for their contribution. **Release Manager:** @@ -86,10 +86,10 @@ Running VCR's test suite The tests are all run automatically on `Travis CI `__, but you can also run them yourself using `pytest `__ and -`Tox `__. +`Tox `__. -Tox will automatically run them in all environments VCR.py supports if they are available on your `PATH`. Alternatively you can use `tox-pyenv `_ with -`pyenv `_. +Tox will automatically run them in all environments VCR.py supports if they are available on your `PATH`. Alternatively you can use `tox-pyenv `_ with +`pyenv `_. We recommend you read the documentation for each and see the section further below. The test suite is pretty big and slow, but you can tell tox to only run specific tests like this:: @@ -114,8 +114,8 @@ Using PyEnv with VCR's test suite --------------------------------- PyEnv is a tool for managing multiple installation of python on your system. -See the full documentation at their `github `_ -but we are also going to use `tox-pyenv `_ +See the full documentation at their `github `_ +but we are also going to use `tox-pyenv `_ in this example:: git clone https://github.com/pyenv/pyenv ~/.pyenv @@ -139,7 +139,6 @@ in this example:: tox # Run the whole test suite or just part of it - tox -e lint tox -e py38-requests diff --git a/tox.ini b/tox.ini index 3d85a1bb1..299231548 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,6 @@ skip_missing_interpreters=true envlist = cov-clean, - lint, {py38,py39,py310,py311,py312}-{requests-urllib3-1,httplib2,urllib3-1,tornado4,boto3,aiohttp,httpx}, {py310,py311,py312}-{requests-urllib3-2,urllib3-2}, {pypy3}-{requests-urllib3-1,httplib2,urllib3-1,tornado4,boto3}, @@ -14,7 +13,7 @@ envlist = python = 3.8: py38 3.9: py39 - 3.10: py310, lint + 3.10: py310 3.11: py311 3.12: py312 pypy-3: pypy3 @@ -33,16 +32,6 @@ commands = coverage html coverage report --fail-under=90 -[testenv:lint] -skipsdist = True -commands = - ruff --version - ruff format --check . - ruff check . -deps = - ruff -basepython = python3.10 - [testenv] # Need to use develop install so that paths # for aggregate code coverage combine @@ -73,8 +62,8 @@ deps = httpx019: httpx==0.19 {py38,py39,py310}-{httpx}: pytest-asyncio depends = - lint,{py38,py39,py310,py311,py312,pypy3}-{requests-urllib3-1,httplib2,urllib3-1,tornado4,boto3},{py310,py311,py312}-{requests-urllib3-2,urllib3-2},{py38,py39,py310,py311,py312}-{aiohttp},{py38,py39,py310,py311,py312}-{httpx}: cov-clean - cov-report: lint,{py38,py39,py310,py311,py312,pypy3}-{requests-urllib3-1,httplib2,urllib3-1,tornado4,boto3},{py310,py311,py312}-{requests-urllib3-2,urllib3-2},{py38,py39,py310,py311,py312}-{aiohttp} + {py38,py39,py310,py311,py312,pypy3}-{requests-urllib3-1,httplib2,urllib3-1,tornado4,boto3},{py310,py311,py312}-{requests-urllib3-2,urllib3-2},{py38,py39,py310,py311,py312}-{aiohttp},{py38,py39,py310,py311,py312}-{httpx}: cov-clean + cov-report: {py38,py39,py310,py311,py312,pypy3}-{requests-urllib3-1,httplib2,urllib3-1,tornado4,boto3},{py310,py311,py312}-{requests-urllib3-2,urllib3-2},{py38,py39,py310,py311,py312}-{aiohttp} passenv = AWS_ACCESS_KEY_ID AWS_DEFAULT_REGION