Skip to content

Commit

Permalink
move project info to pyproject
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedh committed May 9, 2024
1 parent 93e4ad3 commit 3bb9b85
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 34 deletions.
28 changes: 26 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,35 @@ requires = [
"setuptools>=42",
"wheel",
"pybind11~=2.6",
"numpy>=1.19.5"
"numpy>=1.26.0"
]
build-backend = "setuptools.build_meta"

[project]
name = "mapbox_earcut"
version = "1.0.2"
requires-python = ">=3.7"
authors = [{name = "Samuel Kogler", email = "[email protected]"}]
license = {file = "LICENSE.md"}
description = "Python bindings for the mapbox earcut C++ polygon triangulation library."
dependencies = ["numpy>=1.26.0"]

[project.urls]
Source = "https://github.com/skogler/mapbox_earcut_python"
CSource = "https://github.com/mapbox/earcut.hpp"

[project.readme]
file = "README.md"
content-type = "text/markdown"

[tool.setuptools]
zip-safe = false
include-package-data = true

[project.optional-dependencies]
test = ["pytest"]


[tool.cibuildwheel]
# install the `test` extra
test-extras = ["test"]
Expand All @@ -17,4 +42,3 @@ test-skip = "*_arm64 *_universal2:arm64"

[tool.cibuildwheel.macos]
archs = ["x86_64", "arm64"]

39 changes: 8 additions & 31 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,42 +1,19 @@
import os

from setuptools import setup
from pybind11.setup_helpers import Pybind11Extension, build_ext

FILE_DIR = os.path.dirname(os.path.abspath(__file__))
VERSION = '1.0.1'
# TODO
VERSION = "1.0.2"

ext_modules = [
Pybind11Extension('mapbox_earcut',
['src/main.cpp'],
include_dirs=['include'],
define_macros = [('VERSION_INFO', VERSION)],
),
Pybind11Extension(
"mapbox_earcut",
["src/main.cpp"],
include_dirs=["include"],
define_macros=[("VERSION_INFO", VERSION)],
),
]

def get_readme_contents():
with open(os.path.join(FILE_DIR, 'README.md'), 'r') as readme_file:
return readme_file.read()

setup(
name='mapbox_earcut',
version=VERSION,
url='https://github.com/skogler/mapbox_earcut_python',
author='Samuel Kogler',
author_email='[email protected]',
description=
'Python bindings for the mapbox earcut C++ polygon triangulation library.',
long_description=get_readme_contents(),
long_description_content_type='text/markdown',
license='ISC',
ext_modules=ext_modules,
install_requires=['numpy'],
extras_require={'test': 'pytest'},
cmdclass=dict(build_ext=build_ext),
zip_safe=False,
project_urls={
'Source': 'https://github.com/skogler/mapbox_earcut_python',
'Original C++ Source': 'https://github.com/mapbox/earcut.hpp',
},
include_package_data = True
)
1 change: 0 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ PYBIND11_MODULE(mapbox_earcut, m)
m.def("triangulate_float64", &triangulate<double, uint32_t>);

#ifdef VERSION_INFO

m.attr("__version__") = MACRO_TO_STR(VERSION_INFO) ;
#else
m.attr("__version__") = "dev";
Expand Down

0 comments on commit 3bb9b85

Please sign in to comment.