Skip to content

Commit a523389

Browse files
authored
Merge pull request #11 from tataratat/dev/0.1.0
v0.1.0
2 parents 24800bc + abc5d15 commit a523389

29 files changed

+374
-439
lines changed

.github/workflows/build_and_test.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ${{ matrix.os }}
99
strategy:
1010
matrix:
11-
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
11+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1212
os: [macos-latest, ubuntu-20.04, windows-latest]
1313

1414
steps:
@@ -21,9 +21,7 @@ jobs:
2121
python-version: ${{ matrix.python-version}}
2222

2323
- name: Build tetgenpy
24-
run: |
25-
pip3 install numpy
26-
python3 setup.py develop
24+
run: pip install -e .
2725

2826
- name: Test
2927
run: python3 tests/test_tetgenpy.py

.github/workflows/docs.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,23 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
1313
with:
1414
submodules: recursive
1515
- name: Set up python
16-
uses: actions/setup-python@v3
16+
uses: actions/setup-python@v5
1717
with:
18-
python-version: 3.9
19-
20-
- name: install dependencies
21-
run: pip install numpy
18+
python-version: "3.11"
2219

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

2623
- name: test
2724
run: python3 tests/test_tetgenpy.py
2825

2926
- name: build docs
3027
run: |
3128
pip install -r ./docs/requirements.txt
32-
sphinx-apidoc -f -t docs/source/_templates -o docs/source tetgenpy
3329
sphinx-build -W -b html docs/source docs/build
3430
3531
- name: deploy docs only if it is pushed to main

.github/workflows/format.yml

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

.github/workflows/main.yml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,14 @@ jobs:
1717
cw_build: "pp*"
1818

1919
steps:
20-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
2121
with:
2222
submodules: recursive
2323
- name: build wheels
24-
uses: pypa/cibuildwheel@v2.13.1
24+
uses: pypa/cibuildwheel@v2.22
2525
env:
2626
CIBW_ARCHS: ${{ matrix.arch }}
2727
CIBW_BUILD: ${{ matrix.cw_build }}
28-
CIBW_TEST_SKIP: "*-macosx_arm64"
2928

3029
- uses: actions/upload-artifact@v3
3130
with:
@@ -41,11 +40,11 @@ jobs:
4140

4241

4342
steps:
44-
- uses: actions/checkout@v3
43+
- uses: actions/checkout@v4
4544
with:
4645
submodules: recursive
4746
- name: build wheels
48-
uses: pypa/cibuildwheel@v2.13.1
47+
uses: pypa/cibuildwheel@v2.22
4948
env:
5049
CIBW_ARCHS: ${{ matrix.arch }}
5150
CIBW_BUILD: ${{ matrix.cw_build }}
@@ -60,17 +59,13 @@ jobs:
6059
strategy:
6160
matrix:
6261
arch: [aarch64, ppc64le]
63-
cw_build: ["cp36*many*", "cp37*many*", "cp38*many*", "cp39*many*", "cp310*many*", "cp311*many*", "pp37*many*", "pp38*many*", "pp39*many*"]
62+
cw_build: ["cp*many*", "pp*many*"]
6463
exclude:
6564
- arch: ppc64le
66-
cw_build: "pp37*many*"
67-
- arch: ppc64le
68-
cw_build: "pp38*many*"
69-
- arch: ppc64le
70-
cw_build: "pp39*many*"
65+
cw_build: "pp*many*"
7166

7267
steps:
73-
- uses: actions/checkout@v3
68+
- uses: actions/checkout@v4
7469
with:
7570
submodules: recursive
7671

@@ -81,7 +76,7 @@ jobs:
8176
platforms: arm64, ppc64le
8277

8378
- name: build wheels
84-
uses: pypa/cibuildwheel@v2.13.1
79+
uses: pypa/cibuildwheel@v2.22
8580
env:
8681
CIBW_ARCHS: ${{ matrix.arch }}
8782
CIBW_BUILD: ${{ matrix.cw_build }}
@@ -100,11 +95,11 @@ jobs:
10095
arch: [x86, AMD64]
10196

10297
steps:
103-
- uses: actions/checkout@v3
98+
- uses: actions/checkout@v4
10499
with:
105100
submodules: recursive
106101
- name: build wheels
107-
uses: pypa/cibuildwheel@v2.16.2
102+
uses: pypa/cibuildwheel@v2.22
108103
env:
109104
CIBW_ARCHS: ${{ matrix.arch }}
110105

