Try using `.mkPoetryEnv` instead for devving (dont work yet..)

distribute_dis
Tyler Goodlet 2023-09-11 12:35:43 -04:00
parent 3b4a4db7b6
commit 261c331602
1 changed files with 47 additions and 45 deletions

View File

@ -6,6 +6,11 @@
# - then manually ensuring all deps are converted over: # - then manually ensuring all deps are converted over:
# - add this file to the repo and commit it # - add this file to the repo and commit it
# - # -
# GROKin tips:
# - CLI eps are (ostensibly) added via an `entry_points.txt`:
# - https://packaging.python.org/en/latest/specifications/entry-points/#file-format
# - https://github.com/nix-community/poetry2nix/blob/master/editable.nix#L49
{ {
description = "piker: trading gear for hackers (pkged with poetry2nix)"; description = "piker: trading gear for hackers (pkged with poetry2nix)";
@ -101,7 +106,7 @@
# won't be needed - thanks @k900: # won't be needed - thanks @k900:
# https://github.com/nix-community/poetry2nix/pull/1257 # https://github.com/nix-community/poetry2nix/pull/1257
pyqt5 = prev.pyqt5.override { pyqt5 = prev.pyqt5.override {
withWebkit = false; # withWebkit = false;
preferWheel = true; preferWheel = true;
}; };
@ -124,55 +129,52 @@
# WHY!? -> output-attrs that `nix develop` scans for: # WHY!? -> output-attrs that `nix develop` scans for:
# https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-develop.html#flake-output-attributes # https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-develop.html#flake-output-attributes
in { in
packages = { rec {
# piker = poetry2nix.legacyPackages.x86_64-linux.mkPoetryEditablePackage { packages = {
# editablePackageSources = { piker = ./piker; }; # piker = poetry2nix.legacyPackages.x86_64-linux.mkPoetryEditablePackage {
# editablePackageSources = { piker = ./piker; };
piker = p2npkgs.mkPoetryApplication { piker = p2npkgs.mkPoetryApplication {
projectDir = projectDir; projectDir = projectDir;
# SEE ABOVE for auto-genned input set, override # SEE ABOVE for auto-genned input set, override
# buncha deps with extras.. like `setuptools` mostly. # buncha deps with extras.. like `setuptools` mostly.
# TODO: maybe propose a patch to p2n to show that you # TODO: maybe propose a patch to p2n to show that you
# can even do this in the edgecases docs? # can even do this in the edgecases docs?
overrides = ahot_overrides; overrides = ahot_overrides;
# XXX: won't work on llvmlite.. # XXX: won't work on llvmlite..
# preferWheels = true; # preferWheels = true;
};
}; };
};
devShells.default = pkgs.mkShell { # devShells.default = pkgs.mkShell {
# packages = [ poetry2nix.packages.${system}.poetry ]; # projectDir = projectDir;
packages = [ poetry2nix.packages.x86_64-linux.poetry ]; # python = "python3.10";
inputsFrom = [ self.packages.x86_64-linux.piker ]; # overrides = ahot_overrides;
# inputsFrom = [ self.packages.x86_64-linux.piker ];
# packages = packages;
# # packages = [ poetry2nix.packages.${system}.poetry ];
# };
# TODO: boot xonsh inside the poetry virtualenv when # TODO: grok the difference here..
# defined via a custom entry point? # - avoid re-cloning git repos on every develop entry..
# NOTE XXX: apparently DON'T do these..? # - ideally allow hacking on the src code of some deps
# shellHook = "poetry run xonsh"; # (tractor, pyqtgraph, tomlkit, etc.) WITHOUT having to
# shellHook = "poetry shell"; # re-install them every time a change is made.
}; # - boot a usable xonsh inside the poetry virtualenv when
# defined via a custom entry point?
devShells.default = p2npkgs.mkPoetryEnv {
# TODO: grok the difference here.. # env = p2npkgs.mkPoetryEnv {
# - avoid re-cloning git repos on every develop entry.. projectDir = projectDir;
# - ideally allow hacking on the src code of some deps python = pkgs.python310;
# (tractor, pyqtgraph, tomlkit, etc.) WITHOUT having to overrides = ahot_overrides;
# re-install them every time a change is made. editablePackageSources = packages;
# piker = "./";
# devShells.default = (p2npkgs.mkPoetryEnv { # tractor = "../tractor/";
# # let { # }; # wut?
# # devEnv = p2npkgs.mkPoetryEnv { };
# projectDir = projectDir; }
# overrides = ahot_overrides;
# inputsFrom = [ self.packages.x86_64-linux.piker ];
# }).env.overrideAttrs (old: {
# buildInputs = [ packages.piker ];
# }
# );
}
); # end of .outputs scope ); # end of .outputs scope
} }