Skip to content

Commit

Permalink
Fix installing dependencies for tox (release-engineering#248)
Browse files Browse the repository at this point in the history
Also removes building docs from CI which is already handled by
readthedocs even on pull requests.
  • Loading branch information
hluk committed Apr 15, 2024
1 parent 445016c commit eeb1b5a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 81 deletions.
16 changes: 3 additions & 13 deletions .github/workflows/gating.yaml
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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)"
Expand Down
54 changes: 2 additions & 52 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions pyproject.toml
Expand Up @@ -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}
Expand All @@ -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",
Expand Down
31 changes: 17 additions & 14 deletions 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 \
Expand All @@ -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 \
Expand All @@ -39,7 +46,6 @@ commands =
{posargs}

[testenv:bandit]
skip_install = true
deps =
bandit
commands =
Expand All @@ -51,7 +57,6 @@ commands =
--recursive greenwave

[testenv:semgrep]
skip_install = true
deps =
semgrep
commands =
Expand All @@ -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=
Expand All @@ -81,7 +85,6 @@ commands =
python -m flake8 {posargs}

[testenv:mypy]
skip_install = true
deps =
mypy
commands =
Expand Down

0 comments on commit eeb1b5a

Please sign in to comment.