Skip to content

Commit

Permalink
Merge pull request #11 from tataratat/dev/0.1.0
Browse files Browse the repository at this point in the history
v0.1.0
  • Loading branch information
j042 authored Jan 14, 2025
2 parents 24800bc + abc5d15 commit a523389
Show file tree
Hide file tree
Showing 29 changed files with 374 additions and 439 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
os: [macos-latest, ubuntu-20.04, windows-latest]

steps:
Expand All @@ -21,9 +21,7 @@ jobs:
python-version: ${{ matrix.python-version}}

- name: Build tetgenpy
run: |
pip3 install numpy
python3 setup.py develop
run: pip install -e .

- name: Test
run: python3 tests/test_tetgenpy.py
12 changes: 4 additions & 8 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,23 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: 3.9

- name: install dependencies
run: pip install numpy
python-version: "3.11"

- name: build tetgenpy
run: CC=clang-14 CXX=clang++-14 python3 setup.py develop
run: pip install -e .

- name: test
run: python3 tests/test_tetgenpy.py

- name: build docs
run: |
pip install -r ./docs/requirements.txt
sphinx-apidoc -f -t docs/source/_templates -o docs/source tetgenpy
sphinx-build -W -b html docs/source docs/build
- name: deploy docs only if it is pushed to main
Expand Down
15 changes: 0 additions & 15 deletions .github/workflows/format.yml

This file was deleted.

27 changes: 11 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@ jobs:
cw_build: "pp*"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- name: build wheels
uses: pypa/cibuildwheel@v2.13.1
uses: pypa/cibuildwheel@v2.22
env:
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_BUILD: ${{ matrix.cw_build }}
CIBW_TEST_SKIP: "*-macosx_arm64"

- uses: actions/upload-artifact@v3
with:
Expand All @@ -41,11 +40,11 @@ jobs:


steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- name: build wheels
uses: pypa/cibuildwheel@v2.13.1
uses: pypa/cibuildwheel@v2.22
env:
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_BUILD: ${{ matrix.cw_build }}
Expand All @@ -60,17 +59,13 @@ jobs:
strategy:
matrix:
arch: [aarch64, ppc64le]
cw_build: ["cp36*many*", "cp37*many*", "cp38*many*", "cp39*many*", "cp310*many*", "cp311*many*", "pp37*many*", "pp38*many*", "pp39*many*"]
cw_build: ["cp*many*", "pp*many*"]
exclude:
- arch: ppc64le
cw_build: "pp37*many*"
- arch: ppc64le
cw_build: "pp38*many*"
- arch: ppc64le
cw_build: "pp39*many*"
cw_build: "pp*many*"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive

Expand All @@ -81,7 +76,7 @@ jobs:
platforms: arm64, ppc64le

- name: build wheels
uses: pypa/cibuildwheel@v2.13.1
uses: pypa/cibuildwheel@v2.22
env:
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_BUILD: ${{ matrix.cw_build }}
Expand All @@ -100,11 +95,11 @@ jobs:
arch: [x86, AMD64]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- name: build wheels
uses: pypa/cibuildwheel@v2.16.2
uses: pypa/cibuildwheel@v2.22
env:
CIBW_ARCHS: ${{ matrix.arch }}

Expand All @@ -117,7 +112,7 @@ jobs:
source_dist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive

Expand Down
48 changes: 27 additions & 21 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.4.0"
rev: "v5.0.0"
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-docstring-first
#exclude: '^splinepy/settings.py$'
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
Expand All @@ -27,31 +26,38 @@ repos:
- id: requirements-txt-fixer
- id: trailing-whitespace

- repo: https://github.com/asottile/pyupgrade
rev: "v3.14.0"
hooks:
- id: pyupgrade
args: [--py36-plus]

- repo: https://github.com/PyCQA/isort
rev: "5.12.0"
hooks:
- id: isort

- repo: https://github.com/psf/black
rev: "23.9.1"
rev: "24.10.0"
hooks:
- id: black
args: [--line-length=79]
additional_dependencies: [tomli]

- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.3
hooks:
- id: flake8
args: [--extend-ignore=E203]
- id: ruff
args: [--fix, --exit-non-zero-on-fix]

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v16.0.6
rev: v19.1.5
hooks:
- id: clang-format
types_or: [c++]
types_or: [c, c++]

- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: "v0.6.13"
hooks:
- id: cmake-format

- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
args: [-w]
additional_dependencies: [tomli]

- repo: https://github.com/keewis/blackdoc
rev: v0.3.9
hooks:
- id: blackdoc
additional_dependencies: [tomli]
78 changes: 39 additions & 39 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
cmake_minimum_required(VERSION 3.1)
project(tetgenpy VERSION 0.0.0 LANGUAGES CXX)
cmake_minimum_required(VERSION 3.15)
project(
tetgenpy
VERSION 0.1.0
LANGUAGES CXX)

# config
set(exe_dest "bin")
Expand All @@ -26,18 +29,27 @@ set(TETGENPY_DEFS)

if(CMAKE_BUILD_TYPE MATCHES Debug)

