From 976abe19bc9359c15ebf4714bef4305251d022c3 Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Fri, 12 May 2023 07:25:31 -0700 Subject: [PATCH 1/3] Upgrade to mocket with urllib3 >=2 fix --- setup.cfg | 3 --- setup.py | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/setup.cfg b/setup.cfg index 78acf18..0d203a5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -23,9 +23,6 @@ deps = # explicitly require indirect dependency to fix build failure. # This can be removed when aiohttp 3.9 is released. charset-normalizer==2.1.1 - # This is to work around https://github.com/mindflayer/python-mocket/issues/199 - # It can be removed once that is fixed. - urllib3==1.26.15 commands = pytest tests [testenv:py310-black] diff --git a/setup.py b/setup.py index 93068ca..1fb2ebf 100644 --- a/setup.py +++ b/setup.py @@ -38,7 +38,7 @@ platforms="any", python_requires=">=3.7", install_requires=requirements, - tests_require=["mocket>=3.8.6"], + tests_require=["mocket>=3.11.1"], test_suite="tests", license="Apache License 2.0 ", classifiers=[ From abd8914962d1ff32fb2e38be97024d6c67abf536 Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Fri, 12 May 2023 09:13:12 -0700 Subject: [PATCH 2/3] Migrate most of the setup metadata to setup.cfg --- setup.cfg | 46 +++++++++++++++++++++++++++++++++++++++++++++- setup.py | 48 ------------------------------------------------ 2 files changed, 45 insertions(+), 49 deletions(-) diff --git a/setup.cfg b/setup.cfg index 0d203a5..fcbdfa9 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,10 +1,54 @@ +[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 + 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} @@ -27,7 +71,7 @@ commands = pytest tests [testenv:py310-black] deps = black -commands = black --check --diff . +commands = black --check --diff . [testenv:py310-lint] deps = pylint diff --git a/setup.py b/setup.py index 1fb2ebf..1d4f22d 100644 --- a/setup.py +++ b/setup.py @@ -2,9 +2,7 @@ import ast import io -import os import re -import sys from setuptools import setup @@ -13,52 +11,6 @@ with io.open("minfraud/version.py", "r", encoding="utf-8") as f: _version = str(ast.literal_eval(_version_re.search(f.read()).group(1))) -with io.open("README.rst", "r", encoding="utf-8") as f: - _readme = f.read() - -requirements = [ - "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", -] - setup( - name="minfraud", version=_version, - description="MaxMind minFraud Score, Insights, Factors and Report Transactions API", - long_description=_readme, - author="Gregory Oschwald", - author_email="goschwald@maxmind.com", - url="https://www.maxmind.com/", - packages=["minfraud"], - package_data={"minfraud": ["py.typed"]}, - include_package_data=True, - platforms="any", - python_requires=">=3.7", - install_requires=requirements, - tests_require=["mocket>=3.11.1"], - test_suite="tests", - license="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 :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python", - "Topic :: Internet :: Proxy Servers", - "Topic :: Internet :: WWW/HTTP", - "Topic :: Internet", - ], - 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", - }, ) From d095a22f8df55672147f3cbba90845a36f5a941f Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Fri, 12 May 2023 09:19:08 -0700 Subject: [PATCH 3/3] Test on 3.11 and add to classifiers --- .github/workflows/test.yml | 2 +- setup.cfg | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 559954f..f4e1a3c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: # We don't test on Windows currently as it appears mocket may not # work there. platform: [ubuntu-latest, macos-latest] - python-version: [3.7, 3.8, 3.9, "3.10"] + python-version: [3.7, 3.8, 3.9, "3.10", 3.11] name: Python ${{ matrix.python-version }} on ${{ matrix.platform }} runs-on: ${{ matrix.platform }} diff --git a/setup.cfg b/setup.cfg index fcbdfa9..1bb02d9 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,6 +16,7 @@ classifiers = 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