@@ -117,7 +112,7 @@ jobs:
117112
source_dist:
118113
runs-on: ubuntu-latest
119114
steps:
120-
- uses: actions/checkout@v3
115+
- uses: actions/checkout@v4
121116
with:
122117
submodules: recursive
123118

.pre-commit-config.yaml

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@ ci:
1111

1212
repos:
1313
- repo: https://github.com/pre-commit/pre-commit-hooks
14-
rev: "v4.4.0"
14+
rev: "v5.0.0"
1515
hooks:
1616
- id: check-added-large-files
1717
- id: check-case-conflict
1818
- id: check-docstring-first
19-
#exclude: '^splinepy/settings.py$'
2019
- id: check-merge-conflict
2120
- id: check-symlinks
2221
- id: check-toml
@@ -27,31 +26,38 @@ repos:
2726
- id: requirements-txt-fixer
2827
- id: trailing-whitespace
2928

30-
- repo: https://github.com/asottile/pyupgrade
31-
rev: "v3.14.0"
32-
hooks:
33-
- id: pyupgrade
34-
args: [--py36-plus]
35-
36-
- repo: https://github.com/PyCQA/isort
37-
rev: "5.12.0"
38-
hooks:
39-
- id: isort
40-
4129
- repo: https://github.com/psf/black
42-
rev: "23.9.1"
30+
rev: "24.10.0"
4331
hooks:
4432
- id: black
45-
args: [--line-length=79]
33+
additional_dependencies: [tomli]
4634

47-
- repo: https://github.com/PyCQA/flake8
48-
rev: 6.1.0
35+
- repo: https://github.com/astral-sh/ruff-pre-commit
36+
rev: v0.8.3
4937
hooks:
50-
- id: flake8
51-
args: [--extend-ignore=E203]
38+
- id: ruff
39+
args: [--fix, --exit-non-zero-on-fix]
5240

5341
- repo: https://github.com/pre-commit/mirrors-clang-format
54-
rev: v16.0.6
42+
rev: v19.1.5
5543
hooks:
5644
- id: clang-format
57-
types_or: [c++]
45+
types_or: [c, c++]
46+
47+
- repo: https://github.com/cheshirekow/cmake-format-precommit
48+
rev: "v0.6.13"
49+
hooks:
50+
- id: cmake-format
51+
52+
- repo: https://github.com/codespell-project/codespell
53+
rev: v2.3.0
54+
hooks:
55+
- id: codespell
56+
args: [-w]
57+
additional_dependencies: [tomli]
58+
59+
- repo: https://github.com/keewis/blackdoc
60+
rev: v0.3.9
61+
hooks:
62+
- id: blackdoc
63+
additional_dependencies: [tomli]

CMakeLists.txt

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
cmake_minimum_required(VERSION 3.1)
2-
project(tetgenpy VERSION 0.0.0 LANGUAGES CXX)
1+
cmake_minimum_required(VERSION 3.15)
2+
project(
3+
tetgenpy
4+
VERSION 0.1.0
5+
LANGUAGES CXX)
36

47
# config
58
set(exe_dest "bin")
@@ -26,18 +29,27 @@ set(TETGENPY_DEFS)
2629

2730
if(CMAKE_BUILD_TYPE MATCHES Debug)
2831

29-
# compiler specific flags
32+
# compiler specific flags
3033
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
31-
set(TETGENPY_FLAGS ${TETGENPY_FLAGS}
32-
-Wall -Wextra -Wpedantic -Wzero-as-null-pointer-constant -Wno-unused)
34+
set(TETGENPY_FLAGS ${TETGENPY_FLAGS} -Wall -Wextra -Wpedantic
35+
-Wzero-as-null-pointer-constant -Wno-unused)
3336
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
34-
set(TETGENPY_FLAGS ${TETGENPY_FLAGS}
35-
-Wall -Wextra -Wmost -Wextra -Wpedantic -Wunreachable-code
36-
-Wshadow -Wfloat-equal -Weffc++ -Wno-unused-parameter
37-
-Wno-unused-variable -Wzero-as-null-pointer-constant)
37+
set(TETGENPY_FLAGS
38+
${TETGENPY_FLAGS}
39+
-Wall
40+
-Wextra
41+
-Wmost
42+
-Wextra
43+
-Wpedantic
44+
-Wunreachable-code
45+
-Wshadow
46+
-Wfloat-equal
47+
-Weffc++
48+
-Wno-unused-parameter
49+
-Wno-unused-variable
50+
-Wzero-as-null-pointer-constant)
3851
else()
39-
message(WARNING
40-
"tetgenpy is only tested with GNU and Clang.")
52+
message(WARNING "tetgenpy is only tested with GNU and Clang.")
4153
endif()
4254
endif()
4355

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

