Skip to content

Commit

Permalink
Merge pull request #43 from astro-informatics/cmake/macos
Browse files Browse the repository at this point in the history
Build issue on macos
  • Loading branch information
mdavezac authored Nov 24, 2020
2 parents 2856fbe + 7a61f0f commit 6493a2f
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 49 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/conan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: create stable package
shell: bash
run: |
if [ "${{ github.ref }}" = "refs/tags/v1.3.3" ]; then
if [ "${{ github.ref }}" = "refs/tags/v1.3.4" ]; then
channel="stable"
else
channel="testing"
Expand All @@ -54,4 +54,4 @@ jobs:

run: |
conan remote add astro-informatics ${CONAN_REMOTE_URL}
conan upload ssht/1.3.3 -c --all -r=astro-informatics
conan upload ssht/1.3.4 -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.3' }}
if: ${{ github.ref != 'refs/tags/v1.3.4' }}
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.3' }}
if: ${{ github.ref == 'refs/tags/v1.3.4' }}
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
Expand Up @@ -2,13 +2,12 @@ cmake_minimum_required(VERSION 3.12)

project(
Ssht
VERSION "1.3.3"
VERSION "1.3.4"
DESCRIPTION "Fast and exact spin spherical harmonic transforms"
HOMEPAGE_URL "http://astro-informatics.github.io/ssht/"
LANGUAGES C)

option(tests "Enable testing" ON)
option(python "Creates python package only" OFF)
option(conan_deps "Download dependencies using conan" OFF)
if(NOT WIN32)
option(fPIC "Compile with fPIC" ON)
Expand Down Expand Up @@ -36,12 +35,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 @@ -3,7 +3,7 @@
[docs-img]: https://img.shields.io/badge/docs-stable-blue.svg
[docs-url]: https://astro-informatics.github.io/ssht/
[bintray-img]: https://img.shields.io/bintray/v/astro-informatics/astro-informatics/ssht:astro-informatics?label=C%20package
[bintray-url]: https://bintray.com/astro-informatics/astro-informatics/ssht:astro-informatics/1.3.3:stable/link
[bintray-url]: https://bintray.com/astro-informatics/astro-informatics/ssht:astro-informatics/1.3.4:stable/link
[pypi-img]: https://badge.fury.io/py/pyssht.svg
[pypi-url]: https://badge.fury.io/py/pyssht
[codefactor-img]: https://www.codefactor.io/repository/github/astro-informatics/ssht/badge/main
Expand Down
29 changes: 0 additions & 29 deletions cmake/python-setup.cmake

This file was deleted.

2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class SshtConan(ConanFile):
name = "ssht"
version = "1.3.3"
version = "1.3.4"
license = "GPL-3.0"
url = "https://github.com/astro-informatics/ssht"
homepage = "https://github.com/astro-informatics/ssht"
Expand Down
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ======== COMPILER ========

CC = gcc
OPT = -std=c99 -pedantic -Wall -O3 -fopenmp -DSSHT_VERSION=\"1.3.3\" -DSSHT_BUILD=\"`git rev-parse HEAD`\"
OPT = -std=c99 -pedantic -Wall -O3 -fopenmp -DSSHT_VERSION=\"1.3.4\" -DSSHT_BUILD=\"`git rev-parse HEAD`\"
#OPT = -Wall -g -fopenmp -DSSHT_VERSION=\"1.0b1\" -DSSHT_BUILD=\"`git rev-parse HEAD`\"


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.3
current_version = 1.3.4
commit = False
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(rc(?P<rc>\d+))?
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from skbuild import setup

cmake_args = [
"-Dpython:BOOL=ON",
"-Dtests:BOOL=OFF",
"-Dconan_deps=ON",
"-DfPIC=ON",
Expand All @@ -27,7 +26,7 @@

setup(
name="pyssht",
version="1.3.3",
version="1.3.4",
author=[
"J. D. McEwen",
"C. R. G. Wallis",
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(ssht PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
endif()

if(NOT python)
if(NOT SKBUILD)
install(
TARGETS ssht
EXPORT SshtTargets
Expand Down
7 changes: 4 additions & 3 deletions src/pyssht/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
add_cython_target(cython_sources pyssht.pyx C PY3)
python3_add_library(pyssht MODULE WITH_SOABI ${cython_sources})
target_link_libraries(pyssht PUBLIC ssht)
add_library(pyssht MODULE ${cython_sources})
python_extension_module(pyssht)
target_link_libraries(pyssht ssht)
target_include_directories(pyssht PUBLIC "${PROJECT_SOURCE_DIR}/src/c"
${NumPy_INCLUDE_DIRS})
if(WIN32)
target_compile_definitions(pyssht PUBLIC MS_WIN64)
target_compile_definitions(pyssht PUBLIC MS_WIN64)
endif()
install(TARGETS pyssht LIBRARY DESTINATION src/pyssht)

0 comments on commit 6493a2f

Please sign in to comment.