Skip to content

Commit 94eed72

Browse files
authored
Update package specs, build process, supported Python (#64)
* Add pyproject.toml * Use hatch for PyPI publishing * Update version * Use pytest and update tested Python versions * Update docs to include custom/HIPAA endpoints * Update GH actions for Python versions
1 parent 077a486 commit 94eed72

File tree

10 files changed

+104
-72
lines changed

10 files changed

+104
-72
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Publish package to PyPI
22

3-
on:
3+
on:
44
push:
55
branches: [master]
66
release:
@@ -21,13 +21,13 @@ jobs:
2121
- name: Install dependencies
2222
run: |
2323
python -m pip install --upgrade pip
24-
pip install setuptools wheel twine
24+
pip install hatch
2525
2626
- name: Build and publish distribution
2727
if: (github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')) || github.event_name == 'release'
28-
env:
29-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
30-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
28+
env:
29+
HATCH_INDEX_USER: ${{ secrets.PYPI_USERNAME }}
30+
HATCH_INDEX_AUTH: ${{ secrets.PYPI_PASSWORD }}
3131
run: |
32-
python setup.py sdist bdist_wheel
33-
twine upload dist/*
32+
hatch build
33+
hatch publish

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
12-
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
12+
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
1313

1414
steps:
1515
- uses: actions/checkout@v3

HISTORY.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
History
44
-------
55

6+
1.5.0 (2024-10-31)
7+
+++++++++++++++++++
8+
9+
* Drop support for Python 3.7
10+
* Add support for Python 3.12, 3.13
11+
* Update docs and build process
12+
613
1.4.0 (2023-07-08)
714
+++++++++++++++++++
815

@@ -39,12 +46,12 @@ History
3946
+++++++++++++++++++
4047

4148
* Adds auto-loading of API version (thanks Unix-Code!)
42-
* Default API calls to Version 1.6 (thanks MiniCodeMonkey!)
49+
* Default API calls to Version 1.6 (thanks MiniCodeMonkey!)
4350

4451
0.11.1 (2019-11-07)
4552
+++++++++++++++++++
4653

47-
* Default API calls to Version 1.4 (thanks cyranix!)
54+
* Default API calls to Version 1.4 (thanks cyranix!)
4855

4956
0.11.0 (2019-10-19)
5057
+++++++++++++++++++

docs/geocode.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Geocoding
33
=========
44

5+
56
Single address geocoding
67
========================
78

@@ -136,3 +137,17 @@ preserves the list's index based lookup.
136137
request addresses.
137138

138139

140+
API endpoints
141+
=============
142+
143+
By default the geocodio client will connect to ``api.geocodio.io``.
144+
145+
Optionally, you can specify ``hipaa_enabled=True`` or a custom API endpoint
146+
with ``custom_base_domain`` when initializing the client.::
147+
148+
>>> from geocodio import GeocodioClient
149+
>>> hipaa_compliant_client = GeocodioClient(MY_KEY, hipaa_enabled=True)
150+
>>> custom_endpoint_client = GeocodioClient(MY_KEY, custom_base_domain="api.acme.org")
151+
152+
Most users will use the default API endpoint. See the Geocodio docs and/or
153+
support for more information about the HIPAA compliant and custom endpoints.

pyproject.toml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
[build-system]
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "pygeocodio"
7+
dynamic = ["version"]
8+
description = "Python wrapper for Geocod.io API"
9+
readme = "README.rst"
10+
license = {text = "BSD"}
11+
authors = [
12+
{name = "Ben Lopatin", email = "ben@benlopatin.com"}
13+
]
14+
keywords = ["geocodio"]
15+
classifiers = [
16+
"Development Status :: 5 - Production/Stable",
17+
"Intended Audience :: Developers",
18+
"License :: OSI Approved :: BSD License",
19+
"Natural Language :: English",
20+
"Programming Language :: Python :: 3",
21+
"Programming Language :: Python :: 3.9",
22+
"Programming Language :: Python :: 3.10",
23+
"Programming Language :: Python :: 3.11",
24+
"Programming Language :: Python :: 3.12",
25+
"Programming Language :: Python :: 3.13",
26+
"Topic :: Internet :: WWW/HTTP",
27+
]
28+
requires-python = ">=3.9"
29+
dependencies = [
30+
"requests>=1.0.0",
31+
]
32+
[project.optional-dependencies]
33+
tests = [
34+
"requests>=1.0.0",
35+
"httpretty>=0.9.7",
36+
"pytest>=7.0",
37+
"pytest-cov>=4.0",
38+
]
39+
docs = [
40+
"Sphinx==7.0.1",
41+
]
42+
43+
[project.urls]
44+
Homepage = "https://github.com/bennylope/pygeocodio"
45+
46+
[tool.hatch.version]
47+
path = "src/geocodio/__init__.py"
48+
49+
[tool.hatch.build.targets.wheel]
50+
packages = ["src/geocodio"]
51+
52+
[tool.hatch.build.targets.sdist]
53+
include = [
54+
"src/geocodio",
55+
"README.rst",
56+
"HISTORY.rst",
57+
]
58+
59+
[tool.pytest.ini_options]
60+
minversion = "7.0"
61+
addopts = "-ra -q"
62+
testpaths = [
63+
"tests",
64+
]
65+
python_files = ["test_*.py", "*_test.py"]

requirements-docs.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

requirements.txt

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

setup.py

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

src/geocodio/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
__author__ = "Ben Lopatin"
44
__email__ = "ben@benlopatin.com"
5-
__version__ = "1.4.0"
5+
__version__ = "1.5.0"
66

77

88
from geocodio.client import GeocodioClient # noqa

tox.ini

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
[tox]
2-
envlist = py38, py39, py310, py311, flake8
2+
envlist = py39, py310, py311, py312, py313, flake8
33

44
[gh-actions]
55
python =
6-
3.7: py37
7-
3.8: py38
86
3.9: py39
97
3.10: py310
108
3.11: py311
9+
3.12: py312
10+
3.13: py313
1111

1212
[testenv]
1313
setenv =
1414
PYTHONPATH = {toxinidir}:{toxinidir}/geocodio
15-
commands = python setup.py test
15+
allowlist_externals = pytest
16+
commands = pytest {posargs:tests/}
1617
deps =
17-
-r{toxinidir}/requirements.txt
18-
18+
.[tests]
1919

2020
[testenv:flake8]
2121
basepython=python3

0 commit comments

Comments
 (0)