-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
222 lines (185 loc) · 9.07 KB
/
pyproject.toml
File metadata and controls
222 lines (185 loc) · 9.07 KB
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
###############################
# Configuration for the project
###############################
[project]
name = 'easyshapes_app'
dynamic = ['version'] # Use versioningit to manage the version
description = 'EasyShapes is a scientific software for constructing and simulating molecular systems. '
authors = [{ name = 'EasyShapes contributors' }]
readme = 'README.md'
license = { file = 'LICENSE' }
classifiers = [
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
]
requires-python = '>=3.11'
dependencies = [
#'easyscience', # The base library of the EasyScience framework
'pooch', # Data downloader
'darkdetect', # Detecting dark mode (system-level)
'pandas', # Displaying tables in Jupyter notebooks
'plotly', # Interactive plots
'py3Dmol', # Visualisation of crystal structures
'jupyterlab', # Jupyter notebooks
'pixi-kernel', # Pixi Jupyter kernel
]
[project.optional-dependencies]
dev = [
'build', # Building the package
'pre-commit', # Pre-commit hooks
'jinja2', # Templating
'nbmake', # Building notebooks
'nbstripout', # Strip output from notebooks
'nbqa', # Linting and formatting notebooks
'pytest', # Testing
'pytest-cov', # Test coverage
'pytest-xdist', # Enable parallel testing
'ruff', # Linting and formatting code
'radon', # Code complexity and maintainability
'validate-pyproject[all]', # Validate pyproject.toml
'versioningit', # Automatic versioning from git tags
'jupytext', # Jupyter notebook text format support
'jupyterquiz', # Quizzes in Jupyter notebooks
'docformatter', # Code formatter for docstrings
'interrogate', # Check for missing docstrings
'copier', # Template management
'mike', # MkDocs: Versioned documentation support
'mkdocs', # Static site generator
'mkdocs-material', # Documentation framework on top of MkDocs
'mkdocs-autorefs', # MkDocs: Auto-references support
'mkdocs-jupyter', # MkDocs: Jupyter notebook support
'mkdocs-plugin-inline-svg', # MkDocs: Inline SVG support
'mkdocs-markdownextradata-plugin', # MkDocs: Markdown extra data support, such as global variables
'mkdocstrings-python', # MkDocs: Python docstring support
'pyyaml', # YAML parser
'EasyApp @ git+https://github.com/easyscience/EasyApp.git@develop', # The EasyScience application framework
'pyinstaller', # Create standalone executables
]
[project.urls]
homepage = 'https://easyscience.github.io/shapes'
documentation = 'https://easyscience.github.io/shapes-app'
source = 'https://github.com/easyscience/shapes-app'
tracker = 'https://github.com/easyscience/shapes-app/issues'
############################
# Build system configuration
############################
# Build system 'hatch' -- Python project manager
# https://hatch.pypa.io/
# Versioning system 'versioningit' -- Versioning from git tags
# https://versioningit.readthedocs.io/
[build-system]
build-backend = 'hatchling.build'
requires = ['hatchling', 'versioningit']
#############################
# Configuration for hatchling
#############################
[tool.hatch.build.targets.wheel]
packages = ['src/easyshapes_app']
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.version]
source = 'versioningit' # Use versioningit to manage the version
################################
# Configuration for versioningit
################################
# Versioningit generates versions from git tags, so we don't need to
# either specify them statically in pyproject.toml or save them in the
# source code. Do not use {distance} in the version format, as it
# forces a version bump for every commit, which triggers unnecessary
# pixi.lock update without any changes to the source code.
[tool.versioningit.format]
distance = '{base_version}+dev{distance}' # example: 1.2.3.post4+dev3
dirty = '{base_version}+dirty{distance}' # example: 0.5.8+dirty3
distance-dirty = '{base_version}+devdirty{distance}' # example: 0.5.8+devdirty3
# Configure how versioningit detects versions from Git
# - 'match' ensures it only considers tags starting with 'v'
# - 'default-tag' is used as a fallback when no matching tag is found
[tool.versioningit.vcs]
method = 'git'
match = ['v*']
default-tag = 'v999.0.0'
################################
# Configuration for docformatter
################################
# 'docformatter' -- Code formatter for docstrings
# https://docformatter.readthedocs.io/en/latest/
[tool.docformatter]
recursive = true
wrap-summaries = 72
wrap-descriptions = 72
close-quotes-on-newline = true
################################
# Configuration for interrogate
################################
# 'interrogate' -- Check for missing docstrings
# https://interrogate.readthedocs.io/en/latest/
[tool.interrogate]
fail-under = 0 # Minimum docstring coverage percentage to pass
verbose = 1
#exclude = ['src/**/__init__.py']
#######################################
# Configuration for coverage/pytest-cov
#######################################
[tool.coverage.run]
branch = true # Measure branch coverage as well
source = ['src'] # Limit coverage to the source code directory
[tool.coverage.report]
show_missing = true # Show missing lines
skip_covered = false # Skip files with 100% coverage in the report
fail_under = 0 # Minimum coverage percentage to pass
##########################
# Configuration for pytest
##########################
[tool.pytest.ini_options]
addopts = '--import-mode=importlib'
markers = ['fast: mark test as fast (should be run on every push)']
testpaths = ['tests']
########################
# Configuration for ruff
########################
# 'ruff' -- Python linter and code formatter
# https://docs.astral.sh/ruff/rules/
[tool.ruff]
exclude = ['tmp']
indent-width = 4
line-length = 99
preview = true # Enable new rules that are not yet stable, like DOC
[tool.ruff.format]
docstring-code-format = true # Whether to format code snippets in docstrings
docstring-code-line-length = 72 # Line length for code snippets in docstrings
indent-style = 'space' # PEP 8 recommends using spaces over tabs
line-ending = 'lf' # Line endings will be converted to \n
quote-style = 'single' # But double quotes in docstrings (PEP 8, PEP 257)
# https://docs.astral.sh/ruff/rules/
[tool.ruff.lint]
select = [
# 'E', # General PEP 8 style errors
# 'E9', # Runtime errors (e.g., syntax errors, undefined names)
# 'F', # Pyflakes-specific checks (e.g., unused variables, imports)
# 'F63', # Issues related to invalid escape sequences in strings
# 'F7', # Type-related errors (e.g., mismatched argument types, unsupported operations)
# 'F82', # Import-related errors (e.g., unresolved imports, reimported modules)
# 'I', # Import sorting issues (e.g., unsorted imports)
# 'S', # Security-related issues (e.g., use of insecure functions or libraries)
# 'W', # General PEP 8 warnings (e.g., lines too long, trailing whitespace)
]
[tool.ruff.lint.per-file-ignores]
'tests/**/*.py' = ['S101'] # Allow assert statements in tests
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = 'all'
[tool.ruff.lint.isort]
force-single-line = true
[tool.ruff.lint.mccabe]
max-complexity = 10 # default is 10
[tool.ruff.lint.pycodestyle]
max-line-length = 99 # https://peps.python.org/pep-0008/#maximum-line-length
max-doc-length = 72 # https://peps.python.org/pep-0008/#maximum-line-length
[tool.ruff.lint.pydocstyle]
convention = 'google'