Skip to content

Commit

Permalink
chore: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Lancetnik committed Jan 6, 2024
1 parent 120cd34 commit f43adae
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.7"
python-version: "3.8"
cache: "pip"
cache-dependency-path: pyproject.toml

Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,23 @@ If you are using **hatch** use following environments to run tests:

##### **TEST**

Run tests at all python 3.7-3.11 versions.
Run tests at all python 3.8-3.12 versions.

All python versions should be avalilable at your system.

```bash
# Run test at all python 3.7-3.11 versions
# Run test at all python 3.8-3.12 versions
hatch run test:run
```

##### **TEST-LAST**

Run tests at python 3.11 version.
Run tests at python 3.12 version.

```bash
# Run tests at python 3.11
# Run tests at python 3.12
hatch run test-last:run

# Run all tests at python 3.11 and show coverage
# Run all tests at python 3.12 and show coverage
hatch run test-last:cov
```
10 changes: 5 additions & 5 deletions docs/docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,23 @@ If you are using **hatch** use following environments to run tests:

##### **TEST**

Run tests at all python 3.7-3.11 versions.
Run tests at all python 3.8-3.12 versions.

All python versions should be avalilable at your system.

```bash
# Run test at all python 3.7-3.11 versions
# Run test at all python 3.8-3.12 versions
hatch run test:run
```

##### **TEST-LAST**

Run tests at python 3.11 version.
Run tests at python 3.12 version.

```bash
# Run tests at python 3.11
# Run tests at python 3.12
hatch run test-last:run

# Run all tests at python 3.11 and show coverage
# Run all tests at python 3.12 and show coverage
hatch run test-last:cov
```
2 changes: 2 additions & 0 deletions fast_depends/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def get_model_fields(model: Type[BaseModel]) -> Dict[str, FieldInfo]:

class CreateBaseModel(BaseModel):
"""Just to support FastStream < 0.3.7."""

model_config = ConfigDict(arbitrary_types_allowed=True)

else:
Expand All @@ -51,5 +52,6 @@ def get_model_fields(model: Type[BaseModel]) -> Dict[str, FieldInfo]:

class CreateBaseModel(BaseModel): # type: ignore[no-redef]
"""Just to support FastStream < 0.3.7."""

class Config:
arbitrary_types_allowed = True
37 changes: 18 additions & 19 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ authors = [

keywords = ["fastapi", "dependency injection"]

requires-python = ">=3.7"
requires-python = ">=3.8"

classifiers = [
"Development Status :: 5 - Production/Stable",
Expand Down Expand Up @@ -48,7 +48,7 @@ dependencies = [
[project.optional-dependencies]
test = [
"coverage[toml]>=7.2.0,<8.0.0",
"pytest==7.4.3",
"pytest>=7.4.0,<8",
]

doc = [
Expand All @@ -62,11 +62,8 @@ dev = [
"fast-depends[test]",
"fast-depends[doc]",

"mypy==1.7.1",
"isort==5.13.2",
"black==23.12.0",
"ruff==0.1.8",
"pyupgrade-directories==0.3.0",
"mypy>=1.8.0",
"ruff==0.1.9",
]

[project.urls]
Expand All @@ -90,7 +87,7 @@ exclude = [
]

[tool.hatch.envs.default]
python = "3.11"
python = "3.12"
skip-install = false
features = [
"dev",
Expand All @@ -105,10 +102,10 @@ features = [
run = "pytest -q"

[[tool.hatch.envs.test.matrix]]
python = ["37", "38", "39", "310", "311"]
python = ["38", "39", "310", "311", "312"]

[tool.hatch.envs.test-last]
python = "3.11"
python = "3.12"
features = [
"test",
]
Expand All @@ -127,13 +124,16 @@ known_third_party = ["pydantic", "anyio"]

[tool.ruff]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"C", # flake8-comprehensions
"B", # flake8-bugbear
"T20", # flake8-print
"E", # pycodestyle errors https://docs.astral.sh/ruff/rules/#error-e
"W", # pycodestyle warnings https://docs.astral.sh/ruff/rules/#warning-w
"I", # isort https://docs.astral.sh/ruff/rules/#isort-i
"F", # pyflakes https://docs.astral.sh/ruff/rules/#pyflakes-f
"C4", # flake8-comprehensions https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4
"B", # flake8-bugbear https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
"Q", # flake8-quotes https://docs.astral.sh/ruff/rules/#flake8-quotes-q
"T20", # flake8-print https://docs.astral.sh/ruff/rules/#flake8-print-t20
"PERF", # Perflint https://docs.astral.sh/ruff/rules/#perflint-perf
"UP", # pyupgrade https://docs.astral.sh/ruff/rules/#pyupgrade-up
]
ignore = [
"E501", # line too long, handled by black
Expand Down Expand Up @@ -173,8 +173,7 @@ omit = [
[tool.coverage.report]
show_missing = true
skip_empty = true
exclude_lines = [
".*# pragma: no cover",
exclude_also = [
"if __name__ == .__main__.:",
"self.logger",
"def __repr__",
Expand Down
9 changes: 6 additions & 3 deletions scripts/lint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
pyup_dirs --py37-plus --recursive propan tests
echo "Running mypy..."
mypy fast_depends

echo "Running ruff linter (isort, flake, pyupgrade, etc. replacement)..."
ruff fast_depends tests --fix
black fast_depends tests
isort fast_depends tests

echo "Running ruff formatter (black replacement)..."
ruff format tests
2 changes: 1 addition & 1 deletion tests/async/test_depends.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ async def dep(a):
return a

@inject
async def func(a=Depends(partial(dep, 10))):
async def func(a=Depends(partial(dep, 10))): # noqa D008
return a

assert await func() == 10
2 changes: 1 addition & 1 deletion tests/sync/test_depends.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def dep(a):
return a

@inject
def func(a=Depends(partial(dep, 10))):
def func(a=Depends(partial(dep, 10))): # noqa D008
return a

assert func() == 10

0 comments on commit f43adae

Please sign in to comment.