Skip to content

Commit

Permalink
Add pyproject.toml, poetry.lock and install_jigsaw.py.
Browse files Browse the repository at this point in the history
In principle, this should be able to reproduce the functionality
of the current setup.py into a poetry environment.
  • Loading branch information
Jaime R. Calzada committed Aug 9, 2023
1 parent d9d70e6 commit f917b1f
Show file tree
Hide file tree
Showing 3 changed files with 136 additions and 0 deletions.
26 changes: 26 additions & 0 deletions install_jigsaw.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from pathlib import Path
import shutil
import subprocess

def run():
src_parent = Path(__file__).parent.resolve()
jigsaw_src_dir = src_parent / "external/jigsaw"
cmake_build_dir = jigsaw_src_dir / "build"
cmake_build_dir.mkdir(exist_ok=True)
subprocess.run(
[
"cmake",
'..',
"-DCMAKE_BUILD_TYPE=Release",
"-DCMAKE_INSTALL_PREFIX=."
],
cwd=cmake_build_dir
)
subprocess.run(["make", f"-j4"], cwd=cmake_build_dir)
subprocess.run(["make", f"-j4", "install"], cwd=cmake_build_dir)
exesrc_path = cmake_build_dir / "bin"
libsrc_path = cmake_build_dir / "lib"
exedst_path = src_parent / "jigsawpy/_bin"
libdst_path = src_parent / "jigsawpy/_lib"
shutil.copytree(exesrc_path, exedst_path)
shutil.copytree(libsrc_path, libdst_path)
76 changes: 76 additions & 0 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[tool.poetry]
name = "jigsawpy"
version = "1.0.0"
description = "Python interface for the JIGSAW meshing library."
authors = ["Darren Engwirda <[email protected]>"]
homepage = "https://github.com/dengwirda/"
keywords = ["Mesh-generation", "Delaunay", "Voronoi"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Operating System :: OS Independent",
"Intended Audience :: Science/Research",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: C++",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Scientific/Engineering :: Visualization"
]

[tool.poetry.dependencies]
python = ">=3.9.0,<3.13"
numpy = "^1.25.2"
scipy = "^1.11.1"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.scripts]
install-jigsaw = 'install_jigsaw:run'

[tool.poetry.urls]
"Github" = "https://github.com/dengwirda/"

0 comments on commit f917b1f

Please sign in to comment.