Skip to content

Commit

Permalink
Merge pull request #6 from scipp/child-containers
Browse files Browse the repository at this point in the history
Support injecting via generics
  • Loading branch information
SimonHeybrock authored Jul 13, 2023
2 parents 1d5a1bd + 0363c3a commit a9380f1
Show file tree
Hide file tree
Showing 14 changed files with 708 additions and 145 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ classifiers = [
requires-python = ">=3.8"
dependencies = [
"dask",
"injector",
]
dynamic = ["version"]

Expand Down
1 change: 0 additions & 1 deletion requirements/base.in
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
dask
injector
14 changes: 5 additions & 9 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
# SHA1:436d53b37d30cc5f2a62b6ed730bcf46f1762d7b
# SHA1:b153fb0209b1ab0c52d1b98a28b498e4dc303498
#
# This file is autogenerated by pip-compile-multi
# To update, run:
#
# pip-compile-multi
#
click==8.1.3
click==8.1.4
# via dask
cloudpickle==2.2.1
# via dask
dask==2023.5.0
# via -r base.in
fsspec==2023.5.0
fsspec==2023.6.0
# via dask
importlib-metadata==6.6.0
importlib-metadata==6.8.0
# via dask
injector==0.20.1
# via -r base.in
locket==1.0.0
# via partd
packaging==23.1
Expand All @@ -29,7 +27,5 @@ toolz==0.12.0
# via
# dask
# partd
typing-extensions==4.6.3
# via injector
zipp==3.15.0
zipp==3.16.0
# via importlib-metadata
16 changes: 8 additions & 8 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ certifi==2023.5.7
# via requests
chardet==5.1.0
# via tox
charset-normalizer==3.1.0
charset-normalizer==3.2.0
# via requests
colorama==0.4.6
# via tox
distlib==0.3.6
# via virtualenv
filelock==3.12.0
filelock==3.12.2
# via
# tox
# virtualenv
gitdb==4.0.10
# via gitpython
gitpython==3.1.31
gitpython==3.1.32
# via -r ci.in
idna==3.4
# via requests
Expand All @@ -32,13 +32,13 @@ packaging==23.1
# -r ci.in
# pyproject-api
# tox
platformdirs==3.5.1
platformdirs==3.8.1
# via
# tox
# virtualenv
pluggy==1.0.0
pluggy==1.2.0
# via tox
pyproject-api==1.5.1
pyproject-api==1.5.3
# via tox
requests==2.31.0
# via -r ci.in
Expand All @@ -48,9 +48,9 @@ tomli==2.0.1
# via
# pyproject-api
# tox
tox==4.6.0
tox==4.6.4
# via -r ci.in
urllib3==2.0.3
# via requests
virtualenv==20.23.0
virtualenv==20.23.1
# via tox
59 changes: 38 additions & 21 deletions requirements/docs.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SHA1:58bb49d5210e2885ee4c5c48167d217012b5b723
# SHA1:c8d387b90560a2db42c26e33735a4f78ada867c3
#
# This file is autogenerated by pip-compile-multi
# To update, run:
Expand All @@ -13,8 +13,10 @@ alabaster==0.7.13
asttokens==2.2.1
# via stack-data
attrs==23.1.0
# via jsonschema
autodoc-pydantic==1.8.0
# via
# jsonschema
# referencing
autodoc-pydantic==1.9.0
# via -r docs.in
babel==2.12.1
# via
Expand All @@ -30,7 +32,7 @@ bleach==6.0.0
# via nbconvert
certifi==2023.5.7
# via requests
charset-normalizer==3.1.0
charset-normalizer==3.2.0
# via requests
comm==0.1.3
# via ipykernel
Expand All @@ -54,9 +56,11 @@ idna==3.4
# via requests
imagesize==1.4.1
# via sphinx
importlib-resources==5.12.0
# via jsonschema
ipykernel==6.23.1
importlib-resources==6.0.0
# via
# jsonschema
# jsonschema-specifications
ipykernel==6.24.0
# via -r docs.in
ipython==8.12.2
# via
Expand All @@ -70,13 +74,15 @@ jinja2==3.1.2
# nbconvert
# nbsphinx
# sphinx
jsonschema==4.17.3
jsonschema==4.18.0
# via nbformat
jupyter-client==8.2.0
jsonschema-specifications==2023.6.1
# via jsonschema
jupyter-client==8.3.0
# via
# ipykernel
# nbclient
jupyter-core==5.3.0
jupyter-core==5.3.1
# via
# ipykernel
# jupyter-client
Expand All @@ -85,7 +91,7 @@ jupyter-core==5.3.0
# nbformat
jupyterlab-pygments==0.2.2
# via nbconvert
markdown-it-py==2.2.0
markdown-it-py==3.0.0
# via
# mdit-py-plugins
# myst-parser
Expand All @@ -97,19 +103,19 @@ matplotlib-inline==0.1.6
# via
# ipykernel
# ipython
mdit-py-plugins==0.3.5
mdit-py-plugins==0.4.0
# via myst-parser
mdurl==0.1.2
# via markdown-it-py
mistune==2.0.5
mistune==3.0.1
# via nbconvert
myst-parser==1.0.0
myst-parser==2.0.0
# via -r docs.in
nbclient==0.8.0
# via nbconvert
nbconvert==7.4.0
nbconvert==7.6.0
# via nbsphinx
nbformat==5.9.0
nbformat==5.9.1
# via
# nbclient
# nbconvert
Expand All @@ -128,17 +134,17 @@ pickleshare==0.7.5
# via ipython
pkgutil-resolve-name==1.3.10
# via jsonschema
platformdirs==3.5.1
platformdirs==3.8.1
# via jupyter-core
prompt-toolkit==3.0.38
prompt-toolkit==3.0.39
# via ipython
psutil==5.9.5
# via ipykernel
ptyprocess==0.7.0
# via pexpect
pure-eval==0.2.2
# via stack-data
pydantic==1.10.9
pydantic==1.10.11
# via autodoc-pydantic
pydata-sphinx-theme==0.13.3
# via -r docs.in
Expand All @@ -149,8 +155,6 @@ pygments==2.15.1
# nbconvert
# pydata-sphinx-theme
# sphinx
pyrsistent==0.19.3
# via jsonschema
python-dateutil==2.8.2
# via jupyter-client
pytz==2023.3
Expand All @@ -159,8 +163,16 @@ pyzmq==25.1.0
# via
# ipykernel
# jupyter-client
referencing==0.29.1
# via
# jsonschema
# jsonschema-specifications
requests==2.31.0
# via sphinx
rpds-py==0.8.10
# via
# jsonschema
# referencing
six==1.16.0
# via
# asttokens
Expand Down Expand Up @@ -218,6 +230,11 @@ traitlets==5.9.0
# nbconvert
# nbformat
# nbsphinx
typing-extensions==4.7.1
# via
# ipython
# pydantic
# pydata-sphinx-theme
urllib3==2.0.3
# via requests
wcwidth==0.2.6
Expand Down
8 changes: 4 additions & 4 deletions requirements/static.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ cfgv==3.3.1
# via pre-commit
distlib==0.3.6
# via virtualenv
filelock==3.12.0
filelock==3.12.2
# via virtualenv
identify==2.5.24
# via pre-commit
nodeenv==1.8.0
# via pre-commit
platformdirs==3.5.1
platformdirs==3.8.1
# via virtualenv
pre-commit==3.3.2
pre-commit==3.3.3
# via -r static.in
pyyaml==6.0
# via pre-commit
virtualenv==20.23.0
virtualenv==20.23.1
# via pre-commit

# The following packages are considered to be unsafe in a requirements file:
Expand Down
1 change: 1 addition & 0 deletions requirements/test.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
-r base.in
numpy
pytest
10 changes: 6 additions & 4 deletions requirements/test.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# SHA1:a035a60fcbac4cd7bf595dbd81ee7994505d4a95
# SHA1:3720d9b18830e4fcedb827ec36f6808035c1ea2c
#
# This file is autogenerated by pip-compile-multi
# To update, run:
#
# pip-compile-multi
#
-r base.txt
exceptiongroup==1.1.1
exceptiongroup==1.1.2
# via pytest
iniconfig==2.0.0
# via pytest
pluggy==1.0.0
numpy==1.24.4
# via -r test.in
pluggy==1.2.0
# via pytest
pytest==7.3.1
pytest==7.4.0
# via -r test.in
tomli==2.0.1
# via pytest
16 changes: 15 additions & 1 deletion src/sciline/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,18 @@
except importlib.metadata.PackageNotFoundError:
__version__ = "0.0.0"

from .container import Container, UnsatisfiedRequirement, make_container
from .container import (
AmbiguousProvider,
Container,
UnboundTypeVar,
UnsatisfiedRequirement,
)
from .domain import Scope

__all__ = [
"AmbiguousProvider",
"Container",
"Scope",
"UnboundTypeVar",
"UnsatisfiedRequirement",
]
Loading

0 comments on commit a9380f1

Please sign in to comment.