-
Notifications
You must be signed in to change notification settings - Fork 121
/
Copy pathpyproject.toml
215 lines (198 loc) · 5.24 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
# Reference: https://packaging.python.org/en/latest/guides/writing-pyproject-toml
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "narwhals"
version = "1.23.0"
dependencies = []
requires-python = ">=3.8"
authors = [
{ name = "Marco Gorelli", email = "[email protected]" },
]
description = "Extremely lightweight compatibility layer between dataframe libraries"
readme = "README.md"
keywords = ["dataframes", "interoperability", "pandas", "polars", "pyarrow", "dask", "modin", "cudf"]
classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Operating System :: OS Independent",
]
[project.optional-dependencies]
# These should be aligned with MIN_VERSIONS in narwhals/utils.py
# Exception: modin, because `modin.__version__` isn't aligned with
# `modin.pandas.__version__`. The latter is the one that we make
# API decisions based on, so that's the one we track internally.
# We have yet to determine the minimum Modin version we support
# https://github.com/narwhals-dev/narwhals/issues/817
pandas = ["pandas>=0.25.3"]
modin = ["modin"]
cudf = ["cudf>=24.10.0"]
pyarrow = ["pyarrow>=11.0.0"]
pyspark = ["pyspark>=3.5.0"]
polars = ["polars>=0.20.3"]
dask = ["dask[dataframe]>=2024.8"]
duckdb = ["duckdb>=1.0"]
ibis = ["ibis-framework>=6.0.0", "rich", "packaging", "pyarrow_hotfix"]
dev = [
"covdefaults",
"pre-commit",
"pytest",
"pytest-cov",
"pytest-randomly",
"pytest-env",
"hypothesis",
"typing_extensions",
]
core = [
"duckdb",
"pandas",
"polars",
"pyarrow",
"pyarrow-stubs",
]
extra = [ # heavier dependencies we don't necessarily need in every testing job
"scikit-learn",
]
docs = [
"black", # required by mkdocstrings_handlers
"jinja2",
"duckdb",
"markdown-exec[ansi]",
"mkdocs",
"mkdocs-autorefs",
"mkdocs-material",
"mkdocstrings[python]",
"pandas",
"polars>=1.0.0",
"pyarrow",
]
[project.urls]
Homepage = "https://github.com/narwhals-dev/narwhals"
Documentation = "https://narwhals-dev.github.io/narwhals/"
Repository = "https://github.com/narwhals-dev/narwhals"
"Bug Tracker" = "https://github.com/narwhals-dev/narwhals/issues"
[tool.hatch.build]
exclude = [
"/.*",
"/docs",
"/tests",
"/tpch",
"/utils",
".gitignore",
"CONTRIBUTING.md",
"mkdocs.yml",
"noxfile.py",
]
[tool.ruff]
line-length = 90
fix = true
target-version = "py38"
lint.select = [
"ALL",
]
lint.ignore = [
"A001",
"A004",
"ARG002",
"ANN401",
"C901",
"COM812",
"D100",
"D101",
"D102",
"D103",
"D104",
"D105",
"D107",
"DTZ001",
"E501",
"FIX",
"ISC001",
"PD003",
"PD010",
"PD901", # This is a auxiliary library so dataframe variables have no concrete business meaning
"PLR0911",
"PLR0912",
"PLR0913",
"PLR2004",
"RET505",
"SLF001",
"TD003",
]
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["S101"]
"tpch/tests/*" = ["S101"]
"utils/*" = ["S311", "PTH123"]
"tpch/execute/*" = ["T201"]
"tpch/notebooks/*" = [
"ANN001",
"ANN201",
"EM101",
"EXE002",
"PTH123",
"T203",
"TRY003",
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.isort]
force-single-line = true
required-imports = ["from __future__ import annotations"]
[tool.ruff.format]
docstring-code-format = true
[tool.pytest.ini_options]
testpaths = ["tests"]
filterwarnings = [
"error",
'ignore:.*defaulting to pandas implementation',
'ignore:.*implementation has mismatches with pandas',
'ignore:.*You are using pyarrow version',
# This warning was temporarily raised by pandas but then reverted.
'ignore:.*Passing a BlockManager to DataFrame:DeprecationWarning',
# This warning was temporarily raised by Polars but then reverted.
'ignore:.*The default coalesce behavior of left join will change:DeprecationWarning',
'ignore: unclosed <socket.socket',
'ignore:.*The distutils package is deprecated and slated for removal in Python 3.12:DeprecationWarning:pyspark',
'ignore:.*distutils Version classes are deprecated. Use packaging.version instead.*:DeprecationWarning:pyspark',
'ignore:.*is_datetime64tz_dtype is deprecated and will be removed in a future version.*:DeprecationWarning:pyspark',
]
xfail_strict = true
markers = ["slow: marks tests as slow (deselect with '-m \"not slow\"')"]
env = [
"MODIN_ENGINE=python",
"PYARROW_IGNORE_TIMEZONE=1"
]
[tool.coverage.run]
plugins = ["covdefaults"]
[tool.coverage.report]
fail_under = 80 # This is just for local development, in CI we set it to 100
omit = [
'narwhals/typing.py',
'narwhals/stable/v1/typing.py',
'narwhals/this.py',
# we can't run this in every environment that we measure coverage on due to upper-bound constraits
'narwhals/_ibis/*',
# the latest pyspark (3.5) doesn't officially support Python 3.12 and 3.13
'narwhals/_spark_like/*',
# we don't run these in every environment
'tests/ibis_test.py',
]
exclude_also = [
"if sys.version_info() <",
"if .*implementation is Implementation.CUDF",
"if .*implementation.is_cudf",
'request.applymarker\(pytest.mark.xfail',
'backend_version <',
'if "cudf" in str\(constructor'
]
[tool.mypy]
strict = true
[[tool.mypy.overrides]]
# the pandas API is just too inconsistent for type hinting to be useful.
module = [
"pandas.*",
"cudf.*",
"modin.*",
]
ignore_missing_imports = true