Spaces:
Sleeping
Sleeping
Feynman Liang
commited on
Commit
·
3dea868
1
Parent(s):
82d2266
Adds flake and poetry
Browse files- .gitignore +2 -0
- flake.lock +61 -0
- flake.nix +51 -0
- pyproject.toml +21 -0
.gitignore
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.direnv/
|
| 2 |
+
.ipynb_checkpoints/
|
flake.lock
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"nodes": {
|
| 3 |
+
"flake-utils": {
|
| 4 |
+
"inputs": {
|
| 5 |
+
"systems": "systems"
|
| 6 |
+
},
|
| 7 |
+
"locked": {
|
| 8 |
+
"lastModified": 1726560853,
|
| 9 |
+
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
|
| 10 |
+
"owner": "numtide",
|
| 11 |
+
"repo": "flake-utils",
|
| 12 |
+
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
|
| 13 |
+
"type": "github"
|
| 14 |
+
},
|
| 15 |
+
"original": {
|
| 16 |
+
"owner": "numtide",
|
| 17 |
+
"repo": "flake-utils",
|
| 18 |
+
"type": "github"
|
| 19 |
+
}
|
| 20 |
+
},
|
| 21 |
+
"nixpkgs": {
|
| 22 |
+
"locked": {
|
| 23 |
+
"lastModified": 1727802920,
|
| 24 |
+
"narHash": "sha256-HP89HZOT0ReIbI7IJZJQoJgxvB2Tn28V6XS3MNKnfLs=",
|
| 25 |
+
"owner": "NixOS",
|
| 26 |
+
"repo": "nixpkgs",
|
| 27 |
+
"rev": "27e30d177e57d912d614c88c622dcfdb2e6e6515",
|
| 28 |
+
"type": "github"
|
| 29 |
+
},
|
| 30 |
+
"original": {
|
| 31 |
+
"owner": "NixOS",
|
| 32 |
+
"ref": "nixos-unstable",
|
| 33 |
+
"repo": "nixpkgs",
|
| 34 |
+
"type": "github"
|
| 35 |
+
}
|
| 36 |
+
},
|
| 37 |
+
"root": {
|
| 38 |
+
"inputs": {
|
| 39 |
+
"flake-utils": "flake-utils",
|
| 40 |
+
"nixpkgs": "nixpkgs"
|
| 41 |
+
}
|
| 42 |
+
},
|
| 43 |
+
"systems": {
|
| 44 |
+
"locked": {
|
| 45 |
+
"lastModified": 1681028828,
|
| 46 |
+
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
| 47 |
+
"owner": "nix-systems",
|
| 48 |
+
"repo": "default",
|
| 49 |
+
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
| 50 |
+
"type": "github"
|
| 51 |
+
},
|
| 52 |
+
"original": {
|
| 53 |
+
"owner": "nix-systems",
|
| 54 |
+
"repo": "default",
|
| 55 |
+
"type": "github"
|
| 56 |
+
}
|
| 57 |
+
}
|
| 58 |
+
},
|
| 59 |
+
"root": "root",
|
| 60 |
+
"version": 7
|
| 61 |
+
}
|
flake.nix
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
inputs = {
|
| 3 |
+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
| 4 |
+
flake-utils.url = "github:numtide/flake-utils";
|
| 5 |
+
};
|
| 6 |
+
|
| 7 |
+
outputs = { self, nixpkgs, flake-utils }:
|
| 8 |
+
flake-utils.lib.eachDefaultSystem (system:
|
| 9 |
+
let
|
| 10 |
+
pkgs = nixpkgs.legacyPackages.${system};
|
| 11 |
+
in
|
| 12 |
+
{
|
| 13 |
+
devShells.default = pkgs.mkShell rec
|
| 14 |
+
{
|
| 15 |
+
buildInputs = with pkgs; ([
|
| 16 |
+
python311
|
| 17 |
+
poetry
|
| 18 |
+
zlib
|
| 19 |
+
|
| 20 |
+
# needed for pyright language server
|
| 21 |
+
nodejs_20
|
| 22 |
+
|
| 23 |
+
docker
|
| 24 |
+
kubectl
|
| 25 |
+
flyctl
|
| 26 |
+
]);
|
| 27 |
+
|
| 28 |
+
env = {
|
| 29 |
+
# Workaround in linux: python downloads ELF's that can't find glibc
|
| 30 |
+
# You would see errors like: error while loading shared libraries: name.so: cannot open shared object file: No such file or directory
|
| 31 |
+
# LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
|
| 32 |
+
# pkgs.stdenv.cc.cc
|
| 33 |
+
# # Add any missing library needed
|
| 34 |
+
# # You can use the nix-index package to locate them, e.g. nix-locate -w --top-level --at-root /lib/libudev.so.1
|
| 35 |
+
# ];
|
| 36 |
+
|
| 37 |
+
# Put the venv on the repo, so direnv can access it
|
| 38 |
+
POETRY_VIRTUALENVS_IN_PROJECT = "true";
|
| 39 |
+
POETRY_VIRTUALENVS_PATH = "{project-dir}/.venv";
|
| 40 |
+
|
| 41 |
+
# Use python from path, so you can use a different version to the one bundled with poetry
|
| 42 |
+
POETRY_VIRTUALENVS_PREFER_ACTIVE_PYTHON = "true";
|
| 43 |
+
};
|
| 44 |
+
shellHook = ''
|
| 45 |
+
export LD_LIBRARY_PATH="${pkgs.lib.makeLibraryPath buildInputs}:$LD_LIBRARY_PATH"
|
| 46 |
+
export LD_LIBRARY_PATH="${pkgs.stdenv.cc.cc.lib.outPath}/lib:$LD_LIBRARY_PATH"
|
| 47 |
+
'';
|
| 48 |
+
};
|
| 49 |
+
}
|
| 50 |
+
);
|
| 51 |
+
}
|
pyproject.toml
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[tool.poetry]
|
| 2 |
+
name = "crossvue-demo"
|
| 3 |
+
version = "0.1.0"
|
| 4 |
+
description = ""
|
| 5 |
+
authors = ["Feynman Liang <[email protected]>"]
|
| 6 |
+
readme = "README.md"
|
| 7 |
+
|
| 8 |
+
[tool.poetry.dependencies]
|
| 9 |
+
python = "^3.12"
|
| 10 |
+
plotai = "^0.0.5"
|
| 11 |
+
numpy = "^2.1.1"
|
| 12 |
+
jupyter = "^1.1.1"
|
| 13 |
+
seaborn = "^0.13.2"
|
| 14 |
+
mercury = "^2.4.3"
|
| 15 |
+
|
| 16 |
+
[tool.poetry.group.dev.dependencies]
|
| 17 |
+
ruff = "^0.6.8"
|
| 18 |
+
|
| 19 |
+
[build-system]
|
| 20 |
+
requires = ["poetry-core"]
|
| 21 |
+
build-backend = "poetry.core.masonry.api"
|