Skip to content

Commit 7e1e7d9

Browse files
author
Liora Milbaum
committed
chore: validate httpx package is not installed by default
1 parent 9d2b1ad commit 7e1e7d9

File tree

4 files changed

+66
-1
lines changed

4 files changed

+66
-1
lines changed

.github/workflows/install.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: "Install"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
dist:
13+
runs-on: ubuntu-latest
14+
name: Python wheel
15+
steps:
16+
- uses: actions/checkout@v1
17+
- uses: actions/setup-python@v2
18+
with:
19+
python-version: "3.10"
20+
- name: Install dependencies
21+
run: |
22+
pip install -r requirements-test.txt
23+
- name: Build package
24+
run: python -m build -o dist/
25+
- uses: actions/upload-artifact@v2
26+
with:
27+
name: dist
28+
path: dist
29+
30+
test:
31+
runs-on: ubuntu-latest
32+
needs: [dist]
33+
strategy:
34+
matrix:
35+
python-version: [ '3.7', '3.8', '3.9', '3.10' ]
36+
install-from: ["dist/*.whl"]
37+
steps:
38+
- uses: actions/checkout@v3
39+
- name: Set up Python ${{ matrix.python-version }}
40+
uses: actions/setup-python@v4
41+
with:
42+
python-version: ${{ matrix.python-version }}
43+
- uses: actions/download-artifact@v2
44+
with:
45+
name: dist
46+
path: dist
47+
- name: install ${{ matrix.install-from }} and requirements
48+
run: pip install ${{ matrix.install-from }} -r requirements-test.txt tox
49+
- name: Run tests
50+
env:
51+
TOXENV: ${{ matrix.python.toxenv }}
52+
run: tox -e install

requirements-test.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
build==0.9.0
12
coverage==6.5.0
2-
pytest==7.1.3
33
pytest-console-scripts==1.3.1
44
pytest-cov==4.0.0
55
pytest-github-actions-annotate-failures==0.1.7
6+
pytest==7.1.3
67
PyYaml==5.4.1
78
responses==0.21.0

tests/install/test_install.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import pytest
2+
3+
4+
def test_install() -> None:
5+
with pytest.raises(ImportError):
6+
import httpx # type: ignore # noqa

tox.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,9 @@ commands = pytest tests/smoke {posargs}
128128
skip_install = true
129129
deps = -r requirements-precommit.txt
130130
commands = pre-commit run --all-files --show-diff-on-failure
131+
132+
[testenv:install]
133+
skip_install = true
134+
deps = -r{toxinidir}/requirements.txt
135+
-r{toxinidir}/requirements-test.txt
136+
commands = pytest tests/install

0 commit comments

Comments
 (0)