Skip to content

Commit

Permalink
Move lint from tox to gh action
Browse files Browse the repository at this point in the history
  • Loading branch information
jairhenrique committed Dec 10, 2023
1 parent cebdd45 commit 796dc8d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 23 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -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 .
17 changes: 8 additions & 9 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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:**

Expand All @@ -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:**
Expand All @@ -86,10 +86,10 @@ Running VCR's test suite
The tests are all run automatically on `Travis
CI <https://travis-ci.org/kevin1024/vcrpy>`__, but you can also run them
yourself using `pytest <http://pytest.org/>`__ and
`Tox <http://tox.testrun.org/>`__.
`Tox <http://tox.testrun.org/>`__.

Tox will automatically run them in all environments VCR.py supports if they are available on your `PATH`. Alternatively you can use `tox-pyenv <https://pypi.org/project/tox-pyenv/>`_ with
`pyenv <https://github.com/pyenv/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 <https://pypi.org/project/tox-pyenv/>`_ with
`pyenv <https://github.com/pyenv/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::
Expand All @@ -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 <https://github.com/pyenv/pyenv>`_
but we are also going to use `tox-pyenv <https://pypi.org/project/tox-pyenv/>`_
See the full documentation at their `github <https://github.com/pyenv/pyenv>`_
but we are also going to use `tox-pyenv <https://pypi.org/project/tox-pyenv/>`_
in this example::

git clone https://github.com/pyenv/pyenv ~/.pyenv
Expand All @@ -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


Expand Down
17 changes: 3 additions & 14 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 796dc8d

Please sign in to comment.