mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-09 17:15:35 +00:00
Move lint from tox to gh action
This commit is contained in:
22
.github/workflows/lint.yml
vendored
Normal file
22
.github/workflows/lint.yml
vendored
Normal file
@@ -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 .
|
||||||
@@ -24,7 +24,7 @@ So whilst reporting issues are valuable, please consider:
|
|||||||
- contributing an issue with a toy repo that replicates the issue.
|
- contributing an issue with a toy repo that replicates the issue.
|
||||||
- contributing PRs is a more valuable donation of your time and effort.
|
- 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.
|
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``
|
- 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``
|
- If it is a bug, is it ``Verified Can Replicate`` or ``Requires Help Replicating``
|
||||||
- Thanking people for raising issues. Feedback is always appreciated.
|
- 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:**
|
**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:
|
The PR reviewer is a second set of eyes to see if:
|
||||||
- Are there tests covering the code paths added/modified?
|
- Are there tests covering the code paths added/modified?
|
||||||
- Do the tests and modifications make sense seem appropriate?
|
- 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.
|
- Also make sure they add a line to `docs/changelog.rst` to claim credit for their contribution.
|
||||||
|
|
||||||
**Release Manager:**
|
**Release Manager:**
|
||||||
@@ -86,10 +86,10 @@ Running VCR's test suite
|
|||||||
The tests are all run automatically on `Travis
|
The tests are all run automatically on `Travis
|
||||||
CI <https://travis-ci.org/kevin1024/vcrpy>`__, but you can also run them
|
CI <https://travis-ci.org/kevin1024/vcrpy>`__, but you can also run them
|
||||||
yourself using `pytest <http://pytest.org/>`__ and
|
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
|
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>`_.
|
`pyenv <https://github.com/pyenv/pyenv>`_.
|
||||||
We recommend you read the documentation for each and see the section further below.
|
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::
|
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.
|
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>`_
|
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/>`_
|
but we are also going to use `tox-pyenv <https://pypi.org/project/tox-pyenv/>`_
|
||||||
in this example::
|
in this example::
|
||||||
|
|
||||||
git clone https://github.com/pyenv/pyenv ~/.pyenv
|
git clone https://github.com/pyenv/pyenv ~/.pyenv
|
||||||
@@ -139,7 +139,6 @@ in this example::
|
|||||||
tox
|
tox
|
||||||
|
|
||||||
# Run the whole test suite or just part of it
|
# Run the whole test suite or just part of it
|
||||||
tox -e lint
|
|
||||||
tox -e py38-requests
|
tox -e py38-requests
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
17
tox.ini
17
tox.ini
@@ -2,7 +2,6 @@
|
|||||||
skip_missing_interpreters=true
|
skip_missing_interpreters=true
|
||||||
envlist =
|
envlist =
|
||||||
cov-clean,
|
cov-clean,
|
||||||
lint,
|
|
||||||
{py38,py39,py310,py311,py312}-{requests-urllib3-1,httplib2,urllib3-1,tornado4,boto3,aiohttp,httpx},
|
{py38,py39,py310,py311,py312}-{requests-urllib3-1,httplib2,urllib3-1,tornado4,boto3,aiohttp,httpx},
|
||||||
{py310,py311,py312}-{requests-urllib3-2,urllib3-2},
|
{py310,py311,py312}-{requests-urllib3-2,urllib3-2},
|
||||||
{pypy3}-{requests-urllib3-1,httplib2,urllib3-1,tornado4,boto3},
|
{pypy3}-{requests-urllib3-1,httplib2,urllib3-1,tornado4,boto3},
|
||||||
@@ -14,7 +13,7 @@ envlist =
|
|||||||
python =
|
python =
|
||||||
3.8: py38
|
3.8: py38
|
||||||
3.9: py39
|
3.9: py39
|
||||||
3.10: py310, lint
|
3.10: py310
|
||||||
3.11: py311
|
3.11: py311
|
||||||
3.12: py312
|
3.12: py312
|
||||||
pypy-3: pypy3
|
pypy-3: pypy3
|
||||||
@@ -33,16 +32,6 @@ commands =
|
|||||||
coverage html
|
coverage html
|
||||||
coverage report --fail-under=90
|
coverage report --fail-under=90
|
||||||
|
|
||||||
[testenv:lint]
|
|
||||||
skipsdist = True
|
|
||||||
commands =
|
|
||||||
ruff --version
|
|
||||||
ruff format --check .
|
|
||||||
ruff check .
|
|
||||||
deps =
|
|
||||||
ruff
|
|
||||||
basepython = python3.10
|
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
# Need to use develop install so that paths
|
# Need to use develop install so that paths
|
||||||
# for aggregate code coverage combine
|
# for aggregate code coverage combine
|
||||||
@@ -73,8 +62,8 @@ deps =
|
|||||||
httpx019: httpx==0.19
|
httpx019: httpx==0.19
|
||||||
{py38,py39,py310}-{httpx}: pytest-asyncio
|
{py38,py39,py310}-{httpx}: pytest-asyncio
|
||||||
depends =
|
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
|
{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}
|
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 =
|
passenv =
|
||||||
AWS_ACCESS_KEY_ID
|
AWS_ACCESS_KEY_ID
|
||||||
AWS_DEFAULT_REGION
|
AWS_DEFAULT_REGION
|
||||||
|
|||||||
Reference in New Issue
Block a user