-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Bump dependencies * Migrate from flake8 to Ruff * Add support for Python 3.12
- Loading branch information
Showing
19 changed files
with
565 additions
and
864 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,44 @@ | ||
import nox_poetry | ||
import nox | ||
from nox_poetry import Session, session | ||
|
||
nox.options.sessions = ["test", "coverage", "lint"] | ||
|
||
@nox_poetry.session(python=["3.10", "3.11"]) | ||
def test(session: nox_poetry.Session): | ||
session.install(".", "pytest", "pytest-cov") | ||
session.env["COVERAGE_FILE"] = f".coverage.{session.python}" | ||
session.run("python", "-m", "pytest", "--cov", "serialite") | ||
|
||
@session(python=["3.10", "3.11", "3.12"]) | ||
def test(s: Session): | ||
s.install(".", "pytest", "pytest-cov") | ||
s.env["COVERAGE_FILE"] = f".coverage.{s.python}" | ||
s.run("python", "-m", "pytest", "--cov", "serialite") | ||
|
||
@nox_poetry.session(python=["3.10", "3.11"]) | ||
def test_fastapi(session: nox_poetry.Session): | ||
session.install(".[fastapi]", "pytest", "pytest-cov", "requests") | ||
session.env["COVERAGE_FILE"] = f".coverage.fastapi.{session.python}" | ||
session.run("python", "-m", "pytest", "--cov", "serialite", "tests/fastapi") | ||
|
||
@session(python=["3.10", "3.11", "3.12"]) | ||
def test_fastapi(s: Session): | ||
s.install(".[fastapi]", "pytest", "pytest-cov", "httpx") | ||
s.env["COVERAGE_FILE"] = f".coverage.fastapi.{s.python}" | ||
s.run("python", "-m", "pytest", "--cov", "serialite", "tests/fastapi") | ||
|
||
@nox_poetry.session(python=["3.10", "3.11"]) | ||
def test_numpy(session: nox_poetry.Session): | ||
session.install(".[numpy]", "pytest", "pytest-cov") | ||
session.env["COVERAGE_FILE"] = f".coverage.numpy.{session.python}" | ||
session.run("python", "-m", "pytest", "--cov", "serialite", "tests/test_numpy.py") | ||
|
||
@session(python=["3.10", "3.11", "3.12"]) | ||
def test_numpy(s: Session): | ||
s.install(".[numpy]", "pytest", "pytest-cov") | ||
s.env["COVERAGE_FILE"] = f".coverage.numpy.{s.python}" | ||
s.run("python", "-m", "pytest", "--cov", "serialite", "tests/test_numpy.py") | ||
|
||
@nox_poetry.session(venv_backend="none") | ||
def coverage(session: nox_poetry.Session): | ||
session.run("coverage", "combine") | ||
session.run("coverage", "html") | ||
session.run("coverage", "xml") | ||
|
||
@session(venv_backend="none") | ||
def coverage(s: Session): | ||
s.run("coverage", "combine") | ||
s.run("coverage", "html") | ||
s.run("coverage", "xml") | ||
|
||
@nox_poetry.session(venv_backend="none") | ||
def black(session: nox_poetry.Session): | ||
session.run("black", "--check", ".") | ||
|
||
@session(venv_backend="none") | ||
def fmt(s: Session) -> None: | ||
s.run("ruff", "check", ".", "--select", "I", "--fix") | ||
s.run("black", ".") | ||
|
||
@nox_poetry.session(venv_backend="none") | ||
def isort(session: nox_poetry.Session): | ||
session.run("isort", "--check", ".") | ||
|
||
|
||
@nox_poetry.session(venv_backend="none") | ||
def flake8(session: nox_poetry.Session): | ||
session.run("pflake8", "src", "tests") | ||
@session(venv_backend="none") | ||
def lint(s: Session) -> None: | ||
s.run("black", "--check", ".") | ||
s.run("ruff", "check", ".") |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
from ._boolean import BooleanSerializer # noqa: F401 | ||
from ._date_time import DateTimeSerializer # noqa: F401 | ||
from ._dictionary import OrderedDictSerializer, RawDictSerializer # noqa: F401 | ||
from ._float import FloatSerializer # noqa: F401 | ||
from ._integer import ( # noqa: F401 | ||
from ._boolean import BooleanSerializer | ||
from ._date_time import DateTimeSerializer | ||
from ._dictionary import OrderedDictSerializer, RawDictSerializer | ||
from ._float import FloatSerializer | ||
from ._integer import ( | ||
IntegerSerializer, | ||
NonnegativeIntegerSerializer, | ||
PositiveIntegerSerializer, | ||
) | ||
from ._json import JsonSerializer # noqa: F401 | ||
from ._list import ListSerializer # noqa: F401 | ||
from ._literal import LiteralSerializer # noqa: F401 | ||
from ._none import NoneSerializer # noqa: F401 | ||
from ._path import PathSerializer # noqa: F401 | ||
from ._reserved import ReservedSerializer # noqa: F401 | ||
from ._string import StringSerializer # noqa: F401 | ||
from ._tuple import TupleSerializer # noqa: F401 | ||
from ._union import OptionalSerializer, TryUnionSerializer # noqa: F401 | ||
from ._uuid import UuidSerializer # noqa: F401 | ||
from ._json import JsonSerializer | ||
from ._list import ListSerializer | ||
from ._literal import LiteralSerializer | ||
from ._none import NoneSerializer | ||
from ._path import PathSerializer | ||
from ._reserved import ReservedSerializer | ||
from ._string import StringSerializer | ||
from ._tuple import TupleSerializer | ||
from ._union import OptionalSerializer, TryUnionSerializer | ||
from ._uuid import UuidSerializer | ||
|
||
try: | ||
from ._array import ArraySerializer # noqa: F401 | ||
from ._array import ArraySerializer | ||
except ImportError: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import pytest | ||
|
||
try: | ||
import fastapi # noqa: F401 | ||
import fastapi | ||
except ImportError: | ||
pytest.skip("FastAPI not available", allow_module_level=True) |
Oops, something went wrong.