Skip to content

Commit

Permalink
Complain non-existent attributes (#40)
Browse files Browse the repository at this point in the history
* add bakery stub file

* increase patch version

* update pylint, mypy, isort

* update action's versions: node16 is deprecated
  • Loading branch information
Mityuha authored May 14, 2024
1 parent bd68e78 commit c58d3fe
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 62 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"

- name: Install poetry and dependencies
run: |
Expand Down
19 changes: 19 additions & 0 deletions bakery/bakery.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# isort: skip_file
from typing import Any, Dict, Type, TypeVar

from .stuff import Cakeable

T = TypeVar('T', bound='Bakery')

class Bakery:
__bakery_visitors__: int
__bakery_items__: Dict[str, Cakeable[Any]]
async def __aenter__(self: T) -> T: ...
async def __aexit__(self, *_args: Any) -> None: ...
@classmethod
async def aopen(cls: Type[T]) -> T: ...
@classmethod
async def aclose(
cls,
*_args: Any,
) -> None: ...
99 changes: 50 additions & 49 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ known_local_folder = []
multi_line_output = 3
lines_after_imports = 2
include_trailing_comma = true
use_parentheses= true
use_parentheses = true
profile = "black"


[tool.poetry]
name = "fresh-bakery"
version = "0.3.4"
version = "0.3.5"
description = "Bake your dependencies stupidly simple!"
readme = "README.md"
license = "MIT"
Expand Down Expand Up @@ -89,14 +90,14 @@ pydocstringformatter = [
]
isort = "*"
mypy = [
{version = "^1.5.1", python = ">=3.8"},
{version = "^1.10.0", python = ">=3.8"},
{version = ">1.0", python = "~3.7"},
{version = "0.971", python = "~3.6.2"}
]
pre-commit = "*"
pylint = [
{version = "2.13.9", python = ">= 3.6.2, < 3.8"},
{version = "^3.0.1", python = ">= 3.8"},
{version = "^3.1.0", python = ">= 3.8"},
]
pytest = "*"
pytest-cov = "*"
Expand Down Expand Up @@ -163,7 +164,7 @@ deps =
black==22.8.0
isort==5.10.1
py{36,37}: pylint==2.13.9
py{38,39,310,311,312}: pylint==3.0.1
py{38,39,310,311,312}: pylint==3.1.0
pytest==7.0.1
pytest-mock==3.6.1
Expand All @@ -173,7 +174,7 @@ deps =
py36: mypy==0.971
py37: mypy==1.4.1
py{38,39,310,311,312}: mypy==1.8.0
py{38,39,310,311,312}: mypy==1.10.0
commands =
black --check bakery/ tests/
isort --check bakery tests/
Expand Down
3 changes: 1 addition & 2 deletions tests/test_bakery.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,7 @@ class MyBakery(Bakery):

def gen() -> Iterator:
"""Just stub."""
for i in range(3):
yield i
yield from range(3)


async def async_gen() -> AsyncIterator:
Expand Down

0 comments on commit c58d3fe

Please sign in to comment.