Skip to content

Commit f917b1f

Browse files
author
Jaime R. Calzada
committed
Add pyproject.toml, poetry.lock and install_jigsaw.py.
In principle, this should be able to reproduce the functionality of the current setup.py into a poetry environment.
1 parent d9d70e6 commit f917b1f

File tree

3 files changed

+136
-0
lines changed

3 files changed

+136
-0
lines changed

install_jigsaw.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
from pathlib import Path
2+
import shutil
3+
import subprocess
4+
5+
def run():
6+
src_parent = Path(__file__).parent.resolve()
7+
jigsaw_src_dir = src_parent / "external/jigsaw"
8+
cmake_build_dir = jigsaw_src_dir / "build"
9+
cmake_build_dir.mkdir(exist_ok=True)
10+
subprocess.run(
11+
[
12+
"cmake",
13+
'..',
14+
"-DCMAKE_BUILD_TYPE=Release",
15+
"-DCMAKE_INSTALL_PREFIX=."
16+
],
17+
cwd=cmake_build_dir
18+
)
19+
subprocess.run(["make", f"-j4"], cwd=cmake_build_dir)
20+
subprocess.run(["make", f"-j4", "install"], cwd=cmake_build_dir)
21+
exesrc_path = cmake_build_dir / "bin"
22+
libsrc_path = cmake_build_dir / "lib"
23+
exedst_path = src_parent / "jigsawpy/_bin"
24+
libdst_path = src_parent / "jigsawpy/_lib"
25+
shutil.copytree(exesrc_path, exedst_path)
26+
shutil.copytree(libsrc_path, libdst_path)

poetry.lock

Lines changed: 76 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[tool.poetry]
2+
name = "jigsawpy"
3+
version = "1.0.0"
4+
description = "Python interface for the JIGSAW meshing library."
5+
authors = ["Darren Engwirda <[email protected]>"]
6+
homepage = "https://github.com/dengwirda/"
7+
keywords = ["Mesh-generation", "Delaunay", "Voronoi"]
8+
classifiers = [
9+
"Development Status :: 5 - Production/Stable",
10+
"Operating System :: OS Independent",
11+
"Intended Audience :: Science/Research",
12+
"Programming Language :: Python",
13+
"Programming Language :: Python :: 3",
14+
"Programming Language :: C++",
15+
"Topic :: Scientific/Engineering",
16+
"Topic :: Scientific/Engineering :: Mathematics",
17+
"Topic :: Scientific/Engineering :: Physics",
18+
"Topic :: Scientific/Engineering :: Visualization"
19+
]
20+
21+
[tool.poetry.dependencies]
22+
python = ">=3.9.0,<3.13"
23+
numpy = "^1.25.2"
24+
scipy = "^1.11.1"
25+
26+
[build-system]
27+
requires = ["poetry-core"]
28+
build-backend = "poetry.core.masonry.api"
29+
30+
[tool.poetry.scripts]
31+
install-jigsaw = 'install_jigsaw:run'
32+
33+
[tool.poetry.urls]
34+
"Github" = "https://github.com/dengwirda/"

0 commit comments

Comments
 (0)