Skip to content

Commit

Permalink
Merge pull request #7 from valboz/dev-2
Browse files Browse the repository at this point in the history
Update to v4.2
  • Loading branch information
valboz authored Jan 19, 2025
2 parents 0f4a30e + 554b346 commit dd9d952
Show file tree
Hide file tree
Showing 21 changed files with 249 additions and 256 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build

on:
push:
paths:
- '**.cpp'
- '**.h'
- '**.py'
- '**.toml'
- '**.yml'

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-13,macos-14] # was macos-latest

steps:
- uses: actions/checkout@v4

- name: Build wheels
uses: pypa/cibuildwheel@v2.22.0
env: #
MACOSX_DEPLOYMENT_TARGET: "10.15" #
# CIBW_SOME_OPTION: value
# ...
#with:
# package-dir: .
# output-dir: wheelhouse
# config-file: "{package}/pyproject.toml
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz


- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
42 changes: 42 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
### C++ template
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

### Example user template template
### Example user template

# IntelliJ project files
.idea
*.iml
out
gen
25 changes: 25 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
cmake_minimum_required(VERSION 3.19)

project(VBMicrolensing LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(MINIMUM_GCC_VERSION "9.0")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS MINIMUM_GCC_VERSION)
message(FATAL_ERROR "GCC must be ${MINIMUM_GCC_VERSION} or greater.")
endif()
endif()

# Find the module development requirements (requires FindPython from 3.17 or
# scikit-build-core's built-in backport)
find_package(Python REQUIRED COMPONENTS Interpreter Development.Module)
find_package(pybind11 CONFIG REQUIRED)

# Add a library using FindPython's tooling (pybind11 also provides a helper like
# this)
python_add_library(VBMicrolensing MODULE VBMicrolensing/lib/python_bindings.cpp VBMicrolensing/lib/VBMicrolensingLibrary.cpp VBMicrolensing/lib/VBMicrolensingLibrary.h)
target_link_libraries(VBMicrolensing PRIVATE pybind11::headers)

# The install directory is the output (wheel) directory
install(TARGETS VBMicrolensing DESTINATION VBMicrolensing)
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
graft VBMicrolensing/lib
include VBMicrolensing/data/*.*
graft VBMicrolensing/data
34 changes: 0 additions & 34 deletions Makefile

This file was deleted.

9 changes: 8 additions & 1 deletion VBMicrolensing/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
from .VBMicrolensing import VBMicrolensing
from .VBMicrolensing import VBMicrolensing

import inspect
import os

_fil_in=inspect.getfile(VBMicrolensing)
VBMicrolensing.SetESPLtablefile(os.path.join(os.path.join(os.path.dirname(_fil_in), 'data'), 'ESPL.tbl'))

Loading

0 comments on commit dd9d952

Please sign in to comment.