Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
1444bc2
Add `.venv/` to `.gitignore`
adam-grant-hendry Apr 5, 2022
21b0306
Delete `conda` and `docker` related files
adam-grant-hendry Apr 8, 2022
b1d3367
Add `*.pyd` files to `.gitignore`
adam-grant-hendry Apr 8, 2022
8183136
Add poetry files
adam-grant-hendry Apr 8, 2022
3a7bb54
Fix build error
adam-grant-hendry Apr 8, 2022
3ed4270
Use `importlib.metadata` to get package version
adam-grant-hendry Apr 8, 2022
14fdd23
Merge branch 'bugfix/build' into develop
adam-grant-hendry Apr 8, 2022
8479786
Merge branch 'release/0.1.7'
adam-grant-hendry Apr 8, 2022
2ec2f24
Merge tag '0.1.7' into develop
adam-grant-hendry Apr 8, 2022
4270a43
Add `#isort:skip` directives to `setup.py`
adam-grant-hendry Apr 9, 2022
eb50218
Bump version to 0.1.8
adam-grant-hendry Apr 9, 2022
cd85340
Merge branch 'release/0.1.8'
adam-grant-hendry Apr 9, 2022
6326411
Merge tag '0.1.8' into develop
adam-grant-hendry Apr 9, 2022
d7efff5
Add build script to publish on PyPI
adam-grant-hendry Apr 10, 2022
210a65a
Bump version to 0.1.9
adam-grant-hendry Apr 10, 2022
2f194be
Merge branch 'release/0.1.9'
adam-grant-hendry Apr 10, 2022
887f6ec
Merge tag '0.1.9' into develop
adam-grant-hendry Apr 10, 2022
c121aed
Fix string concatenation and add `setup.py`
adam-grant-hendry Apr 19, 2022
c1d798a
Bump version to 0.1.10
adam-grant-hendry Apr 19, 2022
c7f09ca
Merge branch 'release/0.1.10'
adam-grant-hendry Apr 19, 2022
fcbff52
Merge tag '0.1.10' into develop
adam-grant-hendry Apr 19, 2022
0057013
Remove `setup.py`
adam-grant-hendry Apr 22, 2022
2613eb2
Bump version to 0.1.11
adam-grant-hendry Apr 22, 2022
3a32203
Merge branch 'release/0.1.11'
adam-grant-hendry Apr 22, 2022
d761874
Merge tag '0.1.11' into develop
adam-grant-hendry Apr 22, 2022
a508d76
Change build tool to poetry
adam-grant-hendry Apr 22, 2022
b6839d2
Bump version to 0.1.12
adam-grant-hendry Apr 22, 2022
c1384a2
Merge branch 'release/0.1.12'
adam-grant-hendry Apr 22, 2022
9c9cf2a
Merge tag '0.1.12' into develop
adam-grant-hendry Apr 22, 2022
8bd4b6e
Build Linux and Windows wheels with GitHub Actions
adam-grant-hendry Apr 22, 2022
f10dd84
Bump version to 0.2.0
adam-grant-hendry Apr 22, 2022
fe47e10
Merge branch 'release/0.2.0'
adam-grant-hendry Apr 22, 2022
6b18bb5
Merge tag '0.2.0' into develop
adam-grant-hendry Apr 22, 2022
d640f7d
Add linux, macos, and windows workflows
adam-grant-hendry Apr 22, 2022
ccfd15b
Update `wheels.yml`
adam-grant-hendry Apr 22, 2022
7c4794b
Ignore cp36, cp37, and cp310 in build
adam-grant-hendry Apr 22, 2022
4385e8e
Remove packages from `pyproject.toml`
adam-grant-hendry Apr 22, 2022
ee10edc
Remove `wheelhouse` outputdir
adam-grant-hendry Apr 22, 2022
221331a
Specify platform ids
adam-grant-hendry Apr 22, 2022
db9b6d7
Update `pyproject.toml`
adam-grant-hendry Apr 22, 2022
d98419f
Update embree include paths in `build.py`
adam-grant-hendry Apr 22, 2022
4c34462
More bugfixes
adam-grant-hendry Apr 22, 2022
fab117e
Add `setup.py`
adam-grant-hendry Apr 22, 2022
39f60e9
Relative local import to `build.py`
adam-grant-hendry Apr 22, 2022
1be469e
Add `build.py` to `include` in `pyproject.toml`
adam-grant-hendry Apr 22, 2022
e2f2774
Update `setup.py`
adam-grant-hendry Apr 22, 2022
2e4f6d4
Add local package install to `wheels.yml`
adam-grant-hendry Apr 22, 2022
2f62999
Use `pip-action` to editable install `pyembree`
adam-grant-hendry Apr 22, 2022
bbdaefb
Hardcode version number in `setup.py`
adam-grant-hendry Apr 22, 2022
7c00533
Fix import from folder `embree2` in `rtcore_ray.h`
adam-grant-hendry Apr 22, 2022
4846ef5
Load version number form `pyembree/_version.py`
adam-grant-hendry Apr 22, 2022
bc04e94
Fix paths to libraries
adam-grant-hendry Apr 22, 2022
4aae4e6
Fix path to DLLs for `delvewheel` in `wheels.yml`
adam-grant-hendry Apr 22, 2022
46678bb
Correct paths
adam-grant-hendry Apr 22, 2022
a4e32b5
Correct paths again
adam-grant-hendry Apr 22, 2022
d45b55e
Correct `embree_windows.bat` script
Apr 24, 2022
8100f08
Update `wheel.yml`
Apr 25, 2022
ca7e07a
Merge branch 'bugfix/github_actions' into develop
Apr 26, 2022
3f5c53d
Bump version to 0.2.1
Apr 26, 2022
cf25f69
Merge branch 'release/0.2.1'
Apr 26, 2022
40bca03
Merge tag '0.2.1' into develop
Apr 26, 2022
98ea252
Add upload to PyPI github action
Apr 26, 2022
5d16ad5
Bump version to 0.2.2
Apr 26, 2022
5b5be0e
Merge branch 'release/0.2.2'
Apr 26, 2022
dfbe2e1
Merge tag '0.2.2' into develop
Apr 26, 2022
ac91598
Switch to `twine` for PyPI upload
Apr 26, 2022
afec118
Bump version to 0.2.3
Apr 26, 2022
8fcdcba
Merge branch 'release/0.2.3'
Apr 26, 2022
fcb5a49
Merge tag '0.2.3' into develop
Apr 26, 2022
8e12735
Fix `README.rst`
adam-grant-hendry Apr 26, 2022
30c2e18
Bump version to 0.2.4
adam-grant-hendry Apr 26, 2022
50ab68c
Merge branch 'release/0.2.4'
adam-grant-hendry Apr 26, 2022
56a1fce
Merge tag '0.2.4' into develop
adam-grant-hendry Apr 26, 2022
dbf4d3e
Fix PyPI github action
adam-grant-hendry Apr 26, 2022
2058c43
Bump version to 0.2.5
adam-grant-hendry Apr 26, 2022
84f38e9
Merge branch 'release/0.2.5'
adam-grant-hendry Apr 26, 2022
9c284f1
Merge tag '0.2.5' into develop
adam-grant-hendry Apr 26, 2022
e41b1d7
Update `wheels.yml`
adam-grant-hendry Apr 26, 2022
b3a78c7
Bump version to 0.2.6
adam-grant-hendry Apr 26, 2022
b1d1f5a
Merge branch 'release/0.2.6'
adam-grant-hendry Apr 26, 2022
7aa9953
Merge tag '0.2.6' into develop
adam-grant-hendry Apr 26, 2022
9404abe
Update `wheels.yml`
adam-grant-hendry Apr 26, 2022
088ce2c
Bump version to 0.2.7
adam-grant-hendry Apr 26, 2022
0334c50
Merge branch 'release/0.2.7'
adam-grant-hendry Apr 26, 2022
6742905
Merge tag '0.2.7' into develop
adam-grant-hendry Apr 26, 2022
7770aef
Update `wheel.yml`
adam-grant-hendry Apr 26, 2022
fcb92e4
Bump version to 0.2.8
adam-grant-hendry Apr 26, 2022
9ec8030
Merge branch 'release/0.2.8'
adam-grant-hendry Apr 26, 2022
6f87eb7
Merge tag '0.2.8' into develop
adam-grant-hendry Apr 26, 2022
2a1c6da
Update `wheel.yml`
adam-grant-hendry Apr 26, 2022
cc68693
Bump version to 0.2.9
adam-grant-hendry Apr 26, 2022
cd1ac2b
Merge branch 'release/0.2.9'
adam-grant-hendry Apr 26, 2022
c533c03
Merge tag '0.2.9' into develop
adam-grant-hendry Apr 26, 2022
2f9db2b
Fix `wheels.yml`
adam-grant-hendry Apr 28, 2022
eaa8cd6
Bump version to 0.2.10
adam-grant-hendry Apr 28, 2022
3246699
Merge branch 'release/0.2.10'
adam-grant-hendry Apr 28, 2022
498ab37
Merge tag '0.2.10' into develop
adam-grant-hendry Apr 28, 2022
5187cfb
Add python scripts folder to path for MacOS builds
adam-grant-hendry Apr 28, 2022
f20481d
Bump version to 0.2.11
adam-grant-hendry Apr 28, 2022
145a60f
Merge branch 'release/0.2.11'
adam-grant-hendry Apr 28, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 115 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: Build and Upload to PyPI

