summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2022-02-20 16:12:28 -0500
committerGitHub <noreply@github.com>2022-02-21 05:12:28 +0800
commit742723a99e20412c861794c7a81b55f66637ccd5 (patch)
tree420cf07fc82f541aaaca229beb701adad0469b72
parentda826b3fd870b62df369957805568ceeccc88a34 (diff)
downloadpy-bcrypt-git-742723a99e20412c861794c7a81b55f66637ccd5.tar.gz
Move most setup.py configuration into setup.cfg (#293)
-rw-r--r--MANIFEST.in1
-rw-r--r--mypy.ini4
-rw-r--r--setup.cfg38
-rw-r--r--setup.py55
-rw-r--r--src/bcrypt/__init__.py2
-rw-r--r--src/bcrypt/_bcrypt.pyi4
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
diff --git a/mypy.ini b/mypy.ini
index 10317dd..0a81bf5 100644
--- a/mypy.ini
+++ b/mypy.ini
@@ -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
diff --git a/setup.cfg b/setup.cfg
index 0c9e0fc..8f664d0 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -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
diff --git a/setup.py b/setup.py
index 3536af0..bb36d74 100644
--- a/setup.py
+++ b/setup.py
@@ -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