Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BREAKING_CHANGE: dissallow using a dependency with different scopes #61

Merged
merged 6 commits into from
Feb 6, 2022

Conversation

adriangb
Copy link
Owner

@adriangb adriangb commented Feb 6, 2022

Closes #58.

This change explicitly prohibits using the same dependency with multiple scopes within a given DAG, thus resolving #58.

It is important to note the within a given DAG part: you can still use the same dependency in two completely separate DAGs with different scopes. In this case, caching between them will work: if the dependency is cached in an outer scope, the cached value will be used, but if it is cached in an inner scope, it will be ignored (this behavior is here)

@codecov-commenter
Copy link

codecov-commenter commented Feb 6, 2022

Codecov Report

Merging #61 (d8cefe6) into main (c988f5c) will increase coverage by 0.05%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #61      +/-   ##
==========================================
+ Coverage   97.28%   97.33%   +0.05%     
==========================================
  Files          46       46              
  Lines        2023     2028       +5     
  Branches      344      344              
==========================================
+ Hits         1968     1974       +6     
  Misses         41       41              
+ Partials       14       13       -1     
Impacted Files Coverage Δ
tests/test_dependant.py 100.00% <ø> (ø)
di/container.py 93.97% <100.00%> (+0.47%) ⬆️
di/dependant.py 97.29% <100.00%> (ø)
tests/test_solving.py 97.29% <100.00%> (+0.04%) ⬆️

@adriangb adriangb merged commit b658443 into main Feb 6, 2022
@adriangb adriangb deleted the dissallow-using-dep-with-mutliple-scopes branch February 6, 2022 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: document / allow customization of dependencies with conflicting scopes
2 participants