Skip to content

Commit 8de03f7

Browse files
authored
Merge pull request #156 from maxmind/greg/build-improvements
Modernize package building
2 parents 884dfc3 + 8b3bd49 commit 8de03f7

File tree

6 files changed

+61
-53
lines changed

6 files changed

+61
-53
lines changed

.readthedocs.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,8 @@ build:
44
os: ubuntu-22.04
55
tools:
66
python: "3.11"
7+
8+
python:
9+
install:
10+
- method: pip
11+
path: .

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
exclude .* .github/**/* dev-bin/*
12
include HISTORY.rst README.rst LICENSE geoip2/py.typed tests/*.py tests/data/test-data/*.mmdb
23
graft docs/html

dev-bin/release.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ fi
3737
pip install sphinx wheel
3838

3939
perl -pi -e "s/(?<=__version__ = \").+?(?=\")/$version/gsm" geoip2/__init__.py
40+
perl -pi -e "s/(?<=^version = \").+?(?=\")/$version/gsm" pyproject.toml
4041

4142
echo $"Test results:"
4243
python setup.py test
@@ -64,5 +65,5 @@ git push --tags
6465

6566
rm -fr build dist
6667
python -m sphinx -M html ./docs ./build/sphinx
67-
python setup.py sdist bdist_wheel
68+
python -m pipx run build
6869
twine upload dist/*

pyproject.toml

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,57 @@
1-
# We should probably migrate most of setup.cfg here
1+
[build-system]
2+
requires = ["setuptools", "setuptools-scm", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "geoip2"
7+
version = "4.7.0"
8+
description = "MaxMind GeoIP2 API"
9+
authors = [
10+
{name = "Gregory Oschwald", email = "[email protected]"},
11+
]
12+
dependencies = [
13+
"maxminddb",
14+
"aiohttp>=3.6.2,<4.0.0",
15+
"maxminddb>=2.3.0,<3.0.0",
16+
"requests>=2.24.0,<3.0.0",
17+
"setuptools>=60.0.0",
18+
]
19+
requires-python = ">=3.7"
20+
readme = "README.rst"
21+
license = {text = "Apache License, Version 2.0"}
22+
classifiers = [
23+
"Development Status :: 5 - Production/Stable",
24+
"Environment :: Web Environment",
25+
"Intended Audience :: Developers",
26+
"Intended Audience :: System Administrators",
27+
"License :: OSI Approved :: Apache Software License",
28+
"Programming Language :: Python",
29+
"Programming Language :: Python :: 3",
30+
"Programming Language :: Python :: 3.7",
31+
"Programming Language :: Python :: 3.8",
32+
"Programming Language :: Python :: 3.9",
33+
"Programming Language :: Python :: 3.10",
34+
"Programming Language :: Python :: 3.11",
35+
"Programming Language :: Python :: 3.12",
36+
"Topic :: Internet",
37+
"Topic :: Internet :: Proxy Servers",
38+
]
39+
40+
[project.optional-dependencies]
41+
test = [
42+
"mocket>=3.11.1",
43+
]
44+
45+
[tool.setuptools.package-data]
46+
geoip2 = ["py.typed"]
47+
48+
[project.urls]
49+
Homepage = "https://www.maxmind.com/"
50+
Documentation = "https://geoip2.readthedocs.org/"
51+
"Source Code" = "https://github.com/maxmind/GeoIP2-python"
52+
"Issue Tracker" = "https://github.com/maxmind/GeoIP2-python/issues"
253

354
[tool.black]
455
# src is showing up in our GitHub linting builds. It seems to
556
# contain deps.
6-
extend-exclude = '^/src/'
57+
extend-exclude = '^/src/'

setup.cfg

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,3 @@
1-
[metadata]
2-
name = geoip2
3-
author = Gregory Oschwald
4-
author_email = [email protected]
5-
license = Apache License, Version 2.0
6-
description = MaxMind GeoIP2 API
7-
url = https://www.maxmind.com/
8-
long_description = file: README.rst
9-
classifiers =
10-
Development Status :: 5 - Production/Stable
11-
Environment :: Web Environment
12-
Intended Audience :: Developers
13-
Intended Audience :: System Administrators
14-
License :: OSI Approved :: Apache Software License
15-
Programming Language :: Python :: 3
16-
Programming Language :: Python :: 3.7
17-
Programming Language :: Python :: 3.8
18-
Programming Language :: Python :: 3.9
19-
Programming Language :: Python :: 3.10
20-
Programming Language :: Python :: 3.11
21-
Programming Language :: Python
22-
Topic :: Internet :: Proxy Servers
23-
Topic :: Internet
24-
project_urls =
25-
Documentation = https://geoip2.readthedocs.org/
26-
Source Code = https://github.com/maxmind/GeoIP2-python
27-
Issue Tracker = https://github.com/maxmind/GeoIP2-python/issues
28-
29-
[options]
30-
package_dir =
31-
geoip2 = geoip2
32-
packages = geoip2
33-
install_requires =
34-
aiohttp>=3.6.2,<4.0.0
35-
maxminddb>=2.3.0,<3.0.0
36-
requests>=2.24.0,<3.0.0
37-
include_package_data = True
38-
python_requires = >=3.7
39-
test_suite = tests
40-
tests_require = mocket>=3.11.1
41-
421
[flake8]
432
# black uses 88 : ¯\_(ツ)_/¯
443
max-line-length = 88

setup.py

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)