on: [push, pull_request, workflow_dispatch]

jobs:
build_wheels:

name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
include:
# Windows
- os: windows-latest
python: 38
bitness: 64
platform_id: win_amd64

# Ubuntu
- os: ubuntu-latest
python: 38
bitness: 64
platform_id: manylinux_x86_64
manylinux_image: manylinux2014

# MacOS
- os: macos-latest
python: 38
bitness: 64
platform_id: macosx_x86_64

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Install Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Add Python Scripts Directory to Path (MacOS)
if: matrix.os == 'macos-latest'
run: |
echo "/Library/Frameworks/Python.framework/Versions/3.8/bin" >> $GITHUB_PATH

- name: Install `cibuildwheel` (Windows)
if: matrix.os == 'windows-latest'
run: python -m pip install cibuildwheel

- name: Install `cibuildwheel` (Linux/MacOS)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run: python3 -m pip install cibuildwheel

- name: Build wheels
uses: pypa/[email protected]
with:
package-dir: ${{ matrix.package-dir }}
env:
CIBW_SKIP: pp* cp36* cp37* cp39* cp310* *-win32 *musllinux*
CIBW_ARCHS: auto64
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }}
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }}
CIBW_BUILD_VERBOSITY: 1
CIBW_BEFORE_BUILD_LINUX: |
yum install -y wget
bash {project}/ci/embree_linux.bash
CIBW_BEFORE_BUILD_MACOS: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew install bash
bash {project}/ci/embree_macos.bash
CIBW_BEFORE_BUILD_WINDOWS: |
cmd.exe /c "{project}\\ci\\embree_windows.bat" & python -m pip install delvewheel
CIBW_REPAIR_WHEEL_COMMAND_LINUX: |
export LD_LIBRARY_PATH="/project/pyembree/embree/lib"
auditwheel repair -w {dest_dir} {wheel}
CIBW_REPAIR_WHEEL_COMMAND_MACOS: |
export DYLD_FALLBACK_LIBRARY_PATH="${GITHUB_WORKSPACE}/pyembree/embree/lib"
delocate-listdeps {wheel}
delocate-wheel --require-archs {delocate_archs} -w {dest_dir} {wheel}
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >
delvewheel repair
--add-path %GITHUB_WORKSPACE%\\pyembree\\embree\\bin
--no-mangle tbb.dll;tbbmalloc.dll;embree.dll
-w {dest_dir} {wheel}

