Skip to content

Commit

Permalink
Fix installing dependencies for tox
Browse files Browse the repository at this point in the history
  • Loading branch information
hluk committed Apr 15, 2024
1 parent 65c98d8 commit 9194839
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 68 deletions.
26 changes: 16 additions & 10 deletions .github/workflows/gating.yaml
Expand Up @@ -23,18 +23,24 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install system dependencies
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
retry_wait_seconds: 30
max_attempts: 3
command: >-
sudo apt-get update
&& sudo apt-get install
libkrb5-dev
libldap2-dev
libsasl2-dev
- name: Install dependencies
run: |
sudo apt-get -y update
sudo apt-get -y install libkrb5-dev libldap2-dev libsasl2-dev
python -m pip install --upgrade pip
pip install tox
run: python -m pip install tox

- name: Test with tox
run: tox -e py

- name: Test with mypy
run: tox -e mypy
run: python -m tox -e py3

- name: Run coveralls-python
env:
Expand Down Expand Up @@ -99,7 +105,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry tox
pip install poetry
- name: Update the Application Version
run: poetry version "$(./get-version.sh)"
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Expand Up @@ -17,7 +17,7 @@ RUN set -exo pipefail \
# install runtime dependencies
&& yum install -y \
--installroot=/mnt/rootfs \
--releasever=39 \
--releasever=/ \
--setopt install_weak_deps=false \
--nodocs \
--disablerepo=* \
Expand Down
53 changes: 2 additions & 51 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 @@ -24,7 +24,6 @@ fastapi = "^0.110.0"
gunicorn = "^21.2.0"
python-dateutil = "^2.8.2"

flake8 = {version = "^7.0.0", optional = true}
factory-boy = {version = "^3.3.0", optional = true}
pytest = {version = "^8.0.0", optional = true}
pytest-cov = {version = "^5.0.0", optional = true}
Expand All @@ -46,7 +45,7 @@ opentelemetry-instrumentation-sqlalchemy = "^0.43b0"

[tool.poetry.extras]
test = [
"flake8",
"factory-boy",
"pytest",
"pytest-cov",
# required by fastapi.testclient
Expand Down
13 changes: 9 additions & 4 deletions tox.ini
@@ -1,12 +1,18 @@
[tox]
envlist = py3,mypy
isolated_build = True
requires =
poetry

[testenv]
allowlist_externals = poetry
skip_install = true
no_package = true

[testenv:py3]
# Set RPM_PY_VERBOSE to "true" to debug koji package installation failures
passenv = RPM_PY_VERBOSE
extras =
test
commands_pre =
poetry install --only=main --extras=test
commands =
pytest \
--cov-reset \
Expand All @@ -17,7 +23,6 @@ commands =
{posargs}

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

0 comments on commit 9194839

Please sign in to comment.