-
Notifications
You must be signed in to change notification settings - Fork 11
Numpy 2.0 Wheels #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Numpy 2.0 Wheels #15
Changes from 10 commits
6fefcb2
921f369
93e4ad3
3bb9b85
d322389
2d7a36a
7865c68
9abaf37
db28557
2b8fb94
145dd08
784c5b8
6fdbf6d
bb1281b
1d379cd
85c0fd6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,49 @@ | |
| requires = [ | ||
| "setuptools>=42", | ||
| "wheel", | ||
| "pybind11~=2.6", | ||
| "pybind11==2.12.0", | ||
| "tomli>=0.10; python_version<'3.11'", | ||
| ] | ||
| build-backend = "setuptools.build_meta" | ||
|
|
||
| [project] | ||
| name = "mapbox_earcut" | ||
| version = "1.0.2" | ||
| requires-python = ">=3.7" | ||
|
||
| authors = [{name = "Samuel Kogler", email = "samuel.kogler@gmail.com"}] | ||
| license = {file = "LICENSE.md"} | ||
| description = "Python bindings for the mapbox earcut C++ polygon triangulation library." | ||
| dependencies = ["numpy>=1.19.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"] | ||
|
|
||
| # Run the package tests using `pytest` | ||
| # also test against pre-release Numpy | ||
| # TODO : when numpy 2.0 releases this can be reduced to just one pytest | ||
| test-command = ["pytest {package}/tests", | ||
|
||
| "pip install --force-reinstall --upgrade --pre numpy", | ||
| "pytest {package}/tests"] | ||
|
|
||
| # don't test on PyPy as it will re-build numpy | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does this workin PyPy at all? I give up on that on the conda-forge build. |
||
| test-skip = "*_arm64 *_universal2:arm64 pp*" | ||
|
|
||
| [tool.cibuildwheel.macos] | ||
| archs = ["x86_64", "arm64"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,40 +3,44 @@ | |
| from setuptools import setup | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we really should move to a "modern" build -- e.g. not putting code in setup.py. maybe even scikit build? |
||
| from pybind11.setup_helpers import Pybind11Extension, build_ext | ||
|
|
||
| FILE_DIR = os.path.dirname(os.path.abspath(__file__)) | ||
| VERSION = '1.0.1' | ||
|
|
||
| def _get_version() -> str: | ||
| """ | ||
| Get the version defined in `pyproject.toml` to prevent | ||
| requiring the version to be specified in two places. | ||
|
|
||
| Note that Python only introduced a TOML parser in | ||
| Python 3.11 so this requires `pip install tomli` for older | ||
| versions of Python. | ||
| """ | ||
| try: | ||
| # we could also do this with | ||
| # if `sys.version_info >= (3, 11)` | ||
| from tomllib import load | ||
| except BaseException: | ||
| # a parser with the same API from pypi | ||
| from tomli import load | ||
|
|
||
| # current working directory | ||
| cwd = os.path.abspath(os.path.expanduser(os.path.dirname(__file__))) | ||
| # file-relative pyproject path | ||
| path = os.path.join(cwd, "pyproject.toml") | ||
| with open(path, "rb") as f: | ||
| pyproject = load(f) | ||
|
|
||
| return pyproject["project"]["version"] | ||
|
|
||
|
|
||
| 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", _get_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='samuel.kogler@gmail.com', | ||
| 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 | ||
| ) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe put a >= in here?