- uses: actions/upload-artifact@v2
with:
name: wheels
path: ./wheelhouse/*

- name: Upload To PyPI (Windows)
if: |
matrix.os == 'windows-latest' &&
github.event_name == 'push' &&
startsWith(github.ref, 'refs/tags')
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python -m pip install twine
twine upload ./wheelhouse/*

- name: Upload To PyPI (Linux/MacOS)
if: |
( matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' ) &&
github.event_name == 'push' &&
startsWith(github.ref, 'refs/tags')
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python3 -m pip install twine
twine upload ./wheelhouse/*
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,12 @@ dist/
.vscode
# Rever
rever/

# Virtual environment folders
.venv/

# Shared libs
*.pyd

# Embree folder
pyembree/embree/
13 changes: 0 additions & 13 deletions .travis-install.sh

This file was deleted.

41 changes: 0 additions & 41 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
recursive-include pyembree *.pyd *.so
9 changes: 4 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,18 @@ Python Wrapper for Embree

Installation
------------
You can install pyembree (and embree) via the conda-forge package.
You can install pyembree (and embree) via ``pip``

.. code-block:: bash

$ conda install -c conda-forge pyembree
$ pip install pyembree



Suppressing errors
Suppressing Errors
------------------

Creating multiple scenes produces some harmless error messages:
::

ERROR CAUGHT IN EMBREE
ERROR: Invalid operation
ERROR MESSAGE: b'already initialized'
Expand Down
99 changes: 99 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
import os
from typing import Any, Dict, List

import numpy as np

# setuptools must be imported before cython. setuptools overrides the
# distutils.extension.Extension class. If imported after, the isinstance check in
# distutils.command.check_extensions_list fails and setuptools gives the erroneous
# error:
#
# "error: each element of 'ext_modules' option must be an Extension instance or 2-tuple"
#
# ref: https://github.com/cython/cython/issues/4724
from setuptools import find_packages # isort: skip
from setuptools.command.build_ext import build_ext # isort: skip
from setuptools.extension import Extension # isort: skip
from Cython.Build import cythonize # isort: skip

cwd = os.path.dirname(__file__)
package_dir = os.path.join(cwd, "pyembree")
dependencies_dir = os.path.join(package_dir, "embree")

version_file = os.path.join(package_dir, "_version.py")

with open(version_file, mode="r") as fd:
exec(fd.read())

include = [
np.get_include(),
os.path.join(dependencies_dir, "include", "embree2"),
]
library = [
os.path.join(dependencies_dir, "lib"),
os.path.join(dependencies_dir, "bin"),
]

packages = ["pyembree"]

with open("README.rst", encoding="utf-8") as file_:
readme = file_.read()


def build(setup_kwargs: Dict[str, Any]) -> None:
ext_modules: List[Extension] = cythonize(
module_list="pyembree/*.pyx",
language_level=3,
include_path=include,
)

for ext in ext_modules:
ext.include_dirs = include
ext.library_dirs = library
if os.name == "nt":
ext.libraries = [
"embree",
"tbb",
"tbbmalloc",
]
else:
# It is recommended to build against tbb and tbbmalloc, which may improve
# the library's runtime performance. However, to be a 'manylinux' wheel, these
# must be removed for maximum portability.
#
# See also `ci/embree_linux.bash`
#
ext.libraries = [
"embree",
# "tbb", # Uncomment to build against tbb
# "tbbmalloc" # Uncomment to build against tbb
]

setup_kwargs.update(
{
"name": "pyembree",
"version": __version__,
"description": "Python wrapper for Intel Embree 2.17.7",
"long_description": readme,
"long_description_content_type": "text/x-rst",
"author": "Anthony Scopatz",
"author_email": "[email protected]",
"maintainer": "Adam Hendry",
"maintainer_email": "[email protected]",
"url": "https://github.com/adam-grant-hendry/pyembree",
"ext_modules": ext_modules,
"cmdclass": {"build_ext": build_ext},
"zip_safe": False,
"packages": find_packages(),
"packages": packages,
"python_requires": ">=3.8,<3.9",
"classifiers": [
"License :: OSI Approved :: BSD License",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows :: Windows 10",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
],
}
)
35 changes: 35 additions & 0 deletions ci/embree_linux.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash
set -xe

VERSION="2.17.7"

rm -rf embree.tar.gz
rm -rf embree

wget -nv https://github.com/embree/embree/releases/download/v${VERSION}/embree-${VERSION}.x86_64.linux.tar.gz -O embree.tar.gz
tar -zxvf embree.tar.gz
rm -f embree.tar.gz

if [[ ! -d pyembree/embree ]]; then
mkdir -p pyembree/embree
fi

# Rename unzipped folder for cdef extern statements
mv "embree-${VERSION}.x86_64.linux" embree

# It is recommended to build against tbb and tbbmalloc, which may improve
# the library's runtime performance. However, to be a 'manylinux' wheel, these
# must be removed for maximum portability.
#
# If building against tbb is desired, Intel only provides a symlink to embree in the
# tarball. Symlinks to the correct versions of the libraries must be made.
#
# Uncomment this code to build against tbb:
#
# cd embree/lib
# ln -s libtbb.so.2 libtbb.so
# ln -s libtbbmalloc.so.2 libtbbmalloc.so
# cd ../..

# pyembree looks for headers in embree subfolder
mv embree pyembree
21 changes: 21 additions & 0 deletions ci/embree_macos.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
set -xe

VERSION="2.17.7"

rm -rf embree.tar.gz
rm -rf embree

wget -nv https://github.com/embree/embree/releases/download/v${VERSION}/embree-${VERSION}.x86_64.macosx.tar.gz -O embree.tar.gz
tar -zxvf embree.tar.gz
rm -f embree.tar.gz

if [[ ! -d pyembree/embree ]]; then
mkdir -p pyembree/embree
fi

# Rename unzipped folder for cdef extern statements
mv "embree-${VERSION}.x86_64.macosx" embree

# pyembree looks for headers in embree subfolder
mv embree pyembree
9 changes: 9 additions & 0 deletions ci/embree_windows.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
curl -L -o embree.zip https://github.com/embree/embree/releases/download/v2.17.7/embree-2.17.7.x64.windows.zip
7z x embree.zip
del embree.zip

@REM Rename unzipped folder for cdef extern statements
ren embree-2.17.7.x64.windows embree

@REM pyembree looks for headers in embree subfolder
move /Y embree pyembree
Loading