nox supremacy

This commit is contained in:
Jakub Kropáček 2024-05-27 13:29:04 +02:00
parent 60088b679f
commit bcef4ff794
5 changed files with 105 additions and 122 deletions

31
noxfile.py Normal file
View file

@ -0,0 +1,31 @@
from nox_poetry import session
@session(python=["3.11", "3.12"])
def tests(s):
"""run the tests with pytest"""
s.install('pytest')
# session.install('.')
s.run('pytest', 'tests')
@session(python='python3.12')
def _type(s):
"""run type checks"""
s.install('mypy')
s.run('mypy', 'many_repos', 'tests')
@session(python='python3.12')
def lint(s):
"""run linter"""
s.install('ruff')
s.run('ruff', 'check', 'many_repos', 'tests')
@session(python='python3.12')
def coverage(s):
"""run coverage report"""
s.install('pytest', 'pytest-cov')
s.install('.')
s.run('pytest', '--cov=many_repos', 'tests/')

155
poetry.lock generated
View file

@ -1,26 +1,18 @@
# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand.
[[package]]
name = "cachetools"
version = "5.3.3"
description = "Extensible memoizing collections and decorators"
name = "argcomplete"
version = "3.3.0"
description = "Bash tab completion for argparse"
optional = false
python-versions = ">=3.7"
python-versions = ">=3.8"
files = [
{file = "cachetools-5.3.3-py3-none-any.whl", hash = "sha256:0abad1021d3f8325b2fc1d2e9c8b9c9d57b04c3932657a72465447332c24d945"},
{file = "cachetools-5.3.3.tar.gz", hash = "sha256:ba29e2dfa0b8b556606f097407ed1aa62080ee108ab0dc5ec9d6a723a007d105"},
{file = "argcomplete-3.3.0-py3-none-any.whl", hash = "sha256:c168c3723482c031df3c207d4ba8fa702717ccb9fc0bfe4117166c1f537b4a54"},
{file = "argcomplete-3.3.0.tar.gz", hash = "sha256:fd03ff4a5b9e6580569d34b273f741e85cd9e072f3feeeee3eba4891c70eda62"},
]
[[package]]
name = "chardet"
version = "5.2.0"
description = "Universal encoding detector for Python 3"
optional = false
python-versions = ">=3.7"
files = [
{file = "chardet-5.2.0-py3-none-any.whl", hash = "sha256:e1cf59446890a00105fe7b7912492ea04b6e6f06d4b742b2c788469e34c82970"},
{file = "chardet-5.2.0.tar.gz", hash = "sha256:1b3b6ff479a8c414bc3fa2c0852995695c4a026dcd6d0633b2dd092ca39c1cf7"},
]
[package.extras]
test = ["coverage", "mypy", "pexpect", "ruff", "wheel"]
[[package]]
name = "colorama"
@ -33,6 +25,23 @@ files = [
{file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"},
]
[[package]]
name = "colorlog"
version = "6.8.2"
description = "Add colours to the output of Python's logging module."
optional = false
python-versions = ">=3.6"
files = [
{file = "colorlog-6.8.2-py3-none-any.whl", hash = "sha256:4dcbb62368e2800cb3c5abd348da7e53f6c362dda502ec27c560b2e58a66bd33"},
{file = "colorlog-6.8.2.tar.gz", hash = "sha256:3e3e079a41feb5a1b64f978b5ea4f46040a94f11f0e8bbb8261e3dbbeca64d44"},
]
[package.dependencies]
colorama = {version = "*", markers = "sys_platform == \"win32\""}
[package.extras]
development = ["black", "flake8", "mypy", "pytest", "types-colorama"]
[[package]]
name = "distlib"
version = "0.3.8"
@ -44,20 +53,6 @@ files = [
{file = "distlib-0.3.8.tar.gz", hash = "sha256:1530ea13e350031b6312d8580ddb6b27a104275a31106523b8f123787f494f64"},
]
[[package]]
name = "exceptiongroup"
version = "1.2.1"
description = "Backport of PEP 654 (exception groups)"
optional = false
python-versions = ">=3.7"
files = [
{file = "exceptiongroup-1.2.1-py3-none-any.whl", hash = "sha256:5258b9ed329c5bbdd31a309f53cbfb0b155341807f6ff7606a1e801a891b29ad"},
{file = "exceptiongroup-1.2.1.tar.gz", hash = "sha256:a4785e48b045528f5bfe627b6ad554ff32def154f42372786903b7abcfe1aa16"},
]
[package.extras]
test = ["pytest (>=6)"]
[[package]]
name = "filelock"
version = "3.14.0"
@ -123,7 +118,6 @@ files = [
[package.dependencies]
mypy-extensions = ">=1.0.0"
tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""}
typing-extensions = ">=4.1.0"
[package.extras]
@ -143,6 +137,43 @@ files = [
{file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"},
]
[[package]]
name = "nox"
version = "2024.4.15"
description = "Flexible test automation."
optional = false
python-versions = ">=3.7"
files = [
{file = "nox-2024.4.15-py3-none-any.whl", hash = "sha256:6492236efa15a460ecb98e7b67562a28b70da006ab0be164e8821177577c0565"},
{file = "nox-2024.4.15.tar.gz", hash = "sha256:ecf6700199cdfa9e5ea0a41ff5e6ef4641d09508eda6edb89d9987864115817f"},
]
[package.dependencies]
argcomplete = ">=1.9.4,<4.0"
colorlog = ">=2.6.1,<7.0.0"
packaging = ">=20.9"
virtualenv = ">=20.14.1"
[package.extras]
tox-to-nox = ["jinja2", "tox"]
uv = ["uv (>=0.1.6)"]
[[package]]
name = "nox-poetry"
version = "1.0.3"
description = "nox-poetry"
optional = false
python-versions = ">=3.7,<4.0"
files = [
{file = "nox_poetry-1.0.3-py3-none-any.whl", hash = "sha256:a2fffeb70ae81840479e68287afe1c772bf376f70f1e92f99832a20b3c64d064"},
{file = "nox_poetry-1.0.3.tar.gz", hash = "sha256:dc7ecbbd812a333a0c0b558f57e5b37f7c12926cddbcecaf2264957fd373824e"},
]
[package.dependencies]
nox = ">=2020.8.22"
packaging = ">=20.9"
tomlkit = ">=0.7"
[[package]]
name = "packaging"
version = "24.0"
@ -185,25 +216,6 @@ files = [
dev = ["pre-commit", "tox"]
testing = ["pytest", "pytest-benchmark"]
[[package]]
name = "pyproject-api"
version = "1.6.1"
description = "API to interact with the python pyproject.toml based projects"
optional = false
python-versions = ">=3.8"
files = [
{file = "pyproject_api-1.6.1-py3-none-any.whl", hash = "sha256:4c0116d60476b0786c88692cf4e325a9814965e2469c5998b830bba16b183675"},
{file = "pyproject_api-1.6.1.tar.gz", hash = "sha256:1817dc018adc0d1ff9ca1ed8c60e1623d5aaca40814b953af14a9cf9a5cae538"},
]
[package.dependencies]
packaging = ">=23.1"
tomli = {version = ">=2.0.1", markers = "python_version < \"3.11\""}
[package.extras]
docs = ["furo (>=2023.8.19)", "sphinx (<7.2)", "sphinx-autodoc-typehints (>=1.24)"]
testing = ["covdefaults (>=2.3)", "pytest (>=7.4)", "pytest-cov (>=4.1)", "pytest-mock (>=3.11.1)", "setuptools (>=68.1.2)", "wheel (>=0.41.2)"]
[[package]]
name = "pytest"
version = "8.2.1"
@ -217,11 +229,9 @@ files = [
[package.dependencies]
colorama = {version = "*", markers = "sys_platform == \"win32\""}
exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""}
iniconfig = "*"
packaging = "*"
pluggy = ">=1.5,<2.0"
tomli = {version = ">=1", markers = "python_version < \"3.11\""}
[package.extras]
dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"]
@ -253,43 +263,16 @@ files = [
]
[[package]]
name = "tomli"
version = "2.0.1"
description = "A lil' TOML parser"
name = "tomlkit"
version = "0.12.5"
description = "Style preserving TOML library"
optional = false
python-versions = ">=3.7"
files = [
{file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"},
{file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"},
{file = "tomlkit-0.12.5-py3-none-any.whl", hash = "sha256:af914f5a9c59ed9d0762c7b64d3b5d5df007448eb9cd2edc8a46b1eafead172f"},
{file = "tomlkit-0.12.5.tar.gz", hash = "sha256:eef34fba39834d4d6b73c9ba7f3e4d1c417a4e56f89a7e96e090dd0d24b8fb3c"},
]
[[package]]
name = "tox"
version = "4.15.0"
description = "tox is a generic virtualenv management and test command line tool"
optional = false
python-versions = ">=3.8"
files = [
{file = "tox-4.15.0-py3-none-any.whl", hash = "sha256:300055f335d855b2ab1b12c5802de7f62a36d4fd53f30bd2835f6a201dda46ea"},
{file = "tox-4.15.0.tar.gz", hash = "sha256:7a0beeef166fbe566f54f795b4906c31b428eddafc0102ac00d20998dd1933f6"},
]
[package.dependencies]
cachetools = ">=5.3.2"
chardet = ">=5.2"
colorama = ">=0.4.6"
filelock = ">=3.13.1"
packaging = ">=23.2"
platformdirs = ">=4.1"
pluggy = ">=1.3"
pyproject-api = ">=1.6.1"
tomli = {version = ">=2.0.1", markers = "python_version < \"3.11\""}
virtualenv = ">=20.25"
[package.extras]
docs = ["furo (>=2023.9.10)", "sphinx (>=7.2.6)", "sphinx-argparse-cli (>=1.11.1)", "sphinx-autodoc-typehints (>=1.25.2)", "sphinx-copybutton (>=0.5.2)", "sphinx-inline-tabs (>=2023.4.21)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=23.11)"]
testing = ["build[virtualenv] (>=1.0.3)", "covdefaults (>=2.3)", "detect-test-pollution (>=1.2)", "devpi-process (>=1)", "diff-cover (>=8.0.2)", "distlib (>=0.3.8)", "flaky (>=3.7)", "hatch-vcs (>=0.4)", "hatchling (>=1.21)", "psutil (>=5.9.7)", "pytest (>=7.4.4)", "pytest-cov (>=4.1)", "pytest-mock (>=3.12)", "pytest-xdist (>=3.5)", "re-assert (>=1.1)", "time-machine (>=2.13)", "wheel (>=0.42)"]
[[package]]
name = "typing-extensions"
version = "4.12.0"
@ -323,5 +306,5 @@ test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess
[metadata]
lock-version = "2.0"
python-versions = "^3.10"
content-hash = "d1b9e19425ac7172708e0c3145dd78bc672c6c47b7a02b6de4251073db7fa713"
python-versions = "^3.11"
content-hash = "a9bcd03956fdc0839f84ddf34f9ca251169ffb346662ca4e5442d0abf6dc0c5d"

View file

@ -14,14 +14,15 @@ packages = [
many-repos-clone = "many_repos.clone:main"
[tool.poetry.dependencies]
python = "^3.10"
python = "^3.11"
[tool.poetry.group.dev.dependencies]
tox = "^4.15.0"
pytest = "^8.2.1"
ruff = "^0.4.5"
mypy = "^1.10.0"
nox = "^2024.4.15"
nox-poetry = "^1.0.3"
[build-system]
requires = ["poetry-core"]

View file

@ -4,10 +4,10 @@ from many_repos.config import Source
@pytest.fixture(params=[True, False])
def source_config(forks):
def source_config(request):
return Source(
source_type="github",
username="JustScreaMy",
token="testToken",
forks=forks
forks=request.param
)

32
tox.ini
View file

@ -1,32 +0,0 @@
[tox]
requires =
tox>=4
env_list =
py{310,311,312}
lint
coverage
type
[testenv]
description = run the tests with pytest
deps = pytest
commands =
pytest {posargs:tests}
[testenv:type]
description = run type checks
deps = mypy
commands =
mypy {posargs:many_repos tests}
[testenv:lint]
description = run linter
deps = ruff
commands = ruff check {posargs:many_repos tests}
[testenv:coverage]
description = run coverage report
deps =
pytest
pytest-cov
commands = pytest --cov=many_repos tests/