-
Notifications
You must be signed in to change notification settings - Fork 2
/
pyproject.toml
121 lines (110 loc) · 5.22 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# Use modern (PEP621, PEP660) setuptools build system.
# PEP 660 editable installs: <https://github.com/pypa/setuptools/blob/main/NEWS.rst#v6400>.
# Python 3.11 support: <https://github.com/pypa/setuptools_scm/blob/main/CHANGELOG.md#v710>.
[build-system]
requires = ["setuptools>=64", "setuptools_scm[toml]>=8"]
build-backend = "setuptools.build_meta"
# Automatically use the version number from vcs (e.g. git) tags,
# <https://github.com/pypa/setuptools_scm>.
[tool.setuptools_scm]
# Docs: <https://packaging.python.org/en/latest/specifications/pyproject-toml/>.
[project]
name = "pydrex"
dynamic = ["version"] # Managed by setuptools_scm.
description = "Dynamic CPO calculations for olivine-enstatite polycrystal aggregates"
readme = "README.md"
requires-python = ">=3.10" # We use tomllib on 3.11: <https://docs.python.org/3/library/tomllib.html>.
license = {file = "LICENSE"}
authors = [
{name = "Thomas Duvernay", email = "[email protected]"},
{name = "Leon Bilton", email = "[email protected]"},
{name = "Chris Mathews"},
]
keywords = ["CPO", "LPO", "olivine", "deformation", "anisotropy", "crystallography"]
classifiers = [ # List of possible classifiers: <https://pypi.org/classifiers/>.
"Programming Language :: Python :: 3",
"Development Status :: 3 - Alpha",
"Topic :: Scientific/Engineering :: Physics",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
]
dependencies = [
"tomli >= 1.1.0 ; python_version < '3.11'", # https://github.com/hukkin/tomli?tab=readme-ov-file#building-a-tomlitomllib-compatibility-layer
"numpy >= 1.8", # <https://numpy.org/doc/stable/reference/generated/numpy.linalg.eigvalsh.html>
"numba >= 0.57", # <https://numba.readthedocs.io/en/stable/release-notes.html#version-0-57-0-1-may-2023>
"scipy >= 1.2", # <https://github.com/scipy/scipy/pull/9176>
"pyyaml", # For YAML headers of plaintext datafiles.
"meshio", # For reading VTK and other meshes.
"matplotlib", # Plotting library, The.
"cmcrameri", # Matplotlib colormaps using the palettes designed by Fabio Crameri.
"h5py", # For reading Fluidity .h5part files.
"tqdm", # For progress bars (for long-running CLI scripts).
"dill", # For serializing lexical closures (i.e. passing locally-scoped functions between processors).
]
[project.optional-dependencies]
# These optional dependencies are relevant for built distributions (e.g. via pip):
mesh = ["gmsh"] # Required for pydrex-mesh, doesn't play nice with CI.
ray = ["ray >= 2.0.0"] # Required for distributed-memory examples.
# These optional dependencies are only relevant for source distributions:
test = ["pytest"] # Minimal test dependencies, for CI.
doc = ["pdoc", "setuptools-scm"] # Minimal html docs dependencies, for CI.
dev = [ # Full developer dependencies, including packaging and visualisation tools.
"build",
"mypy",
"pdoc",
"pre-commit",
"ptpython",
"pytest",
"pyvista",
"ruff",
"setuptools-scm",
"twine",
"uniplot",
]
# Language server protocol support for modern editors/linters.
lsp = ["python-lsp-ruff", "python-lsp-server", "pylsp-mypy", "fortls"]
# Metadata for PyPI landing page.
[project.urls]
repository = "https://github.com/seismic-anisotropy/PyDRex"
documentation = "https://seismic-anisotropy.github.io/PyDRex/"
# CLI entry points.
[project.scripts]
pydrex-polefigures = "pydrex.cli:CLI_HANDLERS.pole_figure_visualiser"
pydrex-mesh = "pydrex.cli:CLI_HANDLERS.mesh_generator"
pydrex-h5party="pydrex.cli:CLI_HANDLERS.h5part_extractor"
npzshow = "pydrex.cli:CLI_HANDLERS.npz_file_inspector"
# Make setuptools include datafiles in wheels/packages.
# Data files must be inside the src/<package> directory.
[tool.setuptools]
include-package-data = true
[tool.setuptools.packages.find]
# Use src/<package> layout to keep things clean.
where = ["src"]
# Special exclude rules for the wheel, NOTE: Use foo* glob instead of foo/*.
exclude = ["initial_implementation*"]
# Some global pytest configuration settings, avoids having an extra pytest.ini file.
[tool.pytest.ini_options]
# Only look in '.tests/`, don't search git subprojects/worktrees or anything like that,
# <https://github.com/pytest-dev/pytest/issues/10298>.
testpaths = ["tests"]
# --tb=short : Use short tracebacks, terminal scrollback is precious.
# --capture=fd : Capture sys.std{out,err} and file descriptors 1 and 2 by default, show if -v is given.
# --show-capture=no : Don't show captured output for failed tests, use -v instead.
# -p no:logging : Disable built-in logging plugin, we have our own.
addopts = "--tb=short --capture=fd --show-capture=no -p no:logging"
# Global linter and devtools settings.
[tool.ruff]
# Ruff is faster than flake8 and supports pyproject.toml config, line length is 88 by default.
exclude = [
"src/initial_implementation",
".scsv",
".npz",
".vtu",
]
[tool.ruff.lint.per-file-ignores]
"src/pydrex/__init__.py" = ["F401", "E501"] # Don't complain about unused imports or long lines in __init__.py file.
"tests/test_scsv.py" = ["E501"] # Don't complain about long lines here.
# Silence mypy noise about packages that don't have type hints/stubs.
[[tool.mypy.overrides]]
module = "pydrex.*,numba.*,h5py.*,meshio.*,gmsh.*,dill.*,cmcrameri.*,scipy.*,ray.*"
ignore_missing_imports = true