4759
# configure config files
4860
include(CMakePackageConfigHelpers)
49-
write_basic_package_version_file(
50-
"${version_config}" COMPATIBILITY SameMajorVersion
51-
)
52-
configure_package_config_file(
53-
"cmake/config.cmake.in"
54-
"${project_config}"
55-
INSTALL_DESTINATION "${cfg_dest}"
56-
)
61+
write_basic_package_version_file("${version_config}"
62+
COMPATIBILITY SameMajorVersion)
63+
configure_package_config_file("cmake/config.cmake.in" "${project_config}"
64+
INSTALL_DESTINATION "${cfg_dest}")
5765

5866
if(TETGEN_BUILD_LIBRARY)
5967
install(
60-
TARGETS tetgen
61-
EXPORT "${TARGETS_EXPORT_NAME}"
62-
LIBRARY DESTINATION ${lib_dest}
63-
ARCHIVE DESTINATION ${lib_dest}
64-
INCLUDES DESTINATION "${incl_dest}"
65-
)
68+
TARGETS tetgen
69+
EXPORT "${TARGETS_EXPORT_NAME}"
70+
LIBRARY DESTINATION ${lib_dest}
71+
ARCHIVE DESTINATION ${lib_dest}
72+
INCLUDES
73+
DESTINATION "${incl_dest}")
6674
endif()
6775

6876
if(TETGEN_BUILD_EXECUTABLE)
6977
install(
7078
TARGETS tetgen_exec
7179
EXPORT ${TARGETS_EXPORT_NAME}
72-
RUNTIME DESTINATION ${exec_dest}
73-
)
80+
RUNTIME DESTINATION ${exec_dest})
7481
endif()
7582

76-
install(
77-
FILES "${project_config}" "${version_config}"
78-
DESTINATION "${cfg_dest}"
79-
)
83+
install(FILES "${project_config}" "${version_config}" DESTINATION "${cfg_dest}")
8084

8185
install(
82-
EXPORT "${TARGETS_EXPORT_NAME}"
83-
NAMESPACE "${namespace}"
84-
DESTINATION "${cfg_dest}"
85-
)
86-
install(
87-
FILES ${CXX_HEADERS}
88-
DESTINATION ${incl_dest}
89-
)
86+
EXPORT "${TARGETS_EXPORT_NAME}"
87+
NAMESPACE "${namespace}"
88+
DESTINATION "${cfg_dest}")
89+
install(FILES ${CXX_HEADERS} DESTINATION ${incl_dest})

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
tetgenpy welcomes and appreciates discussions, issues and pull requests!
33

44
## Quick start
5-
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`
5+
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`
66
```bash
7-
conda create -n tetgenpyenv python=3.9
7+
conda create -n tetgenpyenv python=3.11
88
conda activate tetgenpyenv
99
git clone [email protected]:<path-to-your-fork>
1010
cd tetgenpy # or <forkname>
1111
git submodule update --init --recursive
1212
git checkout -b new-feature0
13-
python3 setup.py develop
13+
pip install -e .
1414
```
1515

1616
## Automatic formatting / style check
1717
To check the format and style of your code use the following commands at tetgenpy root:
1818
```bash
1919
pip install pre-commit
20-
precommit run -a
20+
pre-commit run -a
2121
```

README.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# tetgenpy
2+
<p align="center"><img src="https://github.com/tataratat/tetgenpy/raw/main/docs/source/_static/tetgenpy.png" width="50%" title="tet"></p>
3+
24
[![main](https://github.com/tataratat/tetgenpy/actions/workflows/main.yml/badge.svg)](https://github.com/tataratat/tetgenpy/actions/workflows/main.yml)
35
[![PyPI version](https://badge.fury.io/py/tetgenpy.svg)](https://badge.fury.io/py/tetgenpy)
46

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

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

0 commit comments

Comments
 (0)