From c85ffdfbcdca96a93e51d116fba8fae960deda67 Mon Sep 17 00:00:00 2001 From: counterweight Date: Fri, 25 Jul 2025 14:27:13 +0200 Subject: [PATCH] chore: prepare deps and make to deploy meltano --- .gitignore | 4 +++- Makefile | 7 ++++++- flake.nix | 34 ++++++++++++++++++++++++++++------ requirements.txt | 1 + 4 files changed, 38 insertions(+), 8 deletions(-) create mode 100644 requirements.txt diff --git a/.gitignore b/.gitignore index e661505..06d7c9d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ .env .vscode -*/target \ No newline at end of file +*/target + +.venv \ No newline at end of file diff --git a/Makefile b/Makefile index 64b535d..3e72fbc 100644 --- a/Makefile +++ b/Makefile @@ -17,4 +17,9 @@ reset: stop run-rust: cargo build --manifest-path rust/Cargo.toml - cargo run --manifest-path rust/Cargo.toml \ No newline at end of file + cargo run --manifest-path rust/Cargo.toml + +setup-meltano-deps: + meltano init pizza_dw + cd pizza_dw && meltano add extractor tap-postgres && meltano add loader target-postgres + \ No newline at end of file diff --git a/flake.nix b/flake.nix index f2affb2..61eb441 100644 --- a/flake.nix +++ b/flake.nix @@ -10,18 +10,40 @@ flake-utils.lib.eachDefaultSystem (system: let pkgs = import nixpkgs { inherit system; }; + + python-with-deps = pkgs.python3.withPackages (ps: with ps; [ + pip + setuptools + wheel + psycopg2 + ]); + + venvDir = ".venv"; + in { devShells.default = pkgs.mkShell { - buildInputs = with pkgs; [ - rustup - pkg-config - openssl - postgresql - sqlx-cli + packages = [ + pkgs.rustup + pkgs.cargo + pkgs.docker + pkgs.postgresql + python-with-deps ]; shellHook = '' echo "✅ Rust + PostgreSQL dev env ready" + + if [ ! -d ${venvDir} ]; then + echo "🐍 Creating Python virtualenv..." + python3 -m venv ${venvDir} + fi + + source ${venvDir}/bin/activate + + pip install --upgrade pip + pip install -r requirements.txt + + echo "Python env ready" ''; }; }); diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..c22815b --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +meltano==3.8.0 \ No newline at end of file