Skip to content
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
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def bar(foo, cache=None):


# `inject.attr` creates properties (descriptors) which request dependencies on access.
class User(object):
class User:
cache = inject.attr(Cache)

def __init__(self, id):
Expand Down Expand Up @@ -233,16 +233,16 @@ def config(binder):
For example, only the `Config` class binding is present, other bindings are runtime:

```python
class Config(object):
class Config:
pass

class Cache(object):
class Cache:
config = inject.attr(Config)

class Db(object):
class Db:
config = inject.attr(Config)

class User(object):
class User:
cache = inject.attr(Cache)
db = inject.attr(Db)

Expand Down Expand Up @@ -272,7 +272,7 @@ import inject

inject.configure(lambda binder: \
binder.bind('host', 'localhost') \
binder.bind('port', 1234))
.bind('port', 1234))
```

## Why no scopes?
Expand All @@ -292,7 +292,7 @@ import inject
import threading

# Given a user class.
class User(object):
class User:
pass

# Create a thread-local current user storage.
Expand Down
19 changes: 1 addition & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,9 @@ profile = "black"


[tool.mypy]
check_untyped_defs = true
disallow_any_generics = true
disallow_incomplete_defs = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
ignore_missing_imports = true
no_implicit_optional = true
python_version = "3.10"
warn_redundant_casts = true
warn_return_any = true
warn_unused_configs = true
warn_unused_ignores = true
#strict = true # TODO(pyctrl): improve typings and enable strict mode
strict = true
exclude = ["tests", ".venv"]


Expand Down Expand Up @@ -147,11 +135,6 @@ extend-ignore = [
"ISC002",
"N818", # Exception name should be named with an Error suffix
"TRY003",
"UP006",
"UP007",
"UP035",
"UP045",
"FA100",
]

[tool.ruff.lint.extend-per-file-ignores]
Expand Down
Loading
Loading