# compiler specific flags
# compiler specific flags
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(TETGENPY_FLAGS ${TETGENPY_FLAGS}
-Wall -Wextra -Wpedantic -Wzero-as-null-pointer-constant -Wno-unused)
set(TETGENPY_FLAGS ${TETGENPY_FLAGS} -Wall -Wextra -Wpedantic
-Wzero-as-null-pointer-constant -Wno-unused)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(TETGENPY_FLAGS ${TETGENPY_FLAGS}
-Wall -Wextra -Wmost -Wextra -Wpedantic -Wunreachable-code
-Wshadow -Wfloat-equal -Weffc++ -Wno-unused-parameter
-Wno-unused-variable -Wzero-as-null-pointer-constant)
set(TETGENPY_FLAGS
${TETGENPY_FLAGS}
-Wall
-Wextra
-Wmost
-Wextra
-Wpedantic
-Wunreachable-code
-Wshadow
-Wfloat-equal
-Weffc++
-Wno-unused-parameter
-Wno-unused-variable
-Wzero-as-null-pointer-constant)
else()
message(WARNING
"tetgenpy is only tested with GNU and Clang.")
message(WARNING "tetgenpy is only tested with GNU and Clang.")
endif()
endif()

Expand All @@ -46,44 +58,32 @@ add_subdirectory(cpp/tetgenpy)

# configure config files
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
"${version_config}" COMPATIBILITY SameMajorVersion
)
configure_package_config_file(
"cmake/config.cmake.in"
"${project_config}"
INSTALL_DESTINATION "${cfg_dest}"
)
write_basic_package_version_file("${version_config}"
COMPATIBILITY SameMajorVersion)
configure_package_config_file("cmake/config.cmake.in" "${project_config}"
INSTALL_DESTINATION "${cfg_dest}")

if(TETGEN_BUILD_LIBRARY)
install(
TARGETS tetgen
EXPORT "${TARGETS_EXPORT_NAME}"
LIBRARY DESTINATION ${lib_dest}
ARCHIVE DESTINATION ${lib_dest}
INCLUDES DESTINATION "${incl_dest}"
)
TARGETS tetgen
EXPORT "${TARGETS_EXPORT_NAME}"
LIBRARY DESTINATION ${lib_dest}
ARCHIVE DESTINATION ${lib_dest}
INCLUDES
DESTINATION "${incl_dest}")
endif()

if(TETGEN_BUILD_EXECUTABLE)
install(
TARGETS tetgen_exec
EXPORT ${TARGETS_EXPORT_NAME}
RUNTIME DESTINATION ${exec_dest}
)
RUNTIME DESTINATION ${exec_dest})
endif()

install(
FILES "${project_config}" "${version_config}"
DESTINATION "${cfg_dest}"
)
install(FILES "${project_config}" "${version_config}" DESTINATION "${cfg_dest}")

install(
EXPORT "${TARGETS_EXPORT_NAME}"
NAMESPACE "${namespace}"
DESTINATION "${cfg_dest}"
)
install(
FILES ${CXX_HEADERS}
DESTINATION ${incl_dest}
)
EXPORT "${TARGETS_EXPORT_NAME}"
NAMESPACE "${namespace}"
DESTINATION "${cfg_dest}")
install(FILES ${CXX_HEADERS} DESTINATION ${incl_dest})
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
tetgenpy welcomes and appreciates discussions, issues and pull requests!

## Quick start
Once the repo is forked, one possible starting point would be creating a new python environments, for example, using [conda](https://docs.conda.io/en/latest/miniconda.html) with `python=3.9`
Once the repo is forked, one possible starting point would be creating a new python environments, for example, using [conda](https://docs.conda.io/en/latest/miniconda.html) with `python=3.11`
```bash
conda create -n tetgenpyenv python=3.9
conda create -n tetgenpyenv python=3.11
conda activate tetgenpyenv
git clone [email protected]:<path-to-your-fork>
cd tetgenpy # or <forkname>
git submodule update --init --recursive
git checkout -b new-feature0
python3 setup.py develop
pip install -e .
```

## Automatic formatting / style check
To check the format and style of your code use the following commands at tetgenpy root:
```bash
pip install pre-commit
precommit run -a
pre-commit run -a
```
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# tetgenpy
<p align="center"><img src="https://github.com/tataratat/tetgenpy/raw/main/docs/source/_static/tetgenpy.png" width="50%" title="tet"></p>

[![main](https://github.com/tataratat/tetgenpy/actions/workflows/main.yml/badge.svg)](https://github.com/tataratat/tetgenpy/actions/workflows/main.yml)
[![PyPI version](https://badge.fury.io/py/tetgenpy.svg)](https://badge.fury.io/py/tetgenpy)

Expand Down Expand Up @@ -70,14 +72,14 @@ This package also provides access to tetgen's binary executable. Try:
$ tetgen -h
```

## Dependencies
#### c++
- [tetgen](https://wias-berlin.de/software/index.jsp?id=TetGen&lang=1)
- [pybind11](https://github.com/pybind/pybind11)
#### python
- [numpy](https://numpy.org)
#### build
- [cmake](https://cmake.org)
- [setuptools](https://setuptools.pypa.io/en/latest/)
- [wheel](https://wheel.readthedocs.io/en/stable/)
- [cibuildwheel](https://github.com/pypa/cibuildwheel)
## Working with `vedo`
[vedo](https://vedo.embl.es) natively supports `tetgenpy.TetgenIO` types starting with version `>=2023.5.1`.
It is ___A python module for scientific analysis and visualization of эd objects___ that can be used to enhance further workflows.
You can find an example (same as above) [here](https://github.com/marcomusy/vedo/blob/master/examples/other/tetgen1.py) or simply try:
```bash
pip install vedo
vedo -r tetgen1
```

## Contributing
Write an [issue](https://github.com/tataratat/tetgenpy/issues) or create a pull request! A simple guideline can be found at [CONTRIBUTING.md](https://github.com/tataratat/tetgenpy/blob/main/CONTRIBUTING.md)
Loading

0 comments on commit a523389

Please sign in to comment.