Skip to content

chore: validate httpx package is not installed by default #2382

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

Merged
merged 1 commit into from
Nov 23, 2022
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
36 changes: 36 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions tests/install/test_install.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import pytest


def test_install() -> None:
with pytest.raises(ImportError):
import httpx # type: ignore # noqa
6 changes: 6 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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