Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix installing dependencies for tox #248

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions .github/workflows/gating.yaml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Loading