Loading pkgs/development/python-modules/lida/default.nix 0 → 100644 +108 −0 Original line number Diff line number Diff line { 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"; }; } pkgs/development/python-modules/lida/rw_data.patch 0 → 100644 +16 −0 Original line number Diff line number Diff line 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) pkgs/top-level/python-packages.nix +2 −0 Original line number Diff line number Diff line Loading @@ -7617,6 +7617,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; Loading Loading
pkgs/development/python-modules/lida/default.nix 0 → 100644 +108 −0 Original line number Diff line number Diff line { 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"; }; }
pkgs/development/python-modules/lida/rw_data.patch 0 → 100644 +16 −0 Original line number Diff line number Diff line 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)
pkgs/top-level/python-packages.nix +2 −0 Original line number Diff line number Diff line Loading @@ -7617,6 +7617,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; Loading