diff --git a/.github/workflows/gating.yaml b/.github/workflows/gating.yaml index 650f8b5..8cbf8b3 100644 --- a/.github/workflows/gating.yaml +++ b/.github/workflows/gating.yaml @@ -21,12 +21,10 @@ jobs: python-version: "3.11" - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install poetry tox + run: python -m pip install tox - name: Test with tox - run: tox -e py + run: python -m tox -e py3 - name: Run coveralls-python env: @@ -39,14 +37,6 @@ jobs: pip3 install --upgrade coveralls==3.2.0 coveralls --service=github - - name: Set up Python for documentation build - uses: actions/setup-python@v4 - with: - python-version: "3.11" - - - name: Test building documentation with tox - run: tox -e docs - coveralls-finish: name: Finish coveralls-python needs: tests @@ -128,7 +118,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install poetry tox tox-gh-actions podman-compose + pip install poetry podman-compose tox - name: Update the Application Version run: poetry version "$(./get-version.sh)" diff --git a/poetry.lock b/poetry.lock index d86f957..48cdd57 100644 --- a/poetry.lock +++ b/poetry.lock @@ -538,22 +538,6 @@ service-identity = ">=21.1.0" tomli = ">=2.0.1,<3.0.0" twisted = ">=22.4.0" -[[package]] -name = "flake8" -version = "5.0.4" -description = "the modular source code checker: pep8 pyflakes and co" -optional = true -python-versions = ">=3.6.1" -files = [ - {file = "flake8-5.0.4-py2.py3-none-any.whl", hash = "sha256:7a1cf6b73744f5806ab95e526f6f0d8c01c66d7bbe349562d22dfca20610b248"}, - {file = "flake8-5.0.4.tar.gz", hash = "sha256:6fbe320aad8d6b95cec8b8e47bc933004678dc63095be98528b7bdd2a9f510db"}, -] - -[package.dependencies] -mccabe = ">=0.7.0,<0.8.0" -pycodestyle = ">=2.9.0,<2.10.0" -pyflakes = ">=2.5.0,<2.6.0" - [[package]] name = "flask" version = "3.0.2" @@ -919,17 +903,6 @@ files = [ {file = "MarkupSafe-2.1.5.tar.gz", hash = "sha256:d283d37a890ba4c1ae73ffadf8046435c76e7bc2247bbb63c00bd1a709c6544b"}, ] -[[package]] -name = "mccabe" -version = "0.7.0" -description = "McCabe checker, plugin for flake8" -optional = true -python-versions = ">=3.6" -files = [ - {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, - {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, -] - [[package]] name = "mock" version = "5.1.0" @@ -1313,17 +1286,6 @@ files = [ [package.dependencies] pyasn1 = ">=0.4.6,<0.7.0" -[[package]] -name = "pycodestyle" -version = "2.9.1" -description = "Python style guide checker" -optional = true -python-versions = ">=3.6" -files = [ - {file = "pycodestyle-2.9.1-py2.py3-none-any.whl", hash = "sha256:d1735fc58b418fd7c5f658d28d943854f8a849b01a5d0a1e6f3f3fdd0166804b"}, - {file = "pycodestyle-2.9.1.tar.gz", hash = "sha256:2c9607871d58c76354b697b42f5d57e1ada7d261c261efac224b664affdc5785"}, -] - [[package]] name = "pycparser" version = "2.22" @@ -1335,17 +1297,6 @@ files = [ {file = "pycparser-2.22.tar.gz", hash = "sha256:491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6"}, ] -[[package]] -name = "pyflakes" -version = "2.5.0" -description = "passive checker of Python programs" -optional = true -python-versions = ">=3.6" -files = [ - {file = "pyflakes-2.5.0-py2.py3-none-any.whl", hash = "sha256:4579f67d887f804e67edb544428f264b7b24f435b263c4614f384135cea553d2"}, - {file = "pyflakes-2.5.0.tar.gz", hash = "sha256:491feb020dca48ccc562a8c0cbe8df07ee13078df59813b83959cbdada312ea3"}, -] - [[package]] name = "pygments" version = "2.17.2" @@ -1480,7 +1431,6 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, - {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, @@ -2290,9 +2240,9 @@ testing = ["coverage (>=5.0.3)", "zope.event", "zope.testing"] [extras] docs = ["sphinx", "sphinxcontrib-httpdomain"] functional-test = ["SQLAlchemy", "psycopg2-binary"] -test = ["flake8", "mock", "pytest", "pytest-cov"] +test = ["mock", "pytest", "pytest-cov", "requests-mock"] [metadata] lock-version = "2.0" python-versions = ">=3.8,<3.13" -content-hash = "528f2a267081a4d6099bd427781651d4792cef070825ffeec0a7fc0a80a55b2e" +content-hash = "69a9fb1197e8d0819d4b1a8c7d84878ab5dcf5f587b381661a3d71640a6e1317" diff --git a/pyproject.toml b/pyproject.toml index 597fa30..81bc3d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,7 +34,6 @@ fedora-messaging = "^3.4.1" # latest versions of stomp.py 8.0.0 and 8.0.1 are causing connection issues "stomp.py" = "^8.1.0" -flake8 = {version = "^5.0.4", optional = true} pytest = {version = "^8.0.2", optional = true} pytest-cov = {version = "^5.0.0", optional = true} mock = {version = "^5.1.0", optional = true} @@ -57,10 +56,10 @@ opentelemetry-exporter-otlp-proto-http = "^1.24.0" [tool.poetry.extras] test = [ - "flake8", "pytest", "pytest-cov", "mock", + "requests-mock", ] functional-test = [ "SQLAlchemy", diff --git a/tox.ini b/tox.ini index b737f5f..eb33af7 100644 --- a/tox.ini +++ b/tox.ini @@ -1,12 +1,18 @@ [tox] envlist = bandit,lint,mypy,semgrep,py3,docs -isolated_build = True +requires = + poetry [testenv] -extras = - test +allowlist_externals = poetry +skip_install = true +no_package = true setenv = GREENWAVE_CONFIG={toxinidir}/conf/settings.py.example + +[testenv:py3] +commands_pre = + poetry install --only=main --extras=test commands = pytest \ --cov-reset \ @@ -19,14 +25,15 @@ commands = {posargs} [testenv:functional] -extras = - test - functional-test +commands_pre = + poetry install --only=main --extras=test --extras=functional-test setenv = GREENWAVE_TEST_URL=http://localhost:8080/ WAIVERDB_TEST_URL=http://localhost:5004/ RESULTSDB_TEST_URL=http://localhost:5001/ -allowlist_externals = docker/healthcheck.sh +allowlist_externals = + poetry + docker/healthcheck.sh commands = docker/healthcheck.sh pytest \ @@ -39,7 +46,6 @@ commands = {posargs} [testenv:bandit] -skip_install = true deps = bandit commands = @@ -51,7 +57,6 @@ commands = --recursive greenwave [testenv:semgrep] -skip_install = true deps = semgrep commands = @@ -61,12 +66,11 @@ commands = {posargs} [testenv:docs] -# Same Python version as in .readthedocs.yaml -basepython = python3.11 changedir = docs -extras = - docs +commands_pre = + poetry install --only=main --extras=docs allowlist_externals = + poetry mkdir rm commands= @@ -81,7 +85,6 @@ commands = python -m flake8 {posargs} [testenv:mypy] -skip_install = true deps = mypy commands =