summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiora Milbaum <liora@lmb.co.il>2022-11-19 06:31:23 +0200
committerNejc Habjan <hab.nejc@gmail.com>2022-11-23 15:03:37 +0100
commit0ecf3bbe28c92fd26a7d132bf7f5ae9481cbad30 (patch)
tree7af22d4c6e2c841ace09a0c12149939ca3b461f6
parent1020ce965ff0cd3bfc283d4f0ad40e41e4d1bcee (diff)
downloadgitlab-0ecf3bbe28c92fd26a7d132bf7f5ae9481cbad30.tar.gz
chore: validate httpx package is not installed by default
-rw-r--r--.github/workflows/test.yml36
-rw-r--r--requirements-test.txt3
-rw-r--r--tests/install/test_install.py6
-rw-r--r--tox.ini6
4 files changed, 50 insertions, 1 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index b3b60ef..3cf4ed3 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -102,3 +102,39 @@ jobs:
files: ./coverage.xml
flags: unit
fail_ci_if_error: false
+
+ dist:
+ runs-on: ubuntu-latest
+ name: Python wheel
+ steps:
+ - uses: actions/checkout@v1
+ - uses: actions/setup-python@v2
+ with:
+ python-version: "3.11"
+ - name: Install dependencies
+ run: |
+ pip install -r requirements-test.txt
+ - name: Build package
+ run: python -m build -o dist/
+ - uses: actions/upload-artifact@v2
+ with:
+ name: dist
+ path: dist
+
+ test:
+ runs-on: ubuntu-latest
+ needs: [dist]
+ steps:
+ - uses: actions/checkout@v3
+ - name: Set up Python
+ uses: actions/setup-python@v4
+ with:
+ python-version: '3.11'
+ - uses: actions/download-artifact@v2
+ with:
+ name: dist
+ path: dist
+ - name: install dist/*.whl and requirements
+ run: pip install dist/*.whl -r requirements-test.txt tox
+ - name: Run tests
+ run: tox -e install
diff --git a/requirements-test.txt b/requirements-test.txt
index 1566d8d..bc68ef1 100644
--- a/requirements-test.txt
+++ b/requirements-test.txt
@@ -1,7 +1,8 @@
+build==0.9.0
coverage==6.5.0
-pytest==7.1.3
pytest-console-scripts==1.3.1
pytest-cov==4.0.0
pytest-github-actions-annotate-failures==0.1.7
+pytest==7.1.3
PyYaml==5.4.1
responses==0.21.0
diff --git a/tests/install/test_install.py b/tests/install/test_install.py
new file mode 100644
index 0000000..1538180
--- /dev/null
+++ b/tests/install/test_install.py
@@ -0,0 +1,6 @@
+import pytest
+
+
+def test_install() -> None:
+ with pytest.raises(ImportError):
+ import httpx # type: ignore # noqa
diff --git a/tox.ini b/tox.ini
index 314fc63..cc72acc 100644
--- a/tox.ini
+++ b/tox.ini
@@ -128,3 +128,9 @@ commands = pytest tests/smoke {posargs}
skip_install = true
deps = -r requirements-precommit.txt
commands = pre-commit run --all-files --show-diff-on-failure
+
+[testenv:install]
+skip_install = true
+deps = -r{toxinidir}/requirements.txt
+ -r{toxinidir}/requirements-test.txt
+commands = pytest tests/install