Skip to content

Commit

Permalink
Merge branch 'master' into feature/dependabot
Browse files Browse the repository at this point in the history
  • Loading branch information
lundberg authored Dec 19, 2024
2 parents a02a958 + 179deb9 commit 32c9bb1
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 27 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/check-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
name: Check Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- run: pip install nox
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
name: Build & Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- run: pip install nox
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,35 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: pip install nox
- name: Test
run: nox -N -s test-${{ matrix.python-version }} -- -v
- name: Upload coverage report
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4.5.0
with:
name: Python ${{ matrix.python-version }}
files: ./coverage.xml
fail_ci_if_error: true
slug: lundberg/respx
token: ${{ secrets.CODECOV_TOKEN }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

check-types:
name: Check Typing
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.7"
python-version: "3.8"
- run: pip install nox
- name: Run mypy
run: nox -N -s mypy
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ Install with pip:
$ pip install respx
```

Requires Python 3.7+ and HTTPX 0.21+. See
Requires Python 3.8+ and HTTPX 0.25+. See
[Changelog](https://github.com/lundberg/respx/blob/master/CHANGELOG.md) for older HTTPX
compatibility.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@ Install with pip:
$ pip install respx
```

Requires Python 3.7+ and HTTPX 0.21+.
Requires Python 3.8+ and HTTPX 0.25+.
See [Changelog](https://github.com/lundberg/respx/blob/master/CHANGELOG.md) for older HTTPX compatibility.
4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@
pkgsUnstable = nixpkgsUnstable.legacyPackages.${system};
in {
packages = flakeUtils.lib.flattenTree {
python313 = pkgs.python313;
python312 = pkgs.python312;
python311 = pkgs.python311;
python310 = pkgs.python310;
python39 = pkgs.python39;
python38 = pkgs22.python38;
python37 = pkgs22.python37;
go-task = pkgsUnstable.go-task;
};
devShell = pkgs.mkShell {
buildInputs = with self.packages.${system}; [
python313
python312
python311
python310
python39
python38
python37
go-task
];
shellHook = ''
Expand Down
4 changes: 2 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
nox.options.keywords = "test + mypy"


@nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"])
@nox.session(python=["3.8", "3.9", "3.10", "3.11", "3.12"])
def test(session):
deps = ["pytest", "pytest-asyncio", "pytest-cov", "trio", "starlette", "flask"]
session.install("--upgrade", *deps)
Expand All @@ -17,7 +17,7 @@ def test(session):
session.run("pytest", *session.posargs)


@nox.session(python="3.7")
@nox.session(python="3.8")
def mypy(session):
session.install("--upgrade", "mypy")
session.install("-e", ".")
Expand Down
3 changes: 2 additions & 1 deletion respx/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,8 @@ def _resolve_side_effect(
raise SideEffectError(self, origin=effect)

# Handle Exception `type` side effect
elif isinstance(effect, type) and issubclass(effect, Exception):
elif isinstance(effect, type):
assert issubclass(effect, Exception)
raise SideEffectError(
self,
origin=(
Expand Down
6 changes: 1 addition & 5 deletions respx/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Any,
Dict,
List,
Literal,
NamedTuple,
Optional,
Tuple,
Expand All @@ -15,11 +16,6 @@
)
from urllib.parse import parse_qsl

try:
from typing import Literal # type: ignore[attr-defined]
except ImportError: # pragma: no cover
from typing_extensions import Literal

import httpx


Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ skip_covered = True
show_missing = True

[mypy]
python_version = 3.7
python_version = 3.8
files = respx,tests
pretty = True

Expand Down
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand All @@ -40,6 +39,6 @@
entry_points={"pytest11": ["respx = respx.plugin"]},
include_package_data=True,
zip_safe=False,
python_requires=">=3.7",
install_requires=["httpx>=0.21.0"],
python_requires=">=3.8",
install_requires=["httpx>=0.25.0,<0.28.0"],
)

0 comments on commit 32c9bb1

Please sign in to comment.