Skip to content

Commit

Permalink
maybe something else
Browse files Browse the repository at this point in the history
  • Loading branch information
tychoish committed Feb 28, 2024
1 parent d27932f commit 7e49fa5
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 26 deletions.
33 changes: 20 additions & 13 deletions bindings/python/justfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,35 @@
set fallback
VENV := env_var_or_default("VENV", "../../.venv")
VENV := env_var_or_default("VENV", ".venv")
VENV_BIN := VENV / "bin"

VENV_DEV := env_var_or_default("VENV", ".venv-dev")
VENV_DEV_BIN := VENV_DEV / "bin"


@venv-dev:
python3 -c "import virtualenv" || python3 -m pip --quiet install virtualenv
python3 -m virtualenv {{VENV_DEV}} --quiet
{{VENV_DEV_BIN}}/python -m pip install --upgrade pip
{{VENV_DEV_BIN}}/pip install -r requirements.txt

@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}}/python -m pip install --upgrade pip

## Compile and install py-glaredb for development
build *args: requirements
build *args: venv venv-dev
@unset CONDA_PREFIX
{{VENV_BIN}}/maturin develop {{args}}
{{VENV_DEV_BIN}}/maturin develop --pip-path="{{VENV_BIN}}/pip" --extras="pandas,polars,pyarrow" {{args}}

test: requirements
{{VENV_BIN}}/pytest -s
test: venv
{{VENV_DEV_BIN}}/pytest -s

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

example path: requirements
example path: venv
{{VENV_BIN}}/python examples/{{path}}.py
26 changes: 13 additions & 13 deletions bindings/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,18 @@ classifiers = [
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"maturin==1.0.1",
"ruff==0.0.275",
"mypy==1.3.0",
"typos==1.15",
"pyarrow",
]

[tool.poetry]
name = "glaredb"
version = "0.0.0"
description = "glaredb bindings"
authors = ["GlareDB <hello@glaredb.com>"]
readme = "README.md"

[project.optional-dependencies]
dev = [
"great_expectations[postgresql]",
great-expectations = [
"great_expectations",
"virtualenv==20.23.1",
"black==23.3.0",
"blackdoc==0.3.8",
"pytest",
"great_expectations[postgresql]",
]
pandas = [
"pandas",
Expand All @@ -36,6 +32,10 @@ pandas = [
polars = [
"polars",
]
pyarrow = [
"pyarrow",
]


[project.urls]
Homepage = "https://glaredb.com"
Expand Down
9 changes: 9 additions & 0 deletions bindings/python/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# this requirements.txt is for development deps only
maturin[patchelf]==1.4.0
patchelf
black==23.3.0
blackdoc==0.3.8
mypy==1.3.0
pytest
ruff==0.0.275
typos==1.15

0 comments on commit 7e49fa5

Please sign in to comment.