24fdeddc0a
GitOrigin-RevId: 2768c7d042a37de65bb1b5b3268fc987e534c49d
121 lines
2.1 KiB
Nix
121 lines
2.1 KiB
Nix
{
|
|
lib,
|
|
buildPythonPackage,
|
|
fetchFromGitHub,
|
|
|
|
# build-system
|
|
setuptools,
|
|
|
|
# dependencies
|
|
ipython-genutils,
|
|
jinja2,
|
|
jupysql-plugin,
|
|
ploomber-core,
|
|
prettytable,
|
|
sqlalchemy,
|
|
sqlglot,
|
|
sqlparse,
|
|
|
|
# optional-dependencies
|
|
duckdb,
|
|
duckdb-engine,
|
|
grpcio,
|
|
ipython,
|
|
ipywidgets,
|
|
matplotlib,
|
|
numpy,
|
|
pandas,
|
|
polars,
|
|
pyarrow,
|
|
pyspark,
|
|
|
|
# tests
|
|
pytestCheckHook,
|
|
psutil,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "jupysql";
|
|
version = "0.10.13";
|
|
|
|
pyproject = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "ploomber";
|
|
repo = "jupysql";
|
|
rev = "refs/tags/${version}";
|
|
hash = "sha256-vNuMGHFkatJS5KjxaOBwZ7JolIDAdYqGq3JNKSV2fKE=";
|
|
};
|
|
|
|
pythonRelaxDeps = [ "sqlalchemy" ];
|
|
|
|
build-system = [ setuptools ];
|
|
|
|
dependencies = [
|
|
ipython-genutils
|
|
jinja2
|
|
jupysql-plugin
|
|
ploomber-core
|
|
prettytable
|
|
sqlalchemy
|
|
sqlglot
|
|
sqlparse
|
|
];
|
|
|
|
optional-dependencies.dev = [
|
|
duckdb
|
|
duckdb-engine
|
|
grpcio
|
|
ipython
|
|
ipywidgets
|
|
matplotlib
|
|
numpy
|
|
pandas
|
|
polars
|
|
pyarrow
|
|
pyspark
|
|
];
|
|
|
|
nativeCheckInputs = [
|
|
pytestCheckHook
|
|
psutil
|
|
] ++ optional-dependencies.dev;
|
|
|
|
disabledTests = [
|
|
# AttributeError: 'DataFrame' object has no attribute 'frame_equal'
|
|
"test_resultset_polars_dataframe"
|
|
];
|
|
|
|
disabledTestPaths = [
|
|
# require docker
|
|
"src/tests/integration"
|
|
|
|
# require network access
|
|
"src/tests/test_telemetry.py"
|
|
|
|
# want to download test data from the network
|
|
"src/tests/test_parse.py"
|
|
"src/tests/test_ggplot.py"
|
|
"src/tests/test_plot.py"
|
|
"src/tests/test_magic.py"
|
|
"src/tests/test_magic_plot.py"
|
|
|
|
# require js2py (which is unmaintained and insecure)
|
|
"src/tests/test_widget.py"
|
|
];
|
|
|
|
preCheck = ''
|
|
# tests need to write temp data
|
|
export HOME=$(mktemp -d)
|
|
'';
|
|
|
|
pythonImportsCheck = [ "sql" ];
|
|
|
|
meta = {
|
|
description = "Better SQL in Jupyter";
|
|
homepage = "https://github.com/ploomber/jupysql";
|
|
changelog = "https://github.com/ploomber/jupysql/blob/${version}/CHANGELOG.md";
|
|
license = lib.licenses.asl20;
|
|
maintainers = with lib.maintainers; [ pacien ];
|
|
};
|
|
}
|