From ff0360745e7670390ee89356181cea76378a3d9d Mon Sep 17 00:00:00 2001 From: Konstantinos Papadopoulos Date: Fri, 17 Nov 2023 15:59:01 +0100 Subject: [PATCH] Add testing duration improvements (#440) * Install pytest xdist plugin * Run tests with pytest-xdist * Use mypy cache in tox This makes running mypy from tox much faster (e.g., with `tox -e typing`). * Store and load mypy cache in GH workflow * Use `black` cache in tox * Add `pytest-cov` plugin In order to get coverage when using the `pytest-xdist` plugin we should use `pytest-cov`. * Move `pytest-xdist` to dev-packages in Pipfile --------- Co-authored-by: Martin Vrachev --- .coveragerc | 2 + .github/workflows/ci.yml | 19 ++++- Pipfile | 2 + Pipfile.lock | 80 ++++++++++--------- requirements-dev.txt | 161 ++++++++++++++++++++------------------- requirements.txt | 46 +++++------ tox.ini | 8 +- 7 files changed, 177 insertions(+), 141 deletions(-) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..c712d259 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,2 @@ +[run] +omit = tests/* diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a6d7441b..5e384b3b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,8 +29,25 @@ jobs: - name: Test Build binary wheel and source tarball run: python3 -m build --sdist --wheel --outdir dist/ . + - name: Restore mypy cache + id: cache-mypy-restore + uses: actions/cache/restore@v3 + with: + path: | + .mypy_cache + key: ${{ runner.os }}-py${{ matrix.python-versions }}-mypy-${{ hashFiles('**/.mypy_cache') }} + - name: Run Python tests - run: make tests + run: | + make tests + + - name: Save mypy cache + id: cache-mypy-save + uses: actions/cache/save@v3 + with: + path: | + .mypy_cache + key: ${{ runner.os }}-py${{ matrix.python-versions }}-mypy-${{ hashFiles('**/.mypy_cache') }} - name: Codecov uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d diff --git a/Pipfile b/Pipfile index 8d753a48..6560b061 100644 --- a/Pipfile +++ b/Pipfile @@ -23,6 +23,8 @@ isort = "*" flake8 = "*" tox = "*" pytest = "*" +pytest-cov = "*" +pytest-xdist = "*" coverage = "*" mypy = "*" pip = "*" diff --git a/Pipfile.lock b/Pipfile.lock index c95a8cc2..73e86e73 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "e6f13f9d94caba4d808168984d0289b575b63863411137826b0896a212a966df" + "sha256": "291fa7fed8343016b7bc3bfd891b9395d2a0bc45e86d38490f0558793c84874f" }, "pipfile-spec": 6, "requires": { @@ -22,7 +22,6 @@ "sha256:f65100404e2d35225402852da2e3d32e0390ac25a1245fff1b40178340ab3875" ], "index": "pypi", - "markers": "python_version >= '3.7' and python_version < '4.0'", "version": "==0.1.1" }, "certifi": { @@ -193,7 +192,6 @@ "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de" ], "index": "pypi", - "markers": "python_version >= '3.7'", "version": "==8.1.7" }, "cryptography": { @@ -232,7 +230,7 @@ "sha256:2e6adebaa587f4df9241a16a4bec3fda521154d26b15f3258fde753a592831b6", "sha256:858f9806fab2409c4f5442614c2605d4c4071d5e5153b0e7f24a225f27465aed" ], - "markers": "python_version >= '3.8'", + "index": "pypi", "version": "==3.2.4" }, "greenlet": { @@ -312,7 +310,6 @@ "sha256:f84c2818376e66cf843d497486ea8fed8700b340f308f076c6fb1229dff318b6" ], "index": "pypi", - "markers": "python_full_version >= '3.8.0'", "version": "==5.12.0" }, "markdown-it-py": { @@ -348,7 +345,6 @@ "sha256:ff432630e510709564c01dafdbe996cb552e0b9f3f065eb89bdce5bd31fabf4c" ], "index": "pypi", - "markers": "python_version >= '3.7'", "version": "==2.9.9" }, "pycparser": { @@ -379,7 +375,7 @@ "sha256:a422368fc821589c228f4c49438a368831cb5bbc0eab5ebe1d7fac9dded6567b", "sha256:e46dae94e34b085175f8abb3b0aaa7da40767865ac82c928eeb9e57e1ea8a543" ], - "markers": "python_version >= '3.6'", + "index": "pypi", "version": "==1.5.0" }, "requests": { @@ -388,7 +384,6 @@ "sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1" ], "index": "pypi", - "markers": "python_version >= '3.7'", "version": "==2.31.0" }, "rich": { @@ -397,7 +392,6 @@ "sha256:5c14d22737e6d5084ef4771b62d5d4363165b403455a30a1c8ca39dc7b644bef" ], "index": "pypi", - "markers": "python_full_version >= '3.7.0'", "version": "==13.6.0" }, "rich-click": { @@ -406,7 +400,6 @@ "sha256:c37d19af85c86b9a256c18e9d23637ae89478300ec8dc5e220c6ca213675f2f9" ], "index": "pypi", - "markers": "python_version >= '3.7'", "version": "==1.7.1" }, "ruamel.yaml": { @@ -480,7 +473,7 @@ "sha256:9e6b9abe36a511d4f52c759069db8f6f650362ba82d6efc7bc7466a458b3f499", "sha256:a27e519247576f2a77b97fb03267d8eeb88eba715d12da64109e845616f919c6" ], - "markers": "python_version ~= '3.7'", + "index": "pypi", "version": "==0.28.0" }, "sqlalchemy": { @@ -536,7 +529,6 @@ "sha256:fd54601ef9cc455a0c61e5245f690c8a3ad67ddb03d3b91c361d076def0b4c60" ], "index": "pypi", - "markers": "python_version >= '3.7'", "version": "==2.0.23" }, "tuf": { @@ -545,7 +537,6 @@ "sha256:a8f055fbaf90d1477258c98fe29d23217e793ca0bdc5fb5a7d252ff5acecddc0" ], "index": "pypi", - "markers": "python_version >= '3.8'", "version": "==3.1.0" }, "typing-extensions": { @@ -588,7 +579,6 @@ "sha256:bdfc739baa03b880c2d15d0431b31c658ffc348e907fe197e54e0389dd59e11e" ], "index": "pypi", - "markers": "python_version >= '3.7'", "version": "==1.7.5" }, "black": { @@ -613,7 +603,6 @@ "sha256:fc7f6a44d52747e65a02558e1d807c82df1d66ffa80a601862040a43ec2e3142" ], "index": "pypi", - "markers": "python_version >= '3.8'", "version": "==23.11.0" }, "build": { @@ -622,7 +611,6 @@ "sha256:589bf99a67df7c9cf07ec0ac0e5e2ea5d4b37ac63301c4986d1acb126aa83f8f" ], "index": "pypi", - "markers": "python_version >= '3.7'", "version": "==1.0.3" }, "cachetools": { @@ -759,7 +747,6 @@ "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de" ], "index": "pypi", - "markers": "python_version >= '3.7'", "version": "==8.1.7" }, "colorama": { @@ -826,7 +813,6 @@ "sha256:fe494faa90ce6381770746077243231e0b83ff3f17069d748f645617cefe19d4" ], "index": "pypi", - "markers": "python_version >= '3.8'", "version": "==7.3.2" }, "distlib": { @@ -860,6 +846,14 @@ "markers": "python_version < '3.11'", "version": "==1.1.3" }, + "execnet": { + "hashes": [ + "sha256:88256416ae766bc9e8895c76a87928c0012183da3cc4fc18016e6f050e025f41", + "sha256:cc59bc4423742fd71ad227122eb0dd44db51efb3dc4095b45ac9a08c770096af" + ], + "markers": "python_version >= '3.7'", + "version": "==2.0.2" + }, "filelock": { "hashes": [ "sha256:521f5f56c50f8426f5e03ad3b281b490a87ef15bc6c526f168290f0c7148d44e", @@ -874,7 +868,6 @@ "sha256:ffdfce58ea94c6580c77888a86506937f9a1a227dfcd15f245d694ae20a6b6e5" ], "index": "pypi", - "markers": "python_full_version >= '3.8.1'", "version": "==6.1.0" }, "gitdb": { @@ -925,6 +918,14 @@ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==1.4.1" }, + "importlib-metadata": { + "hashes": [ + "sha256:3ebb78df84a805d7698245025b975d9d67053cd94c79245ba4b3eb694abe68bb", + "sha256:dbace7892d8c0c4ac1ad096662232f831d4e64f4c4545bd53016a3e9d4654743" + ], + "markers": "python_version < '3.10'", + "version": "==6.8.0" + }, "iniconfig": { "hashes": [ "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3", @@ -939,7 +940,6 @@ "sha256:f84c2818376e66cf843d497486ea8fed8700b340f308f076c6fb1229dff318b6" ], "index": "pypi", - "markers": "python_full_version >= '3.8.0'", "version": "==5.12.0" }, "jinja2": { @@ -1071,7 +1071,6 @@ "sha256:fc9fe455ad58a20ec68599139ed1113b21f977b536a91b42bef3ffed5cce7391" ], "index": "pypi", - "markers": "python_version >= '3.8'", "version": "==1.7.0" }, "mypy-extensions": { @@ -1120,7 +1119,6 @@ "sha256:55eb67bb6171d37447e82213be585b75fe2b12b359e993773aca4de9247a052b" ], "index": "pypi", - "markers": "python_version >= '3.7'", "version": "==23.3.1" }, "platformdirs": { @@ -1145,7 +1143,6 @@ "sha256:841dc9aef25daba9a0238cd27984041fa0467b4199fc4852e27950664919f660" ], "index": "pypi", - "markers": "python_version >= '3.8'", "version": "==3.5.0" }, "pretend": { @@ -1202,9 +1199,24 @@ "sha256:d989d136982de4e3b29dabcc838ad581c64e8ed52c11fbe86ddebd9da0818cd5" ], "index": "pypi", - "markers": "python_version >= '3.7'", "version": "==7.4.3" }, + "pytest-cov": { + "hashes": [ + "sha256:3904b13dfbfec47f003b8e77fd5b589cd11904a21ddf1ab38a64f204d6a10ef6", + "sha256:6ba70b9e97e69fcc3fb45bfeab2d0a138fb65c4d0d6a41ef33983ad114be8c3a" + ], + "index": "pypi", + "version": "==4.1.0" + }, + "pytest-xdist": { + "hashes": [ + "sha256:3a94a931dd9e268e0b871a877d09fe2efb6175c2c23d60d56a6001359002b832", + "sha256:e513118bf787677a427e025606f55e95937565e06dfaac8d87f55301e57ae607" + ], + "index": "pypi", + "version": "==3.4.0" + }, "pyyaml": { "hashes": [ "sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5", @@ -1267,7 +1279,6 @@ "sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1" ], "index": "pypi", - "markers": "python_version >= '3.7'", "version": "==2.31.0" }, "rich": { @@ -1276,7 +1287,6 @@ "sha256:5c14d22737e6d5084ef4771b62d5d4363165b403455a30a1c8ca39dc7b644bef" ], "index": "pypi", - "markers": "python_full_version >= '3.7.0'", "version": "==13.6.0" }, "setuptools": { @@ -1308,7 +1318,6 @@ "sha256:9a5160e1ea90688d5963ba09a2dcd8bdd526620edbb65c328728f1b2228d5ab5" ], "index": "pypi", - "markers": "python_version >= '3.9'", "version": "==7.2.6" }, "sphinx-rtd-theme": { @@ -1317,7 +1326,6 @@ "sha256:590b030c7abb9cf038ec053b95e5380b5c70d61591eb0b552063fbe7c41f0931" ], "index": "pypi", - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'", "version": "==1.3.0" }, "sphinxcontrib-applehelp": { @@ -1326,7 +1334,6 @@ "sha256:39fdc8d762d33b01a7d8f026a3b7d71563ea3b72787d5f00ad8465bd9d6dfbfa" ], "index": "pypi", - "markers": "python_version >= '3.9'", "version": "==1.0.7" }, "sphinxcontrib-devhelp": { @@ -1335,7 +1342,6 @@ "sha256:fe8009aed765188f08fcaadbb3ea0d90ce8ae2d76710b7e29ea7d047177dae2f" ], "index": "pypi", - "markers": "python_version >= '3.9'", "version": "==1.0.5" }, "sphinxcontrib-htmlhelp": { @@ -1344,7 +1350,6 @@ "sha256:8001661c077a73c29beaf4a79968d0726103c5605e27db92b9ebed8bab1359e9" ], "index": "pypi", - "markers": "python_version >= '3.9'", "version": "==2.0.4" }, "sphinxcontrib-jquery": { @@ -1361,7 +1366,6 @@ "sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8" ], "index": "pypi", - "markers": "python_version >= '3.5'", "version": "==1.0.1" }, "sphinxcontrib-plantuml": { @@ -1377,7 +1381,6 @@ "sha256:bf76886ee7470b934e363da7a954ea2825650013d367728588732c7350f49ea4" ], "index": "pypi", - "markers": "python_version >= '3.9'", "version": "==1.0.6" }, "sphinxcontrib-serializinghtml": { @@ -1386,7 +1389,6 @@ "sha256:9b36e503703ff04f20e9675771df105e58aa029cfcbc23b8ed716019b7416ae1" ], "index": "pypi", - "markers": "python_version >= '3.9'", "version": "==1.1.9" }, "stevedore": { @@ -1411,7 +1413,6 @@ "sha256:599af5e5bb0cad0148ac1558a0b66f8fff219ef88363483b8d92a81e4246f28f" ], "index": "pypi", - "markers": "python_version >= '3.8'", "version": "==4.11.3" }, "types-requests": { @@ -1420,7 +1421,6 @@ "sha256:dc5852a76f1eaf60eafa81a2e50aefa3d1f015c34cf0cba130930866b1b22a92" ], "index": "pypi", - "markers": "python_version >= '3.7'", "version": "==2.31.0.10" }, "typing-extensions": { @@ -1446,6 +1446,14 @@ ], "markers": "python_version >= '3.7'", "version": "==20.24.6" + }, + "zipp": { + "hashes": [ + "sha256:0e923e726174922dce09c53c59ad483ff7bbb8e572e00c7f7c46b88556409f31", + "sha256:84e64a1c28cf7e91ed2078bb8cc8c259cb19b76942096c8d7b84947690cabaf0" + ], + "markers": "python_version >= '3.8'", + "version": "==3.17.0" } } } diff --git a/requirements-dev.txt b/requirements-dev.txt index 013a4b9e..b1c4fdc6 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,87 +1,92 @@ -i https://pypi.org/simple -alabaster==0.7.13; python_version >= '3.6' -babel==2.13.1; python_version >= '3.7' -bandit==1.7.5; python_version >= '3.7' -black==23.11.0; python_version >= '3.8' -build==1.0.3; python_version >= '3.7' -cachetools==5.3.2; python_version >= '3.7' -certifi==2023.7.22; python_version >= '3.6' -cfgv==3.4.0; python_version >= '3.8' -chardet==5.2.0; python_version >= '3.7' -charset-normalizer==3.3.2; python_full_version >= '3.7.0' -click==8.1.7; python_version >= '3.7' -colorama==0.4.6; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6' -coverage==7.3.2; python_version >= '3.8' +alabaster==0.7.13 ; python_version >= '3.6' +babel==2.13.1 ; python_version >= '3.7' +bandit==1.7.5 +black==23.11.0 +build==1.0.3 +cachetools==5.3.2 ; python_version >= '3.7' +certifi==2023.7.22 ; python_version >= '3.6' +cfgv==3.4.0 ; python_version >= '3.8' +chardet==5.2.0 ; python_version >= '3.7' +charset-normalizer==3.3.2 ; python_full_version >= '3.7.0' +click==8.1.7 +colorama==0.4.6 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6' +coverage==7.3.2 distlib==0.3.7 -docutils==0.18.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' -editables==0.5; python_version >= '3.1' -exceptiongroup==1.1.3; python_version < '3.11' -filelock==3.13.1; python_version >= '3.8' -flake8==6.1.0; python_full_version >= '3.8.1' -gitdb==4.0.11; python_version >= '3.7' -gitpython==3.1.40; python_version >= '3.7' +docutils==0.18.1 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' +editables==0.5 ; python_version >= '3.1' +exceptiongroup==1.1.3 ; python_version < '3.11' +execnet==2.0.2 ; python_version >= '3.7' +filelock==3.13.1 ; python_version >= '3.8' +flake8==6.1.0 +gitdb==4.0.11 ; python_version >= '3.7' +gitpython==3.1.40 ; python_version >= '3.7' hatchling==0.22.0 -identify==2.5.31; python_version >= '3.8' -idna==3.4; python_version >= '3.5' -imagesize==1.4.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' -iniconfig==2.0.0; python_version >= '3.7' -isort==5.12.0; python_full_version >= '3.8.0' -jinja2==3.1.2; python_version >= '3.7' -markdown-it-py==3.0.0; python_version >= '3.8' -markupsafe==2.1.3; python_version >= '3.7' -mccabe==0.7.0; python_version >= '3.6' -mdurl==0.1.2; python_version >= '3.7' -mypy==1.7.0; python_version >= '3.8' -mypy-extensions==1.0.0; python_version >= '3.5' -nodeenv==1.8.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6' -packaging==23.2; python_version >= '3.1' -pathspec==0.11.2; python_version >= '3.7' -pbr==6.0.0; python_version >= '2.6' -pip==23.3.1; python_version >= '3.7' -platformdirs==3.11.0; python_version >= '3.7' -pluggy==1.3.0; python_version >= '3.1' -pre-commit==3.5.0; python_version >= '3.8' +identify==2.5.31 ; python_version >= '3.8' +idna==3.4 ; python_version >= '3.5' +imagesize==1.4.1 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' +importlib-metadata==6.8.0 ; python_version < '3.10' +iniconfig==2.0.0 ; python_version >= '3.7' +isort==5.12.0 +jinja2==3.1.2 ; python_version >= '3.7' +markdown-it-py==3.0.0 ; python_version >= '3.8' +markupsafe==2.1.3 ; python_version >= '3.7' +mccabe==0.7.0 ; python_version >= '3.6' +mdurl==0.1.2 ; python_version >= '3.7' +mypy==1.7.0 +mypy-extensions==1.0.0 ; python_version >= '3.5' +nodeenv==1.8.0 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6' +packaging==23.2 ; python_version >= '3.1' +pathspec==0.11.2 ; python_version >= '3.7' +pbr==6.0.0 ; python_version >= '2.6' +pip==23.3.1 +platformdirs==3.11.0 ; python_version >= '3.7' +pluggy==1.3.0 ; python_version >= '3.1' +pre-commit==3.5.0 pretend==1.0.9 -pycodestyle==2.11.1; python_version >= '3.8' -pyflakes==3.1.0; python_version >= '3.8' -pygments==2.16.1; python_version >= '3.7' -pyproject-api==1.6.1; python_version >= '3.8' -pyproject-hooks==1.0.0; python_version >= '3.7' -pytest==7.4.3; python_version >= '3.7' -pyyaml==6.0.1; python_version >= '3.6' -requests==2.31.0; python_version >= '3.7' -rich==13.6.0; python_full_version >= '3.7.0' -setuptools==68.2.2; python_version >= '3.8' -smmap==5.0.1; python_version >= '3.7' +pycodestyle==2.11.1 ; python_version >= '3.8' +pyflakes==3.1.0 ; python_version >= '3.8' +pygments==2.16.1 ; python_version >= '3.7' +pyproject-api==1.6.1 ; python_version >= '3.8' +pyproject-hooks==1.0.0 ; python_version >= '3.7' +pytest==7.4.3 +pytest-cov==4.1.0 +pytest-xdist==3.4.0 +pyyaml==6.0.1 ; python_version >= '3.6' +requests==2.31.0 +rich==13.6.0 +setuptools==68.2.2 ; python_version >= '3.8' +smmap==5.0.1 ; python_version >= '3.7' snowballstemmer==2.2.0 -sphinx==7.2.6; python_version >= '3.9' -sphinx-rtd-theme==1.3.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' -sphinxcontrib-applehelp==1.0.7; python_version >= '3.9' -sphinxcontrib-devhelp==1.0.5; python_version >= '3.9' -sphinxcontrib-htmlhelp==2.0.4; python_version >= '3.9' -sphinxcontrib-jquery==4.1; python_version >= '2.7' -sphinxcontrib-jsmath==1.0.1; python_version >= '3.5' +sphinx==7.2.6 +sphinx-rtd-theme==1.3.0 +sphinxcontrib-applehelp==1.0.7 +sphinxcontrib-devhelp==1.0.5 +sphinxcontrib-htmlhelp==2.0.4 +sphinxcontrib-jquery==4.1 ; python_version >= '2.7' +sphinxcontrib-jsmath==1.0.1 sphinxcontrib-plantuml==0.27 -sphinxcontrib-qthelp==1.0.6; python_version >= '3.9' -sphinxcontrib-serializinghtml==1.1.9; python_version >= '3.9' -stevedore==5.1.0; python_version >= '3.8' -tomli==2.0.1; python_version >= '3.1' -tox==4.11.3; python_version >= '3.8' -types-requests==2.31.0.10; python_version >= '3.7' -typing-extensions==4.8.0; python_version >= '3.8' -urllib3==2.1.0; python_version >= '3.8' -virtualenv==20.24.6; python_version >= '3.7' -auto-click-auto==0.1.1; python_version >= '3.7' and python_version < '4.0' -cffi==1.16.0; python_version >= '3.8' +sphinxcontrib-qthelp==1.0.6 +sphinxcontrib-serializinghtml==1.1.9 +stevedore==5.1.0 ; python_version >= '3.8' +tomli==2.0.1 ; python_version >= '3.1' +tox==4.11.3 +types-requests==2.31.0.10 +typing-extensions==4.8.0 ; python_version >= '3.8' +urllib3==2.1.0 ; python_version >= '3.8' +virtualenv==20.24.6 ; python_version >= '3.7' +zipp==3.17.0 ; python_version >= '3.8' +auto-click-auto==0.1.1 +cffi==1.16.0 ; python_version >= '3.8' cryptography==41.0.5 -dynaconf[yaml]==3.2.4; python_version >= '3.8' -greenlet==3.0.1; platform_machine == 'aarch64' or (platform_machine == 'ppc64le' or (platform_machine == 'x86_64' or (platform_machine == 'amd64' or (platform_machine == 'AMD64' or (platform_machine == 'win32' or platform_machine == 'WIN32'))))) -psycopg2==2.9.9; python_version >= '3.7' +dynaconf[yaml]==3.2.4 +greenlet==3.0.1 ; platform_machine == 'aarch64' or (platform_machine == 'ppc64le' or (platform_machine == 'x86_64' or (platform_machine == 'amd64' or (platform_machine == 'AMD64' or (platform_machine == 'win32' or platform_machine == 'WIN32'))))) +psycopg2==2.9.9 pycparser==2.21 -pynacl==1.5.0; python_version >= '3.6' -rich-click==1.7.1; python_version >= '3.7' +pynacl==1.5.0 +rich-click==1.7.1 ruamel.yaml==0.18.5 -ruamel.yaml.clib==0.2.8; python_version < '3.13' and platform_python_implementation == 'CPython' -securesystemslib[crypto]==0.28.0; python_version ~= '3.7' -sqlalchemy==2.0.23; python_version >= '3.7' -tuf==3.1.0; python_version >= '3.8' +ruamel.yaml.clib==0.2.8 ; python_version < '3.13' and platform_python_implementation == 'CPython' +securesystemslib[crypto]==0.28.0 +sqlalchemy==2.0.23 +tuf==3.1.0 diff --git a/requirements.txt b/requirements.txt index eff5e824..3b5058ba 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,27 +1,27 @@ -i https://pypi.org/simple -auto-click-auto==0.1.1; python_version >= '3.7' and python_version < '4.0' -certifi==2023.7.22; python_version >= '3.6' -cffi==1.16.0; python_version >= '3.8' -charset-normalizer==3.3.2; python_full_version >= '3.7.0' -click==8.1.7; python_version >= '3.7' +auto-click-auto==0.1.1 +certifi==2023.7.22 ; python_version >= '3.6' +cffi==1.16.0 ; python_version >= '3.8' +charset-normalizer==3.3.2 ; python_full_version >= '3.7.0' +click==8.1.7 cryptography==41.0.5 -dynaconf[yaml]==3.2.4; python_version >= '3.8' -greenlet==3.0.1; platform_machine == 'aarch64' or (platform_machine == 'ppc64le' or (platform_machine == 'x86_64' or (platform_machine == 'amd64' or (platform_machine == 'AMD64' or (platform_machine == 'win32' or platform_machine == 'WIN32'))))) -idna==3.4; python_version >= '3.5' -isort==5.12.0; python_full_version >= '3.8.0' -markdown-it-py==3.0.0; python_version >= '3.8' -mdurl==0.1.2; python_version >= '3.7' -psycopg2==2.9.9; python_version >= '3.7' +dynaconf[yaml]==3.2.4 +greenlet==3.0.1 ; platform_machine == 'aarch64' or (platform_machine == 'ppc64le' or (platform_machine == 'x86_64' or (platform_machine == 'amd64' or (platform_machine == 'AMD64' or (platform_machine == 'win32' or platform_machine == 'WIN32'))))) +idna==3.4 ; python_version >= '3.5' +isort==5.12.0 +markdown-it-py==3.0.0 ; python_version >= '3.8' +mdurl==0.1.2 ; python_version >= '3.7' +psycopg2==2.9.9 pycparser==2.21 -pygments==2.16.1; python_version >= '3.7' -pynacl==1.5.0; python_version >= '3.6' -requests==2.31.0; python_version >= '3.7' -rich==13.6.0; python_full_version >= '3.7.0' -rich-click==1.7.1; python_version >= '3.7' +pygments==2.16.1 ; python_version >= '3.7' +pynacl==1.5.0 +requests==2.31.0 +rich==13.6.0 +rich-click==1.7.1 ruamel.yaml==0.18.5 -ruamel.yaml.clib==0.2.8; python_version < '3.13' and platform_python_implementation == 'CPython' -securesystemslib[crypto]==0.28.0; python_version ~= '3.7' -sqlalchemy==2.0.23; python_version >= '3.7' -tuf==3.1.0; python_version >= '3.8' -typing-extensions==4.8.0; python_version >= '3.8' -urllib3==2.1.0; python_version >= '3.8' +ruamel.yaml.clib==0.2.8 ; python_version < '3.13' and platform_python_implementation == 'CPython' +securesystemslib[crypto]==0.28.0 +sqlalchemy==2.0.23 +tuf==3.1.0 +typing-extensions==4.8.0 ; python_version >= '3.8' +urllib3==2.1.0 ; python_version >= '3.8' diff --git a/tox.ini b/tox.ini index 484a72e0..f8a83e98 100644 --- a/tox.ini +++ b/tox.ini @@ -9,6 +9,8 @@ deps = -r{toxinidir}/requirements.txt [testenv:lint] deps = pre-commit +setenv = + BLACK_CACHE_DIR = ~/.cache/black/ commands = pre-commit run flake8 --all-files --show-diff-on-failure pre-commit run isort --all-files --show-diff-on-failure @@ -16,6 +18,8 @@ commands = pre-commit run bandit --all-files --show-diff-on-failure [testenv:typing] +setenv = + MYPY_CACHE_DIR = {toxinidir}/.mypy_cache commands = # Exclude tests for now as mocking and using pretend often leads to many # mypy warnings. @@ -24,9 +28,7 @@ commands = [testenv:test] allowlist_externals = coverage commands = - coverage run --omit='tests/*' -m pytest -vv tests/ - coverage xml -i - coverage report + python -m pytest --cov-report=xml --cov-report=term --cov -n auto -vv tests/ [testenv:requirements] description="Check if `make requirements` is up-to-date."