-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpyproject.toml
149 lines (126 loc) · 4.93 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
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
###############################
# Configuration for the project
###############################
[project]
name = 'easydiffraction'
dynamic = ['version'] # Use versioningit to manage the version
description = 'Making diffraction data analysis and modelling easy'
authors = [
{ name = 'EasyDiffraction contributors', email = '[email protected]' },
]
readme = 'README.md'
license = { file = 'LICENSE' }
classifiers = [
'Topic :: Scientific/Engineering',
'Development Status :: 4 - Beta',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
]
requires-python = '>=3.9,<3.13'
dependencies = [
'cryspy', # Calculations of diffraction patterns
'easycrystallography', # Crystallography tools of the EasyScience framework
'easyscience', # The base library of the EasyScience framework
'pooch', # For data fetching
]
[project.optional-dependencies]
dev = [
'build', # Building the package
'jinja2', # Templating for the documentation
'nbmake', # Building notebooks
'nbqa', # Linting and formatting notebooks
'pytest', # Testing
'pytest-cov', # Coverage
'pytest-xdist', # Enable parallel testing
'ruff', # Linting and formatting code
'versioningit', # Versioning
]
charts = [
'darkdetect', # Detecting dark mode
'pandas', # Displaying tables in juptyer notebooks
'plotly', # Interactive plots
'py3Dmol', # Visualisation of crystal structures
]
pdf = [
'diffpy.pdffit2', # Calculations of atomic pair distribution function
'diffpy.structure', # Handling of crystal structures for the diffpy libraries
'diffpy.utils', # General purpose shared utilities for the diffpy libraries
]
[project.urls]
homepage = 'https://easydiffraction.org'
documentation = 'https://docs.easydiffraction.org/lib'
source = 'https://github.com/EasyScience/EasyDiffractionLib'
tracker = 'https://github.com/EasyScience/EasyDiffractionLib/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/easydiffraction']
[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.
[tool.versioningit.format]
distance = '{base_version}.post{distance}' # example: 1.2.3.post42
dirty = '{base_version}' # example: 1.2.3
distance-dirty = '{base_version}.post{distance}' # example: 1.2.3.post42
[tool.versioningit.vcs]
method = 'git'
match = ['v*']
default-tag = 'v999.0.0'
########################
# Configuration for ruff
########################
# 'ruff' -- Python linter and code formatter
# https://docs.astral.sh/ruff/rules/
[tool.ruff]
exclude = ['examples', 'examples_old', 'tests_old']
indent-width = 4
line-length = 127
[tool.ruff.format]
docstring-code-format = true # Whether to format 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)
[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.isort]
force-single-line = true
[tool.ruff.lint.per-file-ignores]
# allow asserts in test files
'*test_*.py' = ['S101']
#[tool.ruff.lint.pycodestyle]
#max-line-length = 88 # https://peps.python.org/pep-0008/#maximum-line-length
#max-doc-length = 72 # https://peps.python.org/pep-0008/#maximum-line-length