-
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
Closed
Closed
Numpy 2.0 Wheels #15
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
6fefcb2
move cibuildwheel to pyproject and test on numpy 2.0
mikedh 921f369
trigger action
mikedh 93e4ad3
try oldest numpy on python 3.6
mikedh 3bb9b85
move project info to pyproject
mikedh d322389
relax versions
mikedh 2d7a36a
set minimum python to 3.7
mikedh 7865c68
skip tests where numpy isn't available as wheels
mikedh 9abaf37
skip pypy
mikedh db28557
try pinning pybind
mikedh 2b8fb94
use tomli for old python
mikedh 145dd08
address suggestions and release as earcutx
mikedh 784c5b8
skip pypy
mikedh 6fdbf6d
try building on ubuntu latest
mikedh bb1281b
update macos runner
mikedh 1d379cd
release on main
mikedh 85c0fd6
update test module ref
mikedh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,18 +8,15 @@ jobs: | |
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04, windows-2019, macos-11] | ||
os: [ubuntu-latest, windows-2019, macos-13] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_ARCHS_MACOS: x86_64 arm64 | ||
CIBW_TEST_SKIP: "*_arm64 *_universal2:arm64" | ||
uses: pypa/[email protected] | ||
|
||
- name: Show files | ||
run: ls -lh wheelhouse | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ name: Release | |
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,46 @@ | |
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 = "earcutx" | ||
version = "1.0.4" | ||
requires-python = ">=3.8" | ||
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.24.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] | ||
skip = "pp*" | ||
# install the `test` extra | ||
test-extras = ["test"] | ||
|
||
# Run the package tests using `pytest` | ||
test-command = "pytest {package}/tests" | ||
|
||
# don't test on PyPy as it will re-build numpy | ||
test-skip = "*_arm64 *_universal2:arm64" | ||
|
||
[tool.cibuildwheel.macos] | ||
archs = ["x86_64", "arm64"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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( | ||
"earcutx", | ||
["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='[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 | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
does this workin PyPy at all? I give up on that on the conda-forge build.