diff --git a/MANIFEST.in b/MANIFEST.in index e822f56..45f3196 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,5 @@ include HISTORY.rst README.rst LICENSE minfraud/py.typed +exclude .* .github/**/* dev-bin/* recursive-include tests * recursive-include docs * recursive-exclude docs *.pyc diff --git a/dev-bin/release.sh b/dev-bin/release.sh index 23b983b..223d2c4 100755 --- a/dev-bin/release.sh +++ b/dev-bin/release.sh @@ -38,6 +38,7 @@ fi pip install -U sphinx wheel voluptuous email_validator twine geoip2 perl -pi -e "s/(?<=__version__ = \").+?(?=\")/$version/g" minfraud/version.py +perl -pi -e "s/(?<=^version = \").+?(?=\")/$version/gsm" pyproject.toml echo $"Test results:" tox @@ -65,5 +66,5 @@ git push --tags rm -fr build dist python -m sphinx -M html ./docs ./build/sphinx -W -python setup.py sdist bdist_wheel +python -m pipx run build twine upload dist/* diff --git a/pyproject.toml b/pyproject.toml index 2e8929f..5f2cf53 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,57 @@ -# We should probably migrate most of setup.cfg here +[project] +name = "minfraud" +version = "2.8.0" +description = "MaxMind minFraud Score, Insights, Factors and Report Transactions API" +authors = [ + {name = "Gregory Oschwald", email = "goschwald@maxmind.com"}, +] +dependencies = [ + "setuptools>=60.0.0", + "aiohttp>=3.6.2,<4.0.0", + "email_validator>=1.1.1,<3.0.0", + "geoip2>=4.7.0,<5.0.0", + "requests>=2.24.0,<3.0.0", + "voluptuous", +] +requires-python = ">=3.7" +readme = "README.rst" +license = {text = "Apache License 2.0"} +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Web Environment", + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Topic :: Internet", + "Topic :: Internet :: Proxy Servers", + "Topic :: Internet :: WWW/HTTP", +] + +[project.optional-dependencies] +test = [ + "mocket>=3.11.1", +] + +[tool.setuptools.package-data] +minfraud = ["py.typed"] + +[project.urls] +Homepage = "https://www.maxmind.com/" +Documentation = "https://minfraud.readthedocs.org/" +"Source Code" = "https://github.com/maxmind/minfraud-api-python" +"Issue Tracker" = "https://github.com/maxmind/minfraud-api-python/issues" + +[build-system] +requires = ["setuptools", "setuptools-scm", "wheel"] +build-backend = "setuptools.build_meta" [tool.black] # src is showing up in our GitHub linting builds. It seems to # contain deps. -extend-exclude = '^/src/' \ No newline at end of file +extend-exclude = '^/src/' diff --git a/setup.cfg b/setup.cfg index 1bb02d9..1e26b74 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,55 +1,7 @@ -[metadata] -name = minfraud -author = Gregory Oschwald -author_email = goschwald@maxmind.com -license = Apache License 2.0 -description = MaxMind minFraud Score, Insights, Factors and Report Transactions API -url = https://www.maxmind.com/ -long_description = file: README.rst -classifiers = - Development Status :: 5 - Production/Stable - Environment :: Web Environment - Intended Audience :: Developers - License :: OSI Approved :: Apache Software License - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Programming Language :: Python - Topic :: Internet :: Proxy Servers - Topic :: Internet :: WWW/HTTP - Topic :: Internet -platforms = any -project_urls = - Documentation = https://minfraud.readthedocs.org/ - Source Code = https://github.com/maxmind/minfraud-api-python - Issue Tracker = https://github.com/maxmind/minfraud-api-python/issues - [flake8] # black uses 88 : ¯\_(ツ)_/¯ max-line-length = 88 -[options] -packages = minfraud -install_requires = - aiohttp>=3.6.2,<4.0.0 - email_validator>=1.1.1,<3.0.0 - geoip2>=4.7.0,<5.0.0 - requests>=2.24.0,<3.0.0 - voluptuous -include_package_data = True -python_requires = >=3.7 -test_suite = tests -tests_require = mocket>=3.11.1 - -[wheel] -universal = 1 - -[options.package_data] -minfraud = py.typed - [tox:tox] envlist = {py37,py38,py39,py310}-test,py310-{black,lint,flake8,mypy} diff --git a/setup.py b/setup.py deleted file mode 100644 index 1d4f22d..0000000 --- a/setup.py +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env python - -import ast -import io -import re - -from setuptools import setup - -_version_re = re.compile(r"__version__\s+=\s+(.*)") - -with io.open("minfraud/version.py", "r", encoding="utf-8") as f: - _version = str(ast.literal_eval(_version_re.search(f.read()).group(1))) - -setup( - version=_version, -)