Compare commits

...

3 Commits

Author SHA1 Message Date
Joshua Bronson 90670b3d63 Upgrade dev deps + deps/upgrade script refactor. 2022-12-23 20:04:08 -05:00
Joshua Bronson 1e889f49b3 Use pytest-xdist to parallelize tests.
Also:
* No need to enable coverage in CI for Python 3.7.
* Pin to latest version of tox in CI.
2022-12-23 17:54:49 -05:00
Joshua Bronson e0a5e46d15 rm unnecessary py dependency for tests 2022-12-23 14:38:52 -05:00
9 changed files with 23 additions and 84 deletions

View File

@ -28,7 +28,6 @@ jobs:
- pyversion: "3.9"
- pyversion: "3.8"
- pyversion: "3.7"
enable_coverage: true
- pyversion: pypy-3.9
- pyversion: pypy-3.8
- pyversion: pypy-3.7
@ -39,7 +38,7 @@ jobs:
python-version: ${{ matrix.pyversion }}
cache: pip
cache-dependency-path: dev-deps/test.txt
- run: python -m pip install -U pip setuptools wheel tox==4.0.5
- run: python -m pip install -U pip setuptools wheel tox==4.0.16
- name: cache .hypothesis dir
uses: actions/cache@v3.0.11
with:
@ -49,11 +48,11 @@ jobs:
if: matrix.enable_coverage
run: |
echo PYTEST_ADDOPTS="${PYTEST_ADDOPTS} --cov=bidict --cov-config=.coveragerc --cov-report=xml" >> "${GITHUB_ENV}"
echo TOX_TESTENV_PASSENV=PYTEST_ADDOPTS >> "${GITHUB_ENV}"
- run: tox -e py
- name: Upload coverage to Codecov # https://github.com/codecov/codecov-action
uses: codecov/codecov-action@v3.1.1
if: matrix.enable_coverage
with:
verbose: true
files: ./coverage.xml
fail_ci_if_error: false # https://github.com/codecov/codecov-action/issues/557

2
.gitignore vendored
View File

@ -2,7 +2,7 @@
.DS_Store
.benchmarks
.cache
.coverage
.coverage*
.eggs
.hypothesis
.idea

View File

@ -1,51 +0,0 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile --allow-unsafe --extra=dev --output-file=dev-deps/dev.txt --resolver=backtracking pyproject.toml
#
build==0.9.0
# via pip-tools
cachetools==5.2.0
# via tox
chardet==5.1.0
# via tox
click==8.1.3
# via pip-tools
colorama==0.4.6
# via tox
distlib==0.3.6
# via virtualenv
filelock==3.8.2
# via
# tox
# virtualenv
packaging==22.0
# via
# build
# pyproject-api
# tox
pep517==0.13.0
# via build
pip-tools==6.12.1
# via bidict (pyproject.toml)
platformdirs==2.6.0
# via
# tox
# virtualenv
pluggy==1.0.0
# via tox
pyproject-api==1.2.1
# via tox
tox==4.0.16
# via bidict (pyproject.toml)
virtualenv==20.17.1
# via tox
wheel==0.38.4
# via pip-tools
# The following packages are considered to be unsafe in a requirements file:
pip==22.3.1
# via pip-tools
setuptools==65.6.3
# via pip-tools

View File

@ -20,11 +20,9 @@ pre-commit==2.20.0
# via bidict (pyproject.toml)
pyyaml==6.0
# via pre-commit
setuptools==65.6.3
# via nodeenv
toml==0.10.2
# via pre-commit
virtualenv==20.17.1
# via pre-commit
# The following packages are considered to be unsafe in a requirements file:
setuptools==65.6.3
# via nodeenv

View File

@ -16,16 +16,14 @@ certifi==2022.12.7
# via requests
charset-normalizer==2.1.1
# via requests
coverage[toml]==7.0.0
# via
# bidict (pyproject.toml)
# pytest-cov
coverage[toml]==7.0.1
# via pytest-cov
docutils==0.19
# via sphinx
execnet==1.9.0
# via pytest-xdist
hypothesis==6.61.0
# via bidict (pyproject.toml)
icdiff==2.0.6
# via pytest-icdiff
idna==3.4
# via requests
imagesize==1.4.1
@ -42,10 +40,6 @@ packaging==22.0
# sphinx
pluggy==1.0.0
# via pytest
pprintpp==0.4.0
# via pytest-icdiff
py==1.11.0
# via bidict (pyproject.toml)
py-cpuinfo==9.0.0
# via pytest-benchmark
pygal==3.0.0
@ -59,12 +53,12 @@ pytest==7.2.0
# bidict (pyproject.toml)
# pytest-benchmark
# pytest-cov
# pytest-icdiff
# pytest-xdist
pytest-benchmark[histogram]==4.0.0
# via bidict (pyproject.toml)
pytest-cov==4.0.0
# via bidict (pyproject.toml)
pytest-icdiff==0.6
pytest-xdist==3.1.0
# via bidict (pyproject.toml)
pytz==2022.7
# via babel

View File

@ -44,6 +44,7 @@ build-backend = "setuptools.build_meta"
packages = ["bidict"]
[project.optional-dependencies]
lint = ["pre-commit"]
docs = [
"sphinx",
"sphinx-copybutton",
@ -51,21 +52,17 @@ docs = [
]
test = [
"hypothesis",
"coverage",
"py",
"pytest",
"pytest-benchmark[histogram]",
"pytest-cov",
"pytest-icdiff",
"pytest-benchmark[histogram]",
"pytest-xdist",
"sortedcollections",
"sortedcontainers",
# run_tests.py depends on Sphinx to run doctests (see note in run_tests.py)
"sphinx",
]
lint = [
"pre-commit",
]
dev = [
"pytest-icdiff",
"pip-tools",
"tox",
]

View File

@ -2,10 +2,10 @@
# See comment about pytest-doctest below.
#testpaths = bidict tests docs
testpaths = bidict tests
filterwarnings = error
doctest_optionflags = ELLIPSIS
addopts =
--verbose
--numprocesses=auto
--benchmark-disable
--doctest-modules
--doctest-glob=tests/*.txt

View File

@ -10,6 +10,7 @@ isolated_build = true
[testenv]
deps = -r dev-deps/test.txt
passenv = PYTEST_ADDOPTS
allowlist_externals = ./run_tests.py
commands = ./run_tests.py

View File

@ -13,6 +13,8 @@ log() {
}
main() {
pip install -e .[dev,lint]
if ! type pre-commit || ! type pip-compile; then
log "Error: pre-commit or pip-compile not found."
exit 1
@ -30,11 +32,10 @@ main() {
# Not adding --generate-hashes due to https://github.com/jazzband/pip-tools/issues/1326
local -r pip_compile="pip-compile pyproject.toml --upgrade --resolver=backtracking --allow-unsafe"
${pip_compile} --extra=test -o dev-deps/test.txt
${pip_compile} --extra=docs -o dev-deps/docs.txt
${pip_compile} --extra=lint -o dev-deps/lint.txt
${pip_compile} --extra=dev -o dev-deps/dev.txt
pip install -U -r dev-deps/test.txt -r dev-deps/docs.txt -r dev-deps/lint.txt -r dev-deps/dev.txt
echo docs test lint dev | tr " " "\n" | xargs -P 0 -I{} ${pip_compile} --extra={} -o dev-deps/{}.txt
pip uninstall -y -r <(pip freeze)
ls dev-deps/*.txt | xargs -I{} pip install -r {}
pip install -e .[dev,lint]
pre-commit autoupdate
pre-commit clean