Commit Graph

140 Commits

Author SHA1 Message Date
Roman Mogylatov
ab93b9d488 Migrate singleton tests 2021-10-18 16:04:07 -04:00
Roman Mogylatov
1377432eec Update doc blocks and imports 2021-10-18 14:56:37 -04:00
Roman Mogylatov
f85b761607 Migrate provided instance provider tests 2021-10-18 14:53:10 -04:00
Roman Mogylatov
fe149c27a2 Migrate configuration tests 2021-10-18 13:11:55 -04:00
Roman Mogylatov
98cb4ab244 Migrate resource tests 2021-10-18 10:51:50 -04:00
Roman Mogylatov
75c9bdbd7a Migrate traversal tests 2021-10-18 10:30:46 -04:00
Roman Mogylatov
7094fdc356 Migrate coroutine providers 2021-10-17 21:48:09 -04:00
Roman Mogylatov
8a07bf0e39 Migrate container provider tests 2021-10-17 21:25:31 -04:00
Roman Mogylatov
a11c976213 Migrate injection tests 2021-10-17 21:22:04 -04:00
Roman Mogylatov
ee0c53c953 Migrate callable tests 2021-10-17 11:06:26 -04:00
Roman Mogylatov
e91aedf7ff Migrate dict provider tests 2021-10-17 10:45:54 -04:00
Roman Mogylatov
efde1ed699 Migrate list provider tests 2021-10-17 10:42:12 -04:00
Roman Mogylatov
b1191d3bd8 Fix warnings 2021-10-16 12:45:45 -04:00
Roman Mogylatov
384099ddde Migrate dependencies container provider tests 2021-10-16 12:35:38 -04:00
Roman Mogylatov
4a5241bb25 Migrate dependency provider tests 2021-10-16 12:28:04 -04:00
Roman Mogylatov
708092b21a Migrate provider tests 2021-10-16 12:15:22 -04:00
Roman Mogylatov
982839b31b Migrate delegate provider tests 2021-10-16 12:08:33 -04:00
Roman Mogylatov
94ae38635b Migrate self provider tests 2021-10-16 12:04:08 -04:00
Roman Mogylatov
f5b31d0ed3 Migrate object provider tests 2021-10-16 12:02:05 -04:00
Roman Mogylatov
d9ba72f950 Migrate selector provider tests 2021-10-16 11:51:43 -04:00
Roman Mogylatov
7774ed391d Migrate factory tests 2021-10-16 11:22:09 -04:00
Roman Mogylatov
42031a1b71 Refactor asserts in provider tests 2021-10-15 19:46:45 -04:00
Roman Mogylatov
11721b0d5a Migrate async tests 2021-10-15 13:29:54 -04:00
Roman Mogylatov
6015afa76b Migrate Factory async mode tests 2021-10-15 11:30:29 -04:00
Roman Mogylatov
38e21eb6cf Migrate provider utils tests 2021-10-15 10:26:10 -04:00
Roman Mogylatov
4cc4ca9188
Drop Python 3.4 support (#518)
* Update gitignore

* Drop Python 3.4 support

* Update change log

* Fix typo in changelog
2021-10-12 12:16:49 -04:00
Roman Mogylatov
8ade2b7839 Update quotes in tests 2021-09-30 20:09:42 -04:00
Roman Mogylatov
14d8ed909b
FactoryAggregate - non string keys (#496)
* Improve FactoryAggregate typing stub

* Add implementation, typing stubs, and tests

* Update changelog

* Fix deepcopying

* Add example

* Update docs

* Fix errors formatting for pypy3
2021-08-25 10:20:45 -04:00
Roman Mogylatov
36bfd2ed58
Improve resource subclasses typing and make shutdown definition optional (#492)
* Improve resource subclasses typing and make shutdown definition optional

* Update mypy tests
2021-08-23 20:54:17 -04:00
Roman Mogylatov
83c2af0e7e Fix resource subclass abc tests on Python 3.7 2021-08-16 18:27:42 -04:00
Roman Mogylatov
1163ac59d4 Return ABCMeta class for resource classes and add tests for abc 2021-08-16 18:19:40 -04:00
Roman Mogylatov
4286013ca0
Remove generic meta class from resource and async resource classes (#490)
* Remove generic meta class from resource and async resource classes

* Add link to the issue into the tests

* Update changelog
2021-08-16 10:05:50 -04:00
Roman Mogylatov
ef049daae5
463 Config environment variables interpolation required and nones (#467)
* Make prototype with enterpolation before parsing

* Add test for option.from_yaml() with missing env not required

* Make some cosmetic changes to _resolve_config_env_markers()

* Add test for option.from_ini() missing envs not required

* Skip schema test cause it requires internet connection

* Add tests for .from_yaml() for config and config option

* Add tests for .from_ini() for config and config option

* Add example for os.environ.setdefault() and envs interpolation

* Add/update docs on environment variables interpolation

* Update changelog
2021-06-24 16:00:36 +03:00
Roman Mogylatov
dbbf5fdcf1
462 Config.from_value() (#465)
* Implement .from_value() method for config provider

* Add tests for config.from_value() method

* Add example for config.from_value()

* Add docs

* Update changelog
2021-06-13 22:05:29 -04:00
Roman Mogylatov
bbd623c719
459 Add default value for environment variable for yaml and ini config files (#461)
* Add tests for partial yaml interpolation

* Add tests for partial ini interpolation

* Add yaml config env defaults parsing

* Implement default interpolation for ini files

* Add tests for ini files env interpolation

* Update docs

* Update docs

* Update config docs keywords
2021-06-13 15:07:30 -04:00
Roman Mogylatov
0f3e170711 Bump version to 4.32.1 2021-04-25 13:45:34 -04:00
RK
9cb8e60280
Feature: Context local provider (#442)
Co-authored-by: Rollo Konig Brock <rollo@b2c2.com>
2021-04-18 21:37:55 -04:00
Roman Mogylatov
7b70f46601 Fix an issue with Dict provider non-string keys 2021-03-30 10:25:45 -04:00
Roman Mogylatov
41e698f633
Fix configuration cache reset (#430)
* Implement fix

* Improve providers copying

* Add tests and implement cache reset for configuration option

* Update changelog

* Add link to the issue
2021-03-20 21:41:39 -04:00
Roman Mogylatov
f961ff536a
Schemas (#429)
* Add single container prototype

* Add multiple containers prototype

* Add integration tests

* Implement from_*() methods and add tests

* Prototype inline injections

* Add integration test for inline providers

* Refactor integration tests

* Add integration test for reordered schema

* Remove unused imports from tests

* Refactor schema module

* Update tests to match latest schemas

* Add mypy_boto3_s3 to the test requirements

* Add boto3 to the test requirements

* Add set_provides for Callable, Factory, and Singleton providers

* Fix warnings in tests

* Add typing stubs for Callable, Factory, and Singleton .set_provides() attributes

* Fix singleton children to have optional provides

* Implement provider to provider resolving

* Fix pypy3 tests

* Implement boto3 session use case and add tests

* Implement lazy initialization and improve copying for Callable, Factory, Singleton, and Coroutine providers

* Fix Python 2 tests

* Add region name for boto3 integration example

* Remove f-strings from set_provides()

* Fix schema flake8 errors

* Implement lazy initialization and improve copying for Delegate provider

* Implement lazy initialization and improve copying for Object provider

* Speed up wiring tests

* Implement lazy initialization and improve copying for FactoryAggregate provider

* Implement lazy initialization and improve copying for Selector provider

* Implement lazy initialization and improve copying for Dependency provider

* Implement lazy initialization and improve copying for Resource provider

* Implement lazy initialization and improve copying for Configuration provider

* Implement lazy initialization and improve copying for ProvidedInstance provider

* Implement lazy initialization and improve copying for AttributeGetter provider

* Implement lazy initialization and improve copying for ItemGetter provider

* Implement lazy initialization and improve copying for MethodCaller provder

* Update changelog

* Fix typing in wiring module

* Fix wiring module loader uninstallation issue

* Fix provided instance providers error handing in asynchronous mode

Co-authored-by: Roman Mogylatov <rmk@Romans-MacBook-Pro.local>
2021-03-20 13:16:51 -04:00
Roman Mogylatov
d4ebb1b786
Remove unittest2 (#419)
* Remove unittest2 framework

* Skip a couple of tests on Python 2.7

* Update changelog
2021-03-05 20:17:28 -05:00
Roman Mogylatov
1304e596d6
Container provider override API (#418)
* Implement override API

* Add tests

* Update changelog
2021-03-03 09:05:15 -05:00
Roman Mogylatov
2bf3601695
Singleton reset context (#417)
* Add implementation and typing stubs

* Make some refactoring and add tests

* Pin ubuntu version to 18.04

* Add docs and example

* Add changelog

* Add container docs
2021-03-03 08:28:10 -05:00
Roman Mogylatov
346451819e Fix async mode mode exception handling issue in `Dependency` provider 2021-03-01 09:01:51 -05:00
Shubhendra Singh Chauhan
43eb15ed65
fix: code quality issues (#406)
* Refactor unnecessary `else` / `elif` when `if` block has a `return` statement

* Remove unused imports

* Use literal syntax to create data structure

* revert "remove unused import"
2021-02-25 09:44:15 -05:00
Roman Mogylatov
990fd3a554 Add attributes forwarding for the `Dependency` provider 2021-02-18 17:49:23 -05:00
Roman Mogylatov
27d0e07718
Async mode awaitable fix (#400)
* Fix mistakenly processed awaitable objects

* Update changelog

* Replace __isawaitable() with __is_future_or_coroutine()

* Refactor async mode
2021-02-17 09:56:39 -05:00
Roman Mogylatov
de1181bdf7
Async mode fixes (#399)
* Fix double printing of exception when initializing resource causes error

* Improve async mode exceptions handling to prevent infinite hanging when exception occurs

* Improve async mode exceptions handling

* Update changelog

* Update tests
2021-02-16 12:26:23 -05:00
Roman Mogylatov
64d37efa37
Configuration provider aliases (#397)
* Add implementation, typing stubs, and tests

* Add docs and example

* Update changelog
2021-02-15 09:11:39 -05:00
Roman Mogylatov
8b770772a1 Add container name to the representation of the dependency provider 2021-02-14 19:09:08 -05:00