WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 698b5fc

Browse files
authored
Updating build infrastructure (#161)
* Updating build infrastructure * cibuildwheel tag name * skip all 32bit builds
1 parent c93aaba commit 698b5fc

File tree

5 files changed

+96
-115
lines changed

5 files changed

+96
-115
lines changed

.github/workflows/tests.yml

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,21 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
python-version: ["3.8", "3.9", "3.10"]
18-
os: [ubuntu-latest, macos-latest, windows-latest]
17+
python-version: ["3.8", "3.9", "3.10", "3.11"]
18+
os: [ubuntu-latest]
19+
include:
20+
- python-version: "3.10"
21+
os: macos-latest
22+
- python-version: "3.10"
23+
os: windows-latest
1924
steps:
2025
- name: Clone the repo
21-
uses: actions/checkout@v2
26+
uses: actions/checkout@v4
2227
with:
2328
fetch-depth: 0
2429
submodules: recursive
2530
- name: Set up Python ${{ matrix.python-version }}
26-
uses: actions/setup-python@v2
31+
uses: actions/setup-python@v4
2732
with:
2833
python-version: ${{ matrix.python-version }}
2934
- name: Install dependencies
@@ -38,12 +43,12 @@ jobs:
3843
runs-on: ubuntu-latest
3944
steps:
4045
- name: Clone the repo
41-
uses: actions/checkout@v2
46+
uses: actions/checkout@v4
4247
with:
4348
fetch-depth: 0
4449
submodules: recursive
4550
- name: Set up Python
46-
uses: actions/setup-python@v2
51+
uses: actions/setup-python@v4
4752
with:
4853
python-version: 3.9
4954
- name: Install dependencies
@@ -60,29 +65,29 @@ jobs:
6065
runs-on: ${{ matrix.os }}
6166
strategy:
6267
matrix:
63-
os: [ubuntu-20.04, windows-2019, macos-10.15]
68+
os: [ubuntu-latest, windows-latest, macos-latest]
6469
steps:
65-
- uses: actions/checkout@v2
70+
- uses: actions/checkout@v4
6671
with:
6772
submodules: true
6873
fetch-depth: 0
69-
- uses: pypa/cibuildwheel@2.5.0
74+
- uses: pypa/cibuildwheel@v2.16.2
7075
env:
71-
CIBW_SKIP: "*-win32 *-manylinux_i686"
76+
CIBW_SKIP: "*-win32 *_i686"
7277
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
73-
- uses: actions/upload-artifact@v2
78+
- uses: actions/upload-artifact@v3
7479
with:
7580
path: ./wheelhouse/*.whl
7681

7782
build_sdist:
7883
name: Build source distribution
7984
runs-on: ubuntu-latest
8085
steps:
81-
- uses: actions/checkout@v2
86+
- uses: actions/checkout@v4
8287
with:
8388
submodules: true
8489
fetch-depth: 0
85-
- uses: actions/setup-python@v2
90+
- uses: actions/setup-python@v4
8691
name: Install Python
8792
with:
8893
python-version: "3.9"
@@ -91,7 +96,7 @@ jobs:
9196
python -m pip install -U pip
9297
python -m pip install -U build
9398
python -m build --sdist .
94-
- uses: actions/upload-artifact@v2
99+
- uses: actions/upload-artifact@v3
95100
with:
96101
path: dist/*.tar.gz
97102

@@ -100,12 +105,12 @@ jobs:
100105
runs-on: ubuntu-latest
101106
if: github.event_name == 'release' && github.event.action == 'published'
102107
steps:
103-
- uses: actions/download-artifact@v2
108+
- uses: actions/download-artifact@v3
104109
with:
105110
name: artifact
106111
path: dist
107112

108-
- uses: pypa/gh-action-pypi-publish@v1.4.2
113+
- uses: pypa/gh-action-pypi-publish@v1.8.10
109114
with:
110115
user: __token__
111116
password: ${{ secrets.pypi_password }}

CMakeLists.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
cmake_minimum_required(VERSION 3.15...3.26)
2+
project(${SKBUILD_PROJECT_NAME} LANGUAGES CXX)
3+
4+
set(PYBIND11_NEWPYTHON ON)
5+
find_package(pybind11 CONFIG REQUIRED)
6+
7+
include_directories(
8+
"src/george/include"
9+
"vendor/eigen"
10+
)
11+
12+
pybind11_add_module(kernel_interface "src/george/kernel_interface.cpp")
13+
install(TARGETS kernel_interface LIBRARY DESTINATION .)
14+
15+
pybind11_add_module(_hodlr "src/george/solvers/_hodlr.cpp")
16+
install(TARGETS _hodlr LIBRARY DESTINATION ./solvers)

pyproject.toml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
1+
[project]
2+
name = "george"
3+
description = "Blazingly fast Gaussian Processes for regression."
4+
readme = "README.rst"
5+
authors = [{ name = "Daniel Foreman-Mackey", email = "[email protected]" }]
6+
requires-python = ">=3.7"
7+
license = { file = "LICENSE" }
8+
urls = { Homepage = "https://github.com/dfm/george" }
9+
dependencies = ["numpy", "scipy"]
10+
dynamic = ["version"]
11+
112
[build-system]
2-
requires = ["setuptools>=40.6.0", "wheel", "setuptools_scm[toml]", "pybind11"]
3-
build-backend = "setuptools.build_meta"
13+
requires = ["scikit-build-core", "pybind11"]
14+
build-backend = "scikit_build_core.build"
15+
16+
[tool.scikit-build]
17+
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
18+
sdist.include = ["src/george/george_version.py"]
19+
wheel.install-dir = "george"
20+
minimum-version = "0.5"
21+
build-dir = "build/{wheel_tag}"
422

523
[tool.setuptools_scm]
624
write_to = "src/george/george_version.py"

scripts/compile_kernels.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import os
2+
3+
import yaml
4+
from jinja2 import Template
5+
6+
7+
def compile_kernels(fns):
8+
template_dir = "templates"
9+
output_dir = os.path.join("src", "george")
10+
11+
with open(os.path.join(template_dir, "parser.h")) as f:
12+
PARSER_TEMPLATE = Template(f.read())
13+
with open(os.path.join(template_dir, "kernels.h")) as f:
14+
CPP_TEMPLATE = Template(f.read())
15+
with open(os.path.join(template_dir, "kernels.py")) as f:
16+
PYTHON_TEMPLATE = Template(f.read())
17+
18+
specs = []
19+
for i, fn in enumerate(fns):
20+
with open(fn, "r") as f:
21+
spec = yaml.load(f.read(), Loader=yaml.FullLoader)
22+
print("Found kernel '{0}'".format(spec["name"]))
23+
spec["index"] = i
24+
spec["reparams"] = spec.get("reparams", {})
25+
specs.append(spec)
26+
print("Found {0} kernel specifications".format(len(specs)))
27+
28+
fn = os.path.join(output_dir, "include", "george", "parser.h")
29+
with open(fn, "w") as f:
30+
print("Saving parser to '{0}'".format(fn))
31+
f.write(PARSER_TEMPLATE.render(specs=specs))
32+
fn = os.path.join(output_dir, "include", "george", "kernels.h")
33+
with open(fn, "w") as f:
34+
print("Saving C++ kernels to '{0}'".format(fn))
35+
f.write(CPP_TEMPLATE.render(specs=specs))
36+
fn = os.path.join(output_dir, "kernels.py")
37+
with open(fn, "w") as f:
38+
print("Saving Python kernels to '{0}'".format(fn))
39+
f.write(PYTHON_TEMPLATE.render(specs=specs))

setup.py

Lines changed: 0 additions & 97 deletions
This file was deleted.

0 commit comments

Comments
 (0)