-
Notifications
You must be signed in to change notification settings - Fork 391
/
pyproject.toml
269 lines (251 loc) · 8.89 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
269
[build-system]
requires = ["hatchling>=1.5.0"]
build-backend = "hatchling.build"
[project]
name = "jupytext"
description = "Jupyter notebooks as Markdown documents, Julia, Python or R scripts"
license = { file = "LICENSE" }
authors = [
{ name = "Marc Wouts", email = "marc.wouts@gmail.com" },
]
readme = "README.md"
requires-python = ">=3.8"
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Environment :: Console",
"Framework :: Jupyter",
"Framework :: Jupyter :: JupyterLab :: 4",
"Framework :: Jupyter :: JupyterLab :: Extensions",
"Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Topic :: Text Processing :: Markup",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dependencies = [
"nbformat",
"mdit-py-plugins",
"markdown-it-py>=1.0",
"packaging",
"pyyaml",
"tomli;python_version<\"3.11\"",
]
dynamic = ["version"]
[project.urls]
Homepage = "https://github.com/mwouts/jupytext"
"Source Code" = "https://github.com/mwouts/jupytext"
Documentation = "https://jupytext.readthedocs.io"
[project.optional-dependencies]
# Test related dependencies
test = [
"pytest",
"pytest-xdist",
"pytest-randomly"
]
test-functional = [
"jupytext[test]",
]
test-integration = [
"jupytext[test-functional]",
"jupyter-server!=2.11", # issue 1165
# jupytext --execute
"nbconvert",
"ipykernel",
]
test-external = [
"jupytext[test-integration]",
# jupytext --pipe and --check
"autopep8",
"black",
"isort",
"flake8",
# Sphinx gallery
"sphinx<8", # Issue 1266
"sphinx-gallery<0.8",
# Pre-commit tests
"gitpython",
"pre-commit",
# Interaction with other contents managers
"jupyter-fs>=1.0"
]
# Coverage requirements
test-cov = [
"jupytext[test-integration]",
"pytest-cov>=2.6.1",
]
# Galata test env
# Install a non python kernel to ensure extension is working as expected
test-ui = [
"calysto-bash",
]
dev = [
"jupytext[test-cov,test-external]",
]
# Documentation dependencies
docs = [
"sphinx",
"sphinx-copybutton",
"sphinx-rtd-theme",
"myst-parser",
]
[project.scripts]
"jupytext" = "jupytext.cli:jupytext"
"jupytext-config" = "jupytext_config.__main__:main"
[tool.hatch.version]
# Read version string from version.py and use it for the package
path = "src/jupytext/version.py"
# Hatch first build sdist and then builds a wheel out of that sdist
# By using the below config, we remove path prefixes in sdist meaning
# that sdist will not have a src in root but directly jupytext and other
# modules.
#
# So when it attempts to build wheel out of the sdist there is no more
# src folder and hence it complains about not finding src/jupytext/version.py
# file. So, we **should not** use hatch.build.sources here which removes
# path prefixes
# [tool.hatch.build]
# sources = ["src", "jupyterlab"]
# Following config is related to JupyterLab extension
[tool.hatch.build.targets.sdist]
artifacts = ["jupyterlab/jupyterlab_jupytext/labextension"]
[tool.hatch.build.targets.wheel]
packages = ["src/jupytext", "src/jupytext_config", "jupyterlab/jupyterlab_jupytext"]
[tool.hatch.build.targets.wheel.shared-data]
"jupyterlab/jupyter-config" = "etc/jupyter"
"jupyterlab/jupyterlab_jupytext/labextension" = "share/jupyter/labextensions/jupyterlab-jupytext"
[tool.hatch.build.hooks.jupyter-builder]
enable-by-default = false
# We enable this hook by setting env var HATCH_BUILD_HOOKS_ENABLE=true
# So `pip install .` will **not** build JupyterLab related
# extension. To install the extension, it is required to run
# `HATCH_BUILD_HOOKS_ENABLE=true pip install .`
# Runtime dependency for this build hook
# We need jupyterlab as build time depdendency to get jlpm (wrapper around yarn)
dependencies = [
"hatch-jupyter-builder>=0.5", "jupyterlab>=4"
]
# We use npm_builder to build the jupyterlab extension
build-function = "hatch_jupyter_builder.npm_builder"
# Hatch will mark this hook as success upon creation of following files
# in the build_dir
ensured-targets = [
"jupyterlab/jupyterlab_jupytext/labextension/static/style.js",
"jupyterlab/jupyterlab_jupytext/labextension/package.json",
]
# If these files already exists in build_dir (after first build),
# hatch will skip build step. If there are changes in src/ of
# the extension, build will be triggered even if the build assets exist
skip-if-exists = ["jupyterlab/jupyterlab_jupytext/labextension/static/style.js"]
[tool.hatch.build.hooks.jupyter-builder.build-kwargs]
# Root directory where build should be done
path = "jupyterlab"
# Build command that is defined in package.json
build_cmd = "build:prod"
# We use jlpm, which is wrapper around yarn to build transpiled assets
npm = ["jlpm"]
[tool.hatch.build.hooks.jupyter-builder.editable-build-kwargs]
path = "jupyterlab"
build_cmd = "build"
npm = ["jlpm"]
# hatch-jupyter-builder hook will check the mtime of source_dir and
# compare it with build_dir to decide if build is necessary or not
source_dir = "jupyterlab/packages"
build_dir = "jupyterlab/jupyterlab_jupytext/labextension"
[tool.check-wheel-contents]
ignore = ["W002"]
# flake8 config has been moved to ruff and a pre-commit config has been
# added
[tool.ruff]
line-length = 127
exclude = [
"tests/data/notebooks/*",
]
# Seems like W503 is not implemented in ruff
# ref: https://github.com/astral-sh/ruff/issues/4125
ignore = [
"E203", "E231",
]
[tool.pytest.ini_options]
markers = [
"requires_black",
"requires_isort",
"requires_flake8",
"requires_autopep8",
"requires_nbconvert",
"requires_myst",
"requires_no_myst",
"requires_quarto",
"requires_pandoc",
"requires_no_pandoc",
"requires_sphinx_gallery",
"requires_user_kernel_python3",
"requires_ir_kernel",
"skip_on_windows",
"pre_commit",
]
filterwarnings = [
# Uncomment this "error" to turn all unfiltered warnings into errors
# "error",
# Our cwd_tmpdir fixture
"ignore:pathlib.Path.__enter__\\(\\) is deprecated and scheduled for removal in Python 3.13:DeprecationWarning",
# Pre-commit
"ignore:read_text is deprecated. Use files\\(\\) instead:DeprecationWarning",
"ignore:open_text is deprecated. Use files\\(\\) instead:DeprecationWarning",
# Jupyter
"ignore:Jupyter is migrating its paths to use standard platformdirs:DeprecationWarning",
# Jupyter notebook
"ignore:Support for bleach <5 will be removed in a future version of nbconvert:DeprecationWarning",
# jupyterfs
"ignore:run_pre_save_hook is deprecated, use run_pre_save_hooks instead:DeprecationWarning",
"ignore:run_post_save_hook is deprecated, use run_post_save_hooks instead:DeprecationWarning",
"ignore:Deprecated call to `pkg_resources.declare_namespace:DeprecationWarning",
"ignore:pkg_resources is deprecated as an API:DeprecationWarning",
# use single quote to denote raw strings in toml
# (10 warnings)
'ignore:Passing unrecognized arguments to super\(KernelSpec\).__init__:DeprecationWarning',
# Not seen any more with latest Python + libs
"ignore:Passing a schema to Validator.iter_errors is deprecated and will be removed in a future release:DeprecationWarning",
# in test_utf8_out_331 and two others
# Not seen any more with latest Python + libs
'ignore:Exception ignored in. <function Context.__del__:pytest.PytestUnraisableExceptionWarning',
# In test_markdown_jupytext_nbconvert_is_identity
'ignore:.*contextfilter.* renamed to .*pass_context:DeprecationWarning',
# in test_cli_expect_errors and two others
'ignore:Exception ignored in. <socket.socket:pytest.PytestUnraisableExceptionWarning',
# in test_paired_paths / Python 3.6
'ignore:Exception ignored in. <bound method Context.__del__:pytest.PytestUnraisableExceptionWarning',
# test_config_jupytext_jupyter_fs_meta_manager
'ignore:The alias `_\(\)` will be deprecated. Use `_i18n\(\)` instead.:FutureWarning',
# Conda/Python 3.7/Windows - ImportError while loading conftest
"ignore:the imp module is deprecated in favour of importlib:DeprecationWarning",
"ignore:Code cell is missing an id field:FutureWarning",
"ignore:There is no current event loop:DeprecationWarning",
]
[tool.coverage.run]
omit = [
"tests/*",
]
parallel = true
[tool.coverage.report]
# Regexes for lines to exclude from consideration
exclude_lines = [
"if self.debug:",
# Have to re-enable the standard pragma
"pragma: no cover",
# Don't complain if tests don't hit defensive assertion code:
"raise NotImplementedError",
"except ImportError",
]
ignore_errors = true
omit = [
"tests/*",
"src/jupytext/version.py",
]