Skip to content

Commit 8c73cc5

Browse files
committed
move most project configuration to pyproject.toml
1 parent 486d4af commit 8c73cc5

File tree

3 files changed

+79
-48
lines changed

3 files changed

+79
-48
lines changed

MANIFEST.in

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1-
include *md
1+
include README.md
2+
include CHANGELOG.md
23
include LICENSE.TXT
34
include CMakeLists.txt
5+
include mkdocs.yaml
46
include cmake/*.cmake
57
include lib/*.h
68
include lib/*.cc
79
include examples/*py
810
include test/*py
11+
include src/py.typed
12+
recursive-include src *.pyi
13+
recursive-include docs *md *css
14+
include docs/cookbooks/*.ipynb
15+
include docs/Makefile

pyproject.toml

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,71 @@
11
[build-system]
2-
requires = ["packaging", "setuptools"]
2+
requires = ["setuptools"]
33
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "osmium"
7+
description = "Python bindings for libosmium, the data processing library for OSM data"
8+
readme = "README.rst"
9+
requires-python = ">=3.7"
10+
license = {text = 'BSD-2-Clause'}
11+
authors = [
12+
{name = "Sarah Hoffmann", email = "[email protected]"}
13+
]
14+
maintainers = [
15+
{name = "Sarah Hoffmann", email = "[email protected]"}
16+
]
17+
keywords = ["OSM", "OpenStreetMap", "Osmium"]
18+
classifiers = [
19+
"Development Status :: 5 - Production/Stable",
20+
"Intended Audience :: Developers",
21+
"License :: OSI Approved :: BSD License",
22+
"Programming Language :: Python :: 3.7",
23+
"Programming Language :: Python :: 3.8",
24+
"Programming Language :: Python :: 3.9",
25+
"Programming Language :: Python :: 3.10",
26+
"Programming Language :: Python :: 3.11",
27+
"Programming Language :: Python :: 3.12",
28+
"Programming Language :: Python :: Implementation :: CPython",
29+
"Programming Language :: C++",
30+
]
31+
dependencies = [
32+
"requests"
33+
]
34+
35+
dynamic = ["version"]
36+
37+
[tool.setuptools]
38+
packages = [
39+
"osmium",
40+
"osmium.osm",
41+
"osmium.replication"
42+
]
43+
package-dir = {"" = "src"}
44+
45+
46+
[project.urls]
47+
Homepage = "https://osmcode.org/pyosmium"
48+
Documentation = "https://docs.osmcode.org/pyosmium/latest/"
49+
Repository = "https://github.com/osmcode/pyosmium"
50+
Issues = "https://github.com/osmcode/pyosmium/issues"
51+
52+
[project.optional-dependencies]
53+
tests = [
54+
'pytest',
55+
'pytest-httpserver',
56+
'werkzeug',
57+
'shapely'
58+
]
59+
docs = [
60+
'mkdocs',
61+
'mkdocs-material',
62+
'mkdocstrings',
63+
'mkdocstrings-python',
64+
'mkdocs-autorefs',
65+
'mkdocs-gen-files',
66+
'mkdocs-jupyter',
67+
'argparse-manpage '
68+
]
69+
70+
[tool.setuptools.dynamic]
71+
version = {attr = "osmium.version.pyosmium_release"}

setup.py

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@
1616
from setuptools import setup, Extension
1717
from setuptools.command.build_ext import build_ext
1818
from setuptools.command.sdist import sdist as orig_sdist
19-
from packaging.version import Version
2019

2120
BASEDIR = os.path.split(os.path.abspath(__file__))[0]
2221

23-
class Pyosmium_sdist(orig_sdist):
22+
class PyosmiumSDist(orig_sdist):
2423

2524
contrib = (
2625
('libosmium', 'https://github.com/osmcode/libosmium/archive/v{}.tar.gz'),
@@ -133,52 +132,9 @@ def build_extension(self, ext):
133132

134133
versions = get_versions()
135134

136-
if sys.version_info < (3,7):
137-
raise RuntimeError("Python 3.7 or larger required.")
138-
139-
with open('README.rst', 'r') as descfile:
140-
long_description = descfile.read()
141-
142135
setup(
143-
name='osmium',
144-
version=versions['pyosmium_release'],
145-
description='Python bindings for libosmium, the data processing library for OSM data',
146-
long_description=long_description,
147-
author='Sarah Hoffmann',
148-
author_email='[email protected]',
149-
maintainer='Sarah Hoffmann',
150-
maintainer_email='[email protected]',
151-
download_url='https://github.com/osmcode/pyosmium',
152-
url='https://osmcode.org/pyosmium',
153-
keywords=["OSM", "OpenStreetMap", "Osmium"],
154-
license='BSD',
155136
scripts=['tools/pyosmium-get-changes', 'tools/pyosmium-up-to-date'],
156-
classifiers = [
157-
"Development Status :: 5 - Production/Stable",
158-
"Intended Audience :: Developers",
159-
"License :: OSI Approved :: BSD License",
160-
"Programming Language :: Python :: 3.7",
161-
"Programming Language :: Python :: 3.8",
162-
"Programming Language :: Python :: 3.9",
163-
"Programming Language :: Python :: 3.10",
164-
"Programming Language :: Python :: 3.11",
165-
"Programming Language :: Python :: 3.12",
166-
"Programming Language :: Python :: 3.13",
167-
"Programming Language :: Python :: Implementation :: CPython",
168-
"Programming Language :: C++",
169-
],
170-
171137
ext_modules=[CMakeExtension('cmake_example')],
172-
packages = ['osmium', 'osmium/osm', 'osmium/replication'],
173-
package_dir = {'' : 'src'},
174-
package_data = { 'osmium': ['py.typed', '*.pyi',
175-
'replication/_replication.pyi',
176-
'osm/_osm.pyi']},
177-
python_requires = ">=3.7",
178-
install_requires = ['requests'],
179-
extras_require = {
180-
'tests': ['pytest', 'pytest-httpserver', 'werkzeug', 'shapely'],
181-
},
182-
cmdclass=dict(build_ext=CMakeBuild, sdist=Pyosmium_sdist),
138+
cmdclass=dict(build_ext=CMakeBuild, sdist=PyosmiumSDist),
183139
zip_safe=False,
184140
)

0 commit comments

Comments
 (0)