Commit Graph

24 Commits

Author SHA1 Message Date
Jakub Stasiak 072e868bd2 Don't require typing_extensions on Python 3.9 unnecessarily 2020-05-23 12:05:15 +02:00
Jakub Stasiak 211994f48e Fix some links to avoid redirections 2020-02-05 11:19:43 +01:00
Jakub Stasiak 484b6881c5 Remove the standalone pytest script
I don't believe it's necessary to have this anymore.
2019-12-14 19:11:09 +01:00
Jakub Stasiak d50e581734 Experiment with PEP 593-based way to declare what's (non)injectable
There's an implementation of PEP 593 draft in typing_extensions and mypy
supports it already.

See also:

* typing module discussion (pre-PEP): https://github.com/python/typing/issues/600
* python-ideas discussion (pre-PEP): https://mail.python.org/pipermail/python-ideas/2019-January/054908.html
* The actual PEP: https://www.python.org/dev/peps/pep-0593/
* typing-sig PEP discussion (ongoing): https://mail.python.org/archives/list/typing-sig@python.org/thread/CZ7N3M3PGKHUY63RWWSPTICVOAVYI73D/
2019-10-16 18:23:43 +02:00
Jakub Stasiak 0d1b4a4798 Format the code using Black
This is in order to keep the formatting consistent in the future.
2019-04-05 15:58:16 +02:00
Jakub Stasiak 6358f5d304 Drop Python 3.4 support, it's EOL now
See https://devguide.python.org/#status-of-python-branches
2019-04-05 15:57:52 +02:00
Jakub Stasiak 6a27745f01 Provide PEP 561-compatible type checking opt-in marker
Possible due to 625938a77f ("Move the code into a package (needed
for PEP 561)")

This is in order for tools to pick up injector type information while
analyzing client code.
2019-02-07 12:44:14 +01:00
Jakub Stasiak 625938a77f Move the code into a package (needed for PEP 561)
If we want to distribute type information the right way and for the
tools to pick it up we need to follow PEP 561 and include a file named
py.typed. Unfortunately there's no way to include the file with
module-only distributions[1]:

    This PEP does not support distributing typing information as part of
    module-only distributions. The code should be refactored into
    a package-based distribution and indicate that the package supports
    typing as described above.

Therefore we need to have a package first - this is what this commit
does.

[1] https://www.python.org/dev/peps/pep-0561/#packaging-type-information
2019-02-07 12:43:56 +01:00
Nikita Melentev 4c9ed3998e setup.py: warning instead of print (#87) 2018-04-07 01:33:51 +02:00
poh 8faa9e74cd setup.py: conditional install dependency 2018-04-07 01:32:45 +02:00
poh 11d7bf1275 setup.py: proper file reading with contextlib 2018-04-07 01:32:09 +02:00
Nikita Melentev 40889a2e94 remove non-install requirement (fix #83) 2018-03-30 15:07:20 +11:00
Jakub Stasiak c186b8767a Fix the package installation
Broken in [1], I forgot that injector is imported in setup.py and the
dependency format I used was incorrect.

[1] 2b14948aa7
2016-10-18 16:11:17 +02:00
Jakub Stasiak 2b14948aa7 Make (Class)AssistedBuilder and ProviderOf generic classes
This doesn't provide much benefit to Injector itself but now
(Class)AssistedBuilder[T] and ProviderOf can be used in type hints[1]
like this:

    class Class:
        def __init__(self, builder: AssistedBuilder[OtherClass]):
            # ...

By being able to do that projects using Injector will gain more static
type safety when tool like mypy is used to lint the code.

Python 2.6 support is dropped because the typing module requires Python
2.7 or newer.

[1] https://docs.python.org/3/library/typing.html
2016-10-18 13:55:48 +02:00
Jakub Stasiak 6f22b5eac7 Add some package keywords 2013-08-28 23:16:02 +01:00
Alec Thomas 66142afe8c Convert README.md to RST for PyPi. Bump to 0.7.6.
Fixes #26.
2013-08-10 10:52:07 -04:00
Alec Thomas ac80271553 Whoops. 2013-06-27 16:47:48 -04:00
Alec Thomas 201ec769fd Roll back README.md->rst rename. 2012-11-18 23:19:52 -05:00
Alec Thomas e2361667e6 Bump version. 2012-11-18 22:51:54 -05:00
Alec Thomas c70ed6be7d Release 0.5.0
- Python 3 compatibility thanks to @didrocks.
- Allow unicode keys to Key().
- Add @threadlocal scope.
- Add @with_injector method decorator for helping with test boilerplate.
2012-11-16 09:52:12 -05:00
Alec Thomas 890e5bfe60 Fix setup.py. 2012-02-24 16:06:44 -05:00
Alec Thomas 1f075896a7 Clean up test running with py.test.
Also moved into a package and removed duplicate docs in injector.py.
2012-02-23 16:16:33 -05:00
Alec Thomas 4cd33a659b Add injector context and make scopes use it. 2010-11-28 00:27:26 +11:00
Alec Thomas bfef950c4f Flesh out the README. 2010-11-26 01:33:37 +11:00