Upgrade dev deps + deps/upgrade script refactor.

This commit is contained in:
Joshua Bronson 2022-12-23 20:04:00 -05:00
parent 1e889f49b3
commit 90670b3d63
4 changed files with 11 additions and 71 deletions

View File

@ -1,49 +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==22.3.1
# via pip-tools
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
setuptools==65.6.3
# via pip-tools
tox==4.0.16
# via bidict (pyproject.toml)
virtualenv==20.17.1
# via tox
wheel==0.38.4
# via pip-tools

View File

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

View File

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

View File

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