-
Notifications
You must be signed in to change notification settings - Fork 17
/
pyproject.toml
268 lines (238 loc) · 7.53 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
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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
# https://setuptools.readthedocs.io/en/latest/
[build-system]
requires = ["cython>=3", "numpy>=2.0.0", "setuptools>=64", "setuptools-scm>=8"]
build-backend = "setuptools.build_meta"
[project]
name = "pycontrails"
authors = [{ name = "Breakthrough Energy", email = "py@contrails.org" }]
description = "Python library for modeling aviation climate impacts"
keywords = ["contrails", "climate", "aviation", "geospatial"]
# https://pypi.org/classifiers/
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Scientific/Engineering :: Atmospheric Science",
"Topic :: Scientific/Engineering :: GIS",
"Typing :: Typed",
]
requires-python = ">=3.10"
license = { text = "Apache-2.0" }
readme = { file = "README.md", content-type = "text/markdown" }
dependencies = [
"dask>=2022.3",
"numpy>=1.22",
"pandas>=2.2",
"scipy>=1.10",
"typing-extensions>=4.5; python_version < '3.12'",
"xarray>=2022.3",
]
dynamic = ["version"]
[project.urls]
Changelog = "https://py.contrails.org/changelog.html"
Documentation = "https://py.contrails.org"
Issues = "https://github.com/contrailcirrus/pycontrails/issues"
Repository = "https://github.com/contrailcirrus/pycontrails"
[project.optional-dependencies]
# All non-development dependencies
# Only dependencies that work on all python versions
complete = ["pycontrails[ecmwf,gcp,gfs,jupyter,pyproj,sat,vis,zarr]"]
# Development dependencies
dev = [
"dep_license",
"fastparquet>=0.8",
"ipdb>=0.13",
"memory_profiler",
"mypy>=1.8",
"mypy-extensions>=1.0",
"platformdirs>=3.0",
"pre-commit>=2.10",
"psutil",
"pyarrow>=5.0",
"pytest>=8.2",
"pytest-cov>=2.11",
"requests>=2.25",
"ruff==0.6.2",
"setuptools",
]
# Documentation / Sphinx dependencies
docs = [
"doc8>=1.1",
"furo>=2023.3",
"myst-parser>=1.0",
"nb-clean>=3.2",
"nbsphinx>=0.9",
"nbval>=0.9.6,!=0.10.0",
"pytest-check-links>=0.8.0",
"sphinx>=4.2",
"sphinx-autobuild>=0.7",
"sphinxcontrib-bibtex>=2.2",
"sphinx_copybutton>=0.5",
"sphinxext.opengraph>=0.8",
]
# ECMWF datalib interfaces
ecmwf = [
"cdsapi>=0.4",
"cfgrib>=0.9",
"eccodes>=2.38",
"ecmwf-api-client>=1.6",
"netcdf4>=1.6.1",
"platformdirs>=3.0",
"requests>=2.25",
]
# Google Cloud Platform caching interface
gcp = ["google-cloud-storage>=2.1", "platformdirs>=3.0", "tqdm>=4.61"]
# GFS datalib interfaces
gfs = [
"boto3>=1.20",
"cfgrib>=0.9",
"eccodes>=2.38",
"netcdf4>=1.6.1",
"platformdirs>=3.0",
"tqdm>=4.61",
]
# Jupyter notebook and lab interface
jupyter = ["ipywidgets>=7.6", "jupyterlab>=2.2"]
# Satellite datalibs
sat = [
"cartopy>=0.22",
"db-dtypes>=1.2",
"gcsfs>=2022.3",
"geojson>=3.1",
"google-cloud-bigquery>=3.23",
"google-cloud-bigquery-storage>=2.25",
"pillow>=10.3",
"pyproj>=3.5",
"rasterio>=1.3",
"scikit-image>=0.18",
]
accf = ["climaccf @ git+ssh://git@github.com/dlr-pa/climaccf"]
# Polyhedra contruction methods
open3d = ["open3d>=0.14"]
# Geospatial coordinate transformations
pyproj = ["pyproj>=3.5"]
# Polygon construction methods and plotting support
vis = [
"matplotlib>=3.3",
"opencv-python-headless>=4.5",
"scikit-learn>=0.23",
"scikit-image>=0.18",
"seaborn>=0.11",
"shapely>=2.0",
]
# Load data from remote GCS Zarr stores
zarr = ["fsspec>=2022.7.1", "gcsfs>=2022.7.1", "zarr>=2.12"]
# https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
[tool.setuptools]
license-files = ["LICENSE", "NOTICE"]
include-package-data = false
# Note that setuptools-scm changes some of the default behavior of setuptools
# In particular, everything tracked by git is included in the source distribution (sdist)
# We exclude the docs and tests directories from wheel distributions
# https://setuptools.pypa.io/en/latest/userguide/package_discovery.html#finding-simple-packages
# https://github.com/pypa/setuptools_scm#file-finders-hook-makes-most-of-manifestin-unnecessary
[tool.setuptools.packages.find]
exclude = ["docs*", "tests*"]
# https://mypy.readthedocs.io/en/stable/installed_packages.html#creating-pep-561-compatible-packages
[tool.setuptools.package-data]
"pycontrails" = ["py.typed"]
"pycontrails.datalib.ecmwf" = ["static/*.csv"]
"pycontrails.datalib._leo_utils" = ["static/*.sql"]
"pycontrails.models.emissions" = ["static/*.csv"]
"pycontrails.models.humidity_scaling" = ["quantiles/*.pq"]
"pycontrails.models.apcemm" = ["static/*.yaml"]
"pycontrails.models.ps_model" = ["static/*.csv"]
# https://github.com/pypa/setuptools_scm/
[tool.setuptools_scm]
write_to = "pycontrails/_version.py"
local_scheme = "no-local-version"
# mypy static type checking
# https://mypy.readthedocs.io/en/stable/config_file.html
[tool.mypy]
ignore_missing_imports = true
disallow_untyped_defs = true
# disallow_any_generics = true # TOOD: support this in the future
warn_redundant_casts = true
warn_unused_ignores = false
warn_no_return = false
show_error_codes = true
# # --strict
# disallow_untyped_calls = true
# disallow_subclassing_any = true
# disallow_incomplete_defs = true
# disallow_untyped_decorators = true
# no_implicit_optional = true
# warn_unused_ignores = true
# warn_return_any = true
# implicit_reexport = false
# strict_equality = true
# # --strict end
# pytest
# https://docs.pytest.org/en/7.1.x/reference/customize.html
[tool.pytest.ini_options]
doctest_optionflags = ["ELLIPSIS", "NORMALIZE_WHITESPACE", "NUMBER"]
filterwarnings = [
"error::UserWarning",
"error::RuntimeWarning",
"ignore:datetime.datetime:DeprecationWarning:tqdm.std",
"ignore:Type google._upb._message:DeprecationWarning",
"ignore:`np.bool8` is a deprecated alias:DeprecationWarning:skimage.util.dtype",
"ignore:'cgi' is deprecated and slated:DeprecationWarning:google.cloud.storage.blob",
"ignore:Engine 'cfgrib' loading failed:RuntimeWarning:xarray.backends.plugins",
"ignore:.*IPyNbFile:pytest.PytestRemovedIn9Warning:_pytest.nodes",
"ignore:.*pkg_resources:DeprecationWarning",
"ignore:The default level_type will change:DeprecationWarning",
]
testpaths = ["tests/unit"]
# license check
# https://github.com/abduhbm/dep-license
[tool.deplic]
banned = ["AGPL-3.0", "GPL", "AGPL"]
# RST linter
# https://github.com/pycqa/doc8
[tool.doc8]
max-line-length = 100
ignore-path = [
"docs/changelog.rst",
"docs/contributing.rst",
"docs/api/*",
"docs/_build/*",
]
# Python linter
# https://docs.astral.sh/ruff/
# https://docs.astral.sh/ruff/settings/#select
# https://www.pydocstyle.org/en/6.3.0/error_codes.html
[tool.ruff]
line-length = 100
[tool.ruff.lint]
select = ["B", "D", "E", "F", "I", "NPY", "PL", "PT", "SIM", "UP"]
ignore = [
"B028",
"E402",
"D105",
"D202",
"PLR2004",
"PLR0911",
"PLR0912",
"PLR0913",
"PLR0915",
"PLW2901",
]
[tool.ruff.lint.per-file-ignores]
"docs/conf.py" = ["E501"]
"docs/**/*.ipynb" = ["D103", "E501"]
"tests/*" = ["D"]
# https://docs.astral.sh/ruff/settings/#pydocstyle
[tool.ruff.lint.pydocstyle]
convention = "numpy"
# https://docs.astral.sh/ruff/settings/#flake8-pytest-style
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = true