File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ {
2+ description = "typesense-python development shell" ;
3+
4+ inputs = {
5+ nixpkgs. url = "github:NixOS/nixpkgs/nixos-unstable" ;
6+ } ;
7+
8+ outputs =
9+ { self , nixpkgs } :
10+ let
11+ systems = [
12+ "x86_64-linux"
13+ "aarch64-linux"
14+ "aarch64-darwin"
15+ ] ;
16+ forAllSystems = nixpkgs . lib. genAttrs systems ;
17+ in
18+ {
19+ devShells = forAllSystems (
20+ system :
21+ let
22+ pkgs = import nixpkgs { inherit system ; } ;
23+
24+ # Starts a local server configured like the one in CI, which the test suite expects.
25+ typesense-dev = pkgs . writeShellApplication {
26+ name = "typesense-dev" ;
27+ runtimeInputs = [ pkgs . typesense ] ;
28+ text = ''
29+ root="'' ${TYPESENSE_DEV_DIR:-$PWD/.typesense}"
30+ mkdir -p "$root/data" "$root/analytics"
31+ exec typesense-server \
32+ --api-key=xyz \
33+ --data-dir="$root/data" \
34+ --enable-search-analytics=true \
35+ --analytics-dir="$root/analytics" \
36+ --analytics-flush-interval=60 \
37+ --analytics-minute-rate-limit=50 \
38+ --enable-cors \
39+ "$@"
40+ '' ;
41+ } ;
42+
43+ mkShell =
44+ python :
45+ pkgs . mkShell {
46+ packages = [
47+ python
48+ pkgs . uv
49+ pkgs . typesense
50+ typesense-dev
51+ ] ;
52+
53+ env = {
54+ # Keep uv on the interpreter from this shell instead of fetching its own.
55+ UV_PYTHON = python . interpreter ;
56+ UV_PYTHON_DOWNLOADS = "never" ;
57+ } ;
58+
59+ shellHook = ''
60+ unset PYTHONPATH
61+ '' ;
62+ } ;
63+ in
64+ {
65+ default = mkShell pkgs . python313 ;
66+ py311 = mkShell pkgs . python311 ;
67+ py312 = mkShell pkgs . python312 ;
68+ py313 = mkShell pkgs . python313 ;
69+ }
70+ ) ;
71+ } ;
72+ }
You can’t perform that action at this time.
0 commit comments