Skip to content

Commit

Permalink
Corrects build issues for pyso3 on macos (#22)
Browse files Browse the repository at this point in the history
* Build using skbuild primitives only

Because issues with CMake python primitives on macos.

* Update ssht to 1.3.4

* Bump to 1.3.1
  • Loading branch information
mdavezac authored Nov 24, 2020
1 parent a32c6af commit 1acac9a
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 53 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/conan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: create stable or testing package
shell: bash
run: |
if [ "${{ github.ref }}" = "refs/tags/v1.3.0" ]; then
if [ "${{ github.ref }}" = "refs/tags/v1.3.1" ]; then
channel="stable"
else
channel="testing"
Expand All @@ -53,4 +53,4 @@ jobs:
CONAN_PASSWORD: ${{secrets.BINTRAY_TOKEN}}
CONAN_LOGIN_USERNAME: astroinformaticsci
CONAN_REMOTE_URL: https://api.bintray.com/conan/astro-informatics/astro-informatics
run: conan upload so3/1.3.0 -c --all -r=astro-informatics
run: conan upload so3/1.3.1 -c --all -r=astro-informatics
4 changes: 2 additions & 2 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ jobs:
mv source-distribution/*.tar.gz wheel-*/*.whl dist
- name: Publish distribution 📦 to Test PyPI
if: ${{ github.ref != 'refs/tags/v1.3.0' }}
if: ${{ github.ref != 'refs/tags/v1.3.1' }}
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/

- name: Publish distribution 📦 to PyPI
if: ${{ github.ref == 'refs/tags/v1.3.0' }}
if: ${{ github.ref == 'refs/tags/v1.3.1' }}
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_TOKEN }}
8 changes: 2 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
cmake_minimum_required(VERSION 3.12)
project(
so3
VERSION "1.3.0"
VERSION "1.3.1"
DESCRIPTION "Fast and exact Wigner transforms"
HOMEPAGE_URL "http://astro-informatics.github.io/so3/"
LANGUAGES C)

option(tests "Enable testing" ON)
option(python "Creates python package only" OFF)
option(conan_deps "Download ssht using conan" ON)
if(NOT WIN32)
option(fPIC "Enable position independent code" ON)
Expand All @@ -33,12 +32,9 @@ if(tests)
add_subdirectory(tests)
endif()

if(NOT python)
if(NOT SKBUILD)
include("exporting")
else()
include("python-setup")
find_python()
setup_skbuild()
find_package(PythonExtensions REQUIRED)
find_package(Cython REQUIRED)
find_package(NumPy REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[docs-img]: https://img.shields.io/badge/docs-stable-blue.svg
[docs-url]: http://astro-informatics.github.io/so3/
[bintray-img]: https://img.shields.io/bintray/v/astro-informatics/astro-informatics/so3:astro-informatics?label=C%20package
[bintray-url]: https://bintray.com/astro-informatics/astro-informatics/so3:astro-informatics/1.3.0:stable/link
[bintray-url]: https://bintray.com/astro-informatics/astro-informatics/so3:astro-informatics/1.3.1:stable/link
[pypi-img]: https://badge.fury.io/py/so3.svg
[pypi-url]: https://badge.fury.io/py/so3
[codefactor-img]: https://www.codefactor.io/repository/github/astro-informatics/so3/badge/main
Expand Down
2 changes: 1 addition & 1 deletion cmake/conan_dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ elseif(NOT CONAN_OPTIONS)
list(APPEND CONAN_OPTIONS "ssht:fPIC=False")
endif()
if(NOT CONAN_DEPS)
set(CONAN_DEPS "ssht/1.3.3@astro-informatics/stable")
set(CONAN_DEPS "ssht/1.3.4@astro-informatics/stable")
endif()
if(NOT CONAN_BUILD)
set(CONAN_BUILD "missing")
Expand Down
29 changes: 0 additions & 29 deletions cmake/python-setup.cmake

This file was deleted.

4 changes: 2 additions & 2 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class So3Conan(ConanFile):
name = "so3"
version = "1.3.0"
version = "1.3.1"
license = "GPL-3"
url = "https://github.com/astro-informatics/so3"
homepage = "https://github.com/astro-informatics/so3"
Expand All @@ -25,7 +25,7 @@ class So3Conan(ConanFile):

def requirements(self):
location = "astro-informatics/stable" if self.in_local_cache else "user/testing"
self.requires(f"ssht/1.3.3@{location}")
self.requires(f"ssht/1.3.4@{location}")

def configure(self):
if self.settings.compiler == "Visual Studio":
Expand Down
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
CC = gcc

#OPT = -Wall -O3 -fopenmp -DSO3_VERSION=\"0.1\" -DSO3_BUILD=\"`git rev-parse HEAD`\"
OPT = -Wall -g -fopenmp -DSO3_VERSION=\"1.3.0\" -DSO3_BUILD=\"`git rev-parse HEAD`\"
OPT = -Wall -g -fopenmp -DSO3_VERSION=\"1.3.1\" -DSO3_BUILD=\"`git rev-parse HEAD`\"


# ======== LINKS ========
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.3.0
current_version = 1.3.1
commit = False
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(rc(?P<rc>\d+))?
Expand Down
7 changes: 2 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
from skbuild import setup

cmake_args = [
"-Dpython:BOOL=ON",
"-Dtests:BOOL=OFF",
]
cmake_args = ["-Dtests:BOOL=OFF"]

setup(
name="so3",
version="1.3.0",
version="1.3.1",
author="Jason McEwen",
install_requires=["numpy", "cython", "scipy"],
extras_require={
Expand Down
2 changes: 1 addition & 1 deletion src/c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if(fPIC)
set_target_properties(so3 PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
endif()

if(NOT python)
if(NOT SKBUILD)
install(
TARGETS so3
EXPORT So3Targets
Expand Down
5 changes: 3 additions & 2 deletions src/so3/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# add command to cythonize results
add_cython_target(cython_sources bindings.pyx C PY3)

python3_add_library(bindings MODULE WITH_SOABI ${cython_sources})
target_link_libraries(bindings PUBLIC so3)
add_library(bindings MODULE ${cython_sources})
python_extension_module(bindings)
target_link_libraries(bindings so3)
target_include_directories(bindings PUBLIC ${NumPy_INCLUDE_DIRS})
if(WIN32)
target_compile_definitions(bindings PUBLIC MS_WIN64)
Expand Down

0 comments on commit 1acac9a

Please sign in to comment.