Skip to content

Commit

Permalink
rm walrus
Browse files Browse the repository at this point in the history
  • Loading branch information
maldoinc committed Sep 11, 2023
1 parent efcb239 commit 1e6d2f2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/run_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
Expand All @@ -22,11 +22,13 @@ jobs:
pip install poetry
poetry install
- name: Lint
if: matrix.python-version == '3.11'
run: |
poetry run ruff --format=github wireup
- name: Check formatting
if: matrix.python-version == '3.11'
run: |
poetry run black --check .
- name: Run tests
run: |
python -m unittest discover -s test/
python -m unittest discover -s test/
8 changes: 5 additions & 3 deletions wireup/ioc/dependency_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ def __callable_get_params_to_inject(self, fn: Callable[..., Any], klass: type[__

values_from_parameters = {}
for name, parameter in inspect.signature(fn).parameters.items():
if obj := self.__get_container_dependency_or_param(parameter):
obj = self.__get_container_dependency_or_param(parameter)
if obj:
values_from_parameters[name] = obj

args = {**params_from_context, **values_from_parameters}
Expand All @@ -217,8 +218,9 @@ def __get(self, klass: type[__T], qualifier: ContainerProxyQualifierValue) -> __

self.__assert_dependency_exists(klass, qualifier)
class_to_initialize = klass
if klass in self.__known_interfaces: # noqa: SIM102
if concrete_class := self.__get_concrete_class_from_interface_and_qualifier(klass, qualifier):
if self.__is_interface_known(klass):
concrete_class = self.__get_concrete_class_from_interface_and_qualifier(klass, qualifier)
if concrete_class:
class_to_initialize = concrete_class

if self.__is_impl_known_from_factory(class_to_initialize):
Expand Down

0 comments on commit 1e6d2f2

Please sign in to comment.