-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #338 from jcapriot/pyproject
Pyproject.toml
- Loading branch information
Showing
25 changed files
with
484 additions
and
225 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
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 |
---|---|---|
@@ -1 +1,16 @@ | ||
.git_archival.txt export-subst | ||
.git_archival.txt export-subst | ||
# Excluding files from an sdist generated by meson-python | ||
|
||
.azure-pipelines/* export-ignore | ||
.ci/* export-ignore | ||
docs/* export-ignore | ||
examples/* export-ignore | ||
tests/* export-ignore | ||
tutorials/* export-ignore | ||
|
||
.coveragerc export-ignore | ||
.flake8 export-ignore | ||
.git* export-ignore | ||
*.yml export-ignore | ||
*.yaml export-ignore | ||
requirements_style.txt export-ignore |
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 was deleted.
Oops, something went wrong.
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,9 @@ | ||
|
||
python_sources = [ | ||
'__init__.py', | ||
] | ||
|
||
py.install_sources( | ||
python_sources, | ||
subdir: 'discretize/Tests' | ||
) |
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,100 @@ | ||
# NumPy include directory | ||
# The try-except is needed because when things are | ||
# split across drives on Windows, there is no relative path and an exception | ||
# gets raised. There may be other such cases, so add a catch-all and switch to | ||
# an absolute path. Relative paths are needed when for example a virtualenv is | ||
# placed inside the source tree; Meson rejects absolute paths to places inside | ||
# the source tree. | ||
# For cross-compilation it is often not possible to run the Python interpreter | ||
# in order to retrieve numpy's include directory. It can be specified in the | ||
# cross file instead: | ||
# [properties] | ||
# numpy-include-dir = /abspath/to/host-pythons/site-packages/numpy/core/include | ||
# | ||
# This uses the path as is, and avoids running the interpreter. | ||
incdir_numpy = meson.get_external_property('numpy-include-dir', 'not-given') | ||
if incdir_numpy == 'not-given' | ||
incdir_numpy = run_command(py, | ||
[ | ||
'-c', | ||
'''import os | ||
import numpy as np | ||
try: | ||
incdir = os.path.relpath(np.get_include()) | ||
except Exception: | ||
incdir = np.get_include() | ||
print(incdir) | ||
''' | ||
], | ||
check: true | ||
).stdout().strip() | ||
else | ||
_incdir_numpy_abs = incdir_numpy | ||
endif | ||
inc_np = include_directories(incdir_numpy) | ||
np_dep = declare_dependency(include_directories: inc_np) | ||
|
||
# Deal with M_PI & friends; add `use_math_defines` to c_args or cpp_args | ||
# Cython doesn't always get this right itself (see, e.g., gh-16800), so | ||
# explicitly add the define as a compiler flag for Cython-generated code. | ||
is_windows = host_machine.system() == 'windows' | ||
if is_windows | ||
use_math_defines = ['-D_USE_MATH_DEFINES'] | ||
else | ||
use_math_defines = [] | ||
endif | ||
|
||
numpy_nodepr_api = '-DNPY_NO_DEPRECATED_API=NPY_1_9_API_VERSION' | ||
c_undefined_ok = ['-Wno-maybe-uninitialized'] | ||
|
||
cython_c_args = [numpy_nodepr_api, use_math_defines] | ||
|
||
cy_line_trace = get_option('cy_line_trace') | ||
if cy_line_trace | ||
cython_c_args += ['-DCYTHON_TRACE_NOGIL=1'] | ||
endif | ||
|
||
cython_cpp_args = cython_c_args | ||
|
||
module_path = 'discretize/_extensions' | ||
|
||
py.extension_module( | ||
'interputils_cython', | ||
'interputils_cython.pyx', | ||
include_directories: incdir_numpy, | ||
c_args: cython_c_args, | ||
install: true, | ||
subdir: module_path, | ||
dependencies : [py_dep, np_dep], | ||
) | ||
|
||
py.extension_module( | ||
'tree_ext', | ||
['tree_ext.pyx' , 'tree.cpp'], | ||
include_directories: incdir_numpy, | ||
cpp_args: cython_cpp_args, | ||
install: true, | ||
subdir: module_path, | ||
dependencies : [py_dep, np_dep], | ||
override_options : ['cython_language=cpp'], | ||
) | ||
|
||
py.extension_module( | ||
'simplex_helpers', | ||
'simplex_helpers.pyx', | ||
include_directories: incdir_numpy, | ||
cpp_args: cython_cpp_args, | ||
install: true, | ||
subdir: module_path, | ||
dependencies : [py_dep, np_dep], | ||
override_options : ['cython_language=cpp'], | ||
) | ||
|
||
python_sources = [ | ||
'__init__.py', | ||
] | ||
|
||
py.install_sources( | ||
python_sources, | ||
subdir: module_path | ||
) |
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,12 @@ | ||
|
||
python_sources = [ | ||
'__init__.py', | ||
'base_mesh.py', | ||
'base_regular_mesh.py', | ||
'base_tensor_mesh.py', | ||
] | ||
|
||
py.install_sources( | ||
python_sources, | ||
subdir: 'discretize/base' | ||
) |
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,24 @@ | ||
|
||
python_sources = [ | ||
'__init__.py', | ||
'curvilinear_mesh.py', | ||
'cylindrical_mesh.py', | ||
'tensor_cell.py', | ||
'tensor_mesh.py', | ||
'tests.py', | ||
'tree_mesh.py', | ||
'unstructured_mesh.py', | ||
'View.py', | ||
] | ||
|
||
py.install_sources( | ||
python_sources, | ||
subdir: 'discretize' | ||
) | ||
|
||
subdir('base') | ||
subdir('_extensions') | ||
subdir('mixins') | ||
subdir('operators') | ||
subdir('utils') | ||
subdir('Tests') |
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,13 @@ | ||
|
||
python_sources = [ | ||
'__init__.py', | ||
'mesh_io.py', | ||
'mpl_mod.py', | ||
'omf_mod.py', | ||
'vtk_mod.py', | ||
] | ||
|
||
py.install_sources( | ||
python_sources, | ||
subdir: 'discretize/mixins' | ||
) |
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
Oops, something went wrong.