Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pyproject.toml and poetry.lock #20

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
from pathlib import Path
import shutil
import subprocess
import platform

def build():
src_parent = Path(__file__).parent.resolve()
exedst_path = src_parent / "jigsawpy/_bin"
libdst_path = src_parent / "jigsawpy/_lib"
syslib = {"Windows": "jigsaw.dll", "Linux": "libjigsaw.so", "Darwin": "libjigsaw.dylib"}
tgt_libsaw_path = libdst_path / syslib[platform.system()]
if not tgt_libsaw_path.is_file():
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)


build()
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.

42 changes: 42 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[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"
]
packages = [
{ include = "jigsawpy" },
]
include = [
{ path = "jigsawpy/_lib/*", format = "wheel" },
{ path = "jigsawpy/_bin/*", format = "wheel" },
]

[tool.poetry.dependencies]
python = ">=3.10"
numpy = "^1.25.2"
scipy = "^1.11.1"

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

[tool.poetry.build]
generate-setup-file = false
script = "build.py"

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