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
17 changes: 7 additions & 10 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}}

test: requirements
{{VENV_BIN}}/pytest -s
test: venv
{{VENV_BIN}}/pytest --rootdir={{justfile_directory()}}

## 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
21 changes: 20 additions & 1 deletion bindings/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,32 @@ build-backend = "maturin"
name = "glaredb"
description = "GlareDB is a fast SQL database for querying and analyzing distributed data."
readme = "README.md"
version = "0.0.0"
requires-python = ">=3.7"
classifiers = [
"Programming Language :: Rust",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]


[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 +46,4 @@ line-length = 88
fix = true
ignore = [
"F841" # unused variables
]
]
13 changes: 5 additions & 8 deletions bindings/python/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
maturin==1.0.1
virtualenv==20.23.1
ruff==0.0.275
# this requirements.txt is for development deps only
maturin==1.4.0
black==23.3.0
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