-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix cython3 build * Fix style recommendation from flask8 * Added requirements.txt * Added test * Added workflow
- Loading branch information
1 parent
b30601e
commit 12185c3
Showing
6 changed files
with
105 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a single version of Python | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | ||
|
||
name: Python application | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 pytest | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Lint with flake8 | ||
run: | | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
- name: Install package | ||
run: | | ||
python setup.py install | ||
- name: Test with pytest | ||
run: | | ||
pytest | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
""" | ||
A simple test for pytetgen | ||
""" | ||
def test_simple(): | ||
import pytetgen | ||
import numpy as np | ||
import scipy.spatial | ||
N=100 | ||
np.random.seed(1) | ||
a=np.random.random(3*N).reshape(N,3) | ||
del1=pytetgen.Delaunay(a) | ||
del2=scipy.spatial.Delaunay(a) | ||
T1=np.sort(np.sort(del1.simplices,axis=1),axis=0) | ||
T2=np.sort(np.sort(del2.simplices,axis=1),axis=0) | ||
assert(np.all(T1==T2)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Cython | ||
numpy | ||
scipy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,8 @@ | |
from distutils.core import setup | ||
from distutils.extension import Extension | ||
from Cython.Distutils import build_ext | ||
from Cython.Build import cythonize | ||
import numpy as np | ||
import os | ||
import os | ||
import codecs | ||
|
||
# Get the long description from the README file | ||
|
@@ -14,47 +13,40 @@ | |
with codecs.open(os.path.join(here, 'README.rst'), encoding='utf-8') as f: | ||
long_description = f.read() | ||
|
||
|
||
|
||
|
||
setup( name = 'pytetgen', | ||
packages=['pytetgen'], | ||
version = '0.2.2', | ||
description = 'wrapper for the tetgen mesh generator', | ||
long_description=long_description, | ||
author = 'Marcello Sega', | ||
author_email = '[email protected]', | ||
url='https://github.com/Marcello-Sega/pytetgen', | ||
license='AGPLv3', | ||
classifiers=[ | ||
# How mature is this project? Common values are | ||
# 3 - Alpha | ||
# 4 - Beta | ||
# 5 - Production/Stable | ||
'Development Status :: 4 - Beta', | ||
|
||
# Indicate who your project is intended for | ||
'Intended Audience :: Science/Research', | ||
'Topic :: Scientific/Engineering :: Bio-Informatics', | ||
'Topic :: Scientific/Engineering :: Chemistry', | ||
'Topic :: Scientific/Engineering :: Physics', | ||
'Topic :: Software Development :: Libraries :: Python Modules', | ||
|
||
# Pick your license as you wish (should match "license" above) | ||
'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)', | ||
|
||
# Specify the Python versions you support here. In particular, ensure | ||
# that you indicate whether you support Python 2, Python 3 or both. | ||
'Programming Language :: Python :: 3', | ||
], | ||
ext_modules=[ | ||
Extension('pytetgen', | ||
sources=['pytetgen/tetgen.cxx','pytetgen/predicates.cxx','pytetgen/pytetgen.pyx'], | ||
compiler_directives={'language_level':3}, | ||
include_dirs=[np.get_include()], | ||
extra_compile_args=['-g0','-O0','-DTETLIBRARY'], | ||
language='c++'), | ||
], | ||
cmdclass = {'build_ext': build_ext}, | ||
install_requires=['triangle>=20200424'], | ||
) | ||
setup(name='pytetgen', | ||
packages=['pytetgen'], | ||
version='0.2.2', | ||
description='wrapper for the tetgen mesh generator', | ||
long_description=long_description, | ||
author='Marcello Sega', | ||
author_email='[email protected]', | ||
url='https://github.com/Marcello-Sega/pytetgen', | ||
license='AGPLv3', | ||
classifiers=[ | ||
# How mature is this project? Common values are | ||
# 3 - Alpha | ||
# 4 - Beta | ||
# 5 - Production/Stable | ||
'Development Status :: 4 - Beta', | ||
# Indicate who your project is intended for | ||
'Intended Audience :: Science/Research', | ||
'Topic :: Scientific/Engineering :: Bio-Informatics', | ||
'Topic :: Scientific/Engineering :: Chemistry', | ||
'Topic :: Scientific/Engineering :: Physics', | ||
'Topic :: Software Development :: Libraries :: Python Modules', | ||
# Pick your license as you wish (should match "license" above) | ||
'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)', | ||
# Specify the Python versions you support here. In particular, ensure | ||
# that you indicate whether you support Python 2, Python 3 or both. | ||
'Programming Language :: Python :: 3', | ||
], | ||
ext_modules=[ | ||
Extension('pytetgen', | ||
sources=['pytetgen/tetgen.cxx', 'pytetgen/predicates.cxx', 'pytetgen/pytetgen.pyx'], | ||
compiler_directives={'language_level': 3}, | ||
include_dirs=[np.get_include()], | ||
extra_compile_args=['-g0', '-O0', '-DTETLIBRARY'], | ||
language='c++'), | ||
], | ||
cmdclass={'build_ext': build_ext}, | ||
install_requires=['triangle>=20200424']) |