diff options
-rw-r--r-- | MANIFEST.in | 1 | ||||
-rw-r--r-- | mypy.ini | 4 | ||||
-rw-r--r-- | setup.cfg | 38 | ||||
-rw-r--r-- | setup.py | 55 | ||||
-rw-r--r-- | src/bcrypt/__init__.py | 2 | ||||
-rw-r--r-- | src/bcrypt/_bcrypt.pyi | 4 |
6 files changed, 48 insertions, 56 deletions
diff --git a/MANIFEST.in b/MANIFEST.in index 53d7299..2e68002 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -5,6 +5,7 @@ include pyproject.toml include tox.ini .coveragerc include src/build_bcrypt.py +recursive-include src py.typed *.pyi recursive-include src/_csrc * recursive-include tests *.py @@ -30,3 +30,7 @@ warn_unreachable=False strict_equality=True ignore_missing_imports=False + +[mypy-bcrypt._bcrypt] +ignore_missing_imports = True +disallow_any_explicit = False @@ -1,2 +1,40 @@ [metadata] +name = bcrypt +version = attr: bcrypt.__about__.__version__ +description = attr: bcrypt.__about__.__summary__ +long_description = file: README.rst +long_description_content_type = text/x-rst +license = attr: bcrypt.__about__.__license__ license_file = LICENSE +url = attr: bcrypt.__about__.__uri__ +author = attr: bcrypt.__about__.__author__ +author_email = attr: bcrypt.__about__.__email__ +classifiers = + Development Status :: 5 - Production/Stable" + License :: OSI Approved :: Apache Software License" + Programming Language :: Python :: Implementation :: CPython + Programming Language :: Python :: Implementation :: PyPy + Programming Language :: Python :: 3 + Programming Language :: Python :: 3 :: Only + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + +[options] +python_requires = >=3.6 +zip_safe = False +package_dir = + =src +packages = + bcrypt +ext_package = bcrypt +# `install_requires` must be kept in sync with `pyproject.toml` +install_requires = + cffi>=1.1 + +[options.extras_require] +tests = + pytest>=3.2.1,!=3.3.0 +typecheck = + mypy @@ -1,13 +1,8 @@ #!/usr/bin/env python -import io import platform import sys from setuptools import setup -from setuptools.command.test import test - - -CFFI_DEPENDENCY = "cffi>=1.1" CFFI_MODULES = [ @@ -15,12 +10,6 @@ CFFI_MODULES = [ ] -# Manually extract the __about__ -__about__ = {} -with open("src/bcrypt/__about__.py") as fp: - exec(fp.read(), __about__) - - if platform.python_implementation() == "PyPy": if sys.pypy_version_info < (2, 6): raise RuntimeError( @@ -29,50 +18,6 @@ if platform.python_implementation() == "PyPy": ) -class PyTest(test): - def finalize_options(self): - test.finalize_options(self) - self.test_args = [] - self.test_suite = True - - def run_tests(self): - import pytest - - errno = pytest.main(self.test_args) - sys.exit(errno) - - setup( - name=__about__["__title__"], - version=__about__["__version__"], - description=__about__["__summary__"], - long_description=io.open("README.rst", encoding="utf-8").read(), - url=__about__["__uri__"], - license=__about__["__license__"], - author=__about__["__author__"], - author_email=__about__["__email__"], - python_requires=">=3.6", - setup_requires=[CFFI_DEPENDENCY], - install_requires=[CFFI_DEPENDENCY], - extras_require={"tests": ["pytest>=3.2.1,!=3.3.0"], "typecheck": ["mypy"]}, - tests_require=["pytest>=3.2.1,!=3.3.0"], - package_dir={"": "src"}, - packages=["bcrypt"], - package_data={"bcrypt": ["py.typed"]}, - zip_safe=False, - classifiers=[ - "Development Status :: 5 - Production/Stable", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python :: Implementation :: CPython", - "Programming Language :: Python :: Implementation :: PyPy", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - ], - ext_package="bcrypt", cffi_modules=CFFI_MODULES, - cmdclass={"test": PyTest}, ) diff --git a/src/bcrypt/__init__.py b/src/bcrypt/__init__.py index 83ed520..a9aae84 100644 --- a/src/bcrypt/__init__.py +++ b/src/bcrypt/__init__.py @@ -21,7 +21,6 @@ import os import re import warnings -from . import _bcrypt # type: ignore from .__about__ import ( __author__, __copyright__, @@ -32,6 +31,7 @@ from .__about__ import ( __uri__, __version__, ) +from . import _bcrypt # noqa: I100 __all__ = [ diff --git a/src/bcrypt/_bcrypt.pyi b/src/bcrypt/_bcrypt.pyi new file mode 100644 index 0000000..329382a --- /dev/null +++ b/src/bcrypt/_bcrypt.pyi @@ -0,0 +1,4 @@ +import typing + +ffi: typing.Any +lib: typing.Any |