2025-03-17 07:38:58 +01:00
|
|
|
from setuptools import setup
|
2025-02-13 06:15:54 +01:00
|
|
|
|
2025-02-13 21:17:51 +01:00
|
|
|
|
|
|
|
def sqlglotrs_version():
|
2025-02-13 22:19:49 +01:00
|
|
|
with open("sqlglotrs/Cargo.toml", encoding="utf-8") as fd:
|
2025-02-13 21:17:51 +01:00
|
|
|
for line in fd.readlines():
|
|
|
|
if line.strip().startswith("version"):
|
|
|
|
return line.split("=")[1].strip().strip('"')
|
|
|
|
raise ValueError("Could not find version in Cargo.toml")
|
|
|
|
|
|
|
|
|
2025-03-17 07:38:58 +01:00
|
|
|
# Everything is defined in pyproject.toml except the extras because for the [rs] extra we need to dynamically
|
|
|
|
# read the sqlglotrs version. [dev] has to be specified here as well because you cant specify some extras groups
|
|
|
|
# dynamically and others statically, it has to be either all dynamic or all static
|
|
|
|
# ref: https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html#dynamic-metadata
|
2025-02-13 06:15:54 +01:00
|
|
|
setup(
|
2025-02-13 15:01:55 +01:00
|
|
|
extras_require={
|
|
|
|
"dev": [
|
2025-02-13 15:57:23 +01:00
|
|
|
"duckdb>=0.6",
|
2025-02-13 21:20:36 +01:00
|
|
|
"mypy",
|
2025-02-13 15:01:55 +01:00
|
|
|
"pandas",
|
2025-02-13 21:30:28 +01:00
|
|
|
"pandas-stubs",
|
2025-02-13 15:01:55 +01:00
|
|
|
"python-dateutil",
|
2025-02-13 21:52:32 +01:00
|
|
|
"pytz",
|
2025-02-13 15:01:55 +01:00
|
|
|
"pdoc",
|
|
|
|
"pre-commit",
|
2025-02-13 21:56:19 +01:00
|
|
|
"ruff==0.7.2",
|
2025-02-13 21:03:38 +01:00
|
|
|
"types-python-dateutil",
|
2025-02-13 21:52:32 +01:00
|
|
|
"types-pytz",
|
2025-02-13 21:19:58 +01:00
|
|
|
"typing_extensions",
|
2025-02-13 21:17:51 +01:00
|
|
|
"maturin>=1.4,<2.0",
|
2025-02-13 15:01:55 +01:00
|
|
|
],
|
2025-02-13 21:17:51 +01:00
|
|
|
"rs": [f"sqlglotrs=={sqlglotrs_version()}"],
|
2025-02-13 15:01:55 +01:00
|
|
|
},
|
2025-02-13 06:15:54 +01:00
|
|
|
)
|