Skip to content

Commit b043f43

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

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

.github/workflows/install.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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
49+
- name: pytest
50+
run: pytest tests/install

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

0 commit comments

Comments
 (0)