Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: python dependency specification #2483

Merged
merged 14 commits into from
Mar 1, 2024
19 changes: 8 additions & 11 deletions bindings/python/justfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
set fallback
VENV := env_var_or_default("VENV", "../../.venv")
VENV := env_var_or_default("VENV", ".venv")
VENV_BIN := VENV / "bin"

@venv:
python3 -c "import virtualenv" || python3 -m pip --quiet install virtualenv
python3 -m virtualenv {{VENV}} --quiet

## Set up virtual environment and install requirements
@requirements: venv
{{VENV_BIN}}/python -m pip --quiet install --upgrade pip
{{VENV_BIN}}/pip --quiet install -r requirements.txt
{{VENV_BIN}}/python -m pip install --upgrade pip
greyscaled marked this conversation as resolved.
Show resolved Hide resolved
{{VENV_BIN}}/pip install -r requirements.txt

## Compile and install py-glaredb for development
build *args: requirements
build *args: venv
@unset CONDA_PREFIX
{{VENV_BIN}}/maturin develop {{args}}
{{VENV_BIN}}/maturin develop --pip-path="{{VENV_BIN}}/pip" --extras="pandas,polars,pyarrow" {{args}}
tychoish marked this conversation as resolved.
Show resolved Hide resolved

test: requirements
{{VENV_BIN}}/pytest -s
test: venv
{{VENV_BIN}}/pytest --rootdir={{invocation_directory()}}/bindings/python
tychoish marked this conversation as resolved.
Show resolved Hide resolved

## Run autoformatting and linting
fmt: venv
{{VENV_BIN}}/ruff .
{{VENV_BIN}}/mypy
cargo fmt --all

example path: requirements
example path: venv
{{VENV_BIN}}/python examples/{{path}}.py
26 changes: 25 additions & 1 deletion bindings/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,30 @@ classifiers = [
"Programming Language :: Python :: Implementation :: PyPy",
]

[tool.poetry]
name = "glaredb"
version = "0.0.0"
description = "glaredb bindings"
authors = ["GlareDB <hello@glaredb.com>"]
readme = "README.md"
tychoish marked this conversation as resolved.
Show resolved Hide resolved

[project.optional-dependencies]
great-expectations = [
"great_expectations",
"great_expectations[postgresql]",
]
pandas = [
"pandas",
"pandasai",
]
polars = [
"polars",
]
pyarrow = [
"pyarrow",
]


[project.urls]
Homepage = "https://glaredb.com"
Documentation = "https://docs.glaredb.com"
Expand All @@ -27,4 +51,4 @@ line-length = 88
fix = true
ignore = [
"F841" # unused variables
]
]
14 changes: 6 additions & 8 deletions bindings/python/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
maturin==1.0.1
virtualenv==20.23.1
ruff==0.0.275
# this requirements.txt is for development deps only
maturin[patchelf]==1.4.0
patchelf
black==23.3.0
tychoish marked this conversation as resolved.
Show resolved Hide resolved
blackdoc==0.3.8
mypy==1.3.0
pytest
ruff==0.0.275
typos==1.15
pyarrow
pandas
polars
pytest
pandasai
great_expectations[postgresql]
great_expectations
pyarrow
Empty file.
Loading