Commit Graph

5 Commits

Author SHA1 Message Date
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
Jakub Stasiak f0770b0d19 Merge test files as we're Python 3-only now anyway 2017-05-26 14:36:39 +02:00
Jakub Stasiak 0b03c36cc3 Drop Python 2 support
Python 2 support is annoying to maintain and prevents us from playing
with cool stuff like type hints.
2017-05-26 14:35:57 +02:00
Jakub Stasiak 2be8dbac43 Introduce a new decorator to use with Module methods
provider provides (all puns intended) a more compact way to do what
provider + inject used to. It infers the interface to provide based on
decorated method's return type annotations therefore cooperating nicely
with type hints[1] and tools that use them.

Some source files are no longer fed to py.test because they contain
Python 3+ only syntax.

[1] https://docs.python.org/3/library/typing.html
2016-10-18 15:22:22 +02:00
Alec Thomas 7c1aa98aea Add support for using Py3 annotations in lieu of @inject. 2013-08-08 23:11:06 -04:00