python3Packages.lida: init at 0.0.14

This commit is contained in:
Moraxyc
2025-02-21 02:27:53 +08:00
parent 4ebae9c99f
commit c2bcbbd44f
3 changed files with 126 additions and 0 deletions
@@ -0,0 +1,108 @@
{
lib,
buildPythonPackage,
fetchPypi,
setuptools,
setuptools-scm,
altair,
fastapi,
geopandas,
kaleido,
llmx,
matplotlib,
matplotlib-venn,
networkx,
numpy,
pandas,
plotly,
plotnine,
pydantic,
python-multipart,
scipy,
seaborn,
statsmodels,
typer,
uvicorn,
wordcloud,
peacasso,
basemap,
basemap-data-hires,
geopy,
}:
buildPythonPackage rec {
pname = "lida";
version = "0.0.14";
pyproject = true;
# No releases or tags are available in https://github.com/microsoft/lida
src = fetchPypi {
inherit pname version;
hash = "sha256-/az6hS8rNPxb8cDiz9SOyUBi/X48r9prJNFUnx1wPHM=";
};
patches = [
# The upstream places the data path under the py file's own directory.
# However, since `/nix/store` is read-only, we patch it to the user's home directory.
./rw_data.patch
];
build-system = [
setuptools
setuptools-scm
];
dependencies = [
altair
fastapi
geopandas
kaleido
llmx
matplotlib
matplotlib-venn
networkx
numpy
pandas
plotly
plotnine
pydantic
python-multipart
scipy
seaborn
statsmodels
typer
uvicorn
wordcloud
];
optional-dependencies = {
infographics = [
peacasso
];
tools = [
basemap
basemap-data-hires
geopy
];
transformers = [
llmx
];
web = [
fastapi
uvicorn
];
};
# require network
doCheck = false;
pythonImportsCheck = [ "lida" ];
meta = {
description = "Automatic Generation of Visualizations and Infographics using Large Language Models";
homepage = "https://github.com/microsoft/lida";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ moraxyc ];
mainProgram = "lida";
};
}
@@ -0,0 +1,16 @@
diff --git a/lida/web/app.py b/lida/web/app.py
index 32046a3..599ae07 100644
--- a/lida/web/app.py
+++ b/lida/web/app.py
@@ -34,8 +34,9 @@ app.mount("/api", api)
root_file_path = os.path.dirname(os.path.abspath(__file__))
static_folder_root = os.path.join(root_file_path, "ui")
-files_static_root = os.path.join(root_file_path, "files/")
-data_folder = os.path.join(root_file_path, "files/data")
+home_dir = os.path.expanduser("~")
+files_static_root = os.path.join(home_dir, ".lida/files")
+data_folder = os.path.join(files_static_root, "data")
os.makedirs(data_folder, exist_ok=True)
os.makedirs(files_static_root, exist_ok=True)
os.makedirs(static_folder_root, exist_ok=True)
+2
View File
@@ -7615,6 +7615,8 @@ self: super: with self; {
license-expression = callPackage ../development/python-modules/license-expression { };
lida = callPackage ../development/python-modules/lida { };
lief = (toPythonModule (pkgs.lief.override {
inherit python;
})).py;