You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to build a python environment with mach-nix where one of the packages I would like in the environment is a local poetry-based project. What's the best way to go about this? I've tried something like
{pkgs, ... }:
letmach-nix=import(builtins.fetchGit{url="https://github.com/DavHau/mach-nix";ref="refs/tags/3.5.0";}){};python-packages=mach-nix.mkPython{requirements='' <requirements one per line> '';};packagesExtra=[mach-nix.buildPythonPackage./path/to/project];};in{}
but mach-nix doesn't seem to be happy with that, yielding
...
at /nix/store/n6hsk44fw5x8kqkff2mxyd5wd6663ai5-source/mach_nix/nix/lib.nix:229:14:
228| Please manually specify '${for_attr}' '';
229| data = extract python src error_msg;
| ^
230| result = if hasAttr attr data then data."${attr}" else throw error_msg;
… while evaluating 'extract'
at /nix/store/n6hsk44fw5x8kqkff2mxyd5wd6663ai5-source/mach_nix/nix/lib.nix:198:28:
197|
198| extract = python: src: fail_msg:
| ^
199| let
… while realising the context of a path
at /nix/store/n6hsk44fw5x8kqkff2mxyd5wd6663ai5-source/mach_nix/nix/lib.nix:205:10:
204| in
205| if pathExists file_path then fromJSON (builtins.unsafeDiscardStringContext (readFile file_path)) else throw fail_msg;
| ^
206|
… while evaluating the attribute 'src' of the derivation 'package-requirements'
at /nix/store/5n402azp0s9vza4rziv4z5y88v2cv1mq-nixpkgs/pkgs/stdenv/generic/make-derivation.nix:205:7:
204| // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
205| name =
| ^
206| let
cannot coerce a function to a string
at /nix/store/n6hsk44fw5x8kqkff2mxyd5wd6663ai5-source/lib/extractor/default.nix:156:14:
155| stdenv.mkDerivation ( (base_derivation []) // {
156| inherit src;
| ^
157| name = "package-requirements";
However, if I simply include the project directly in the top-level requirementsfrom pypi and then the derivation works. Ideally I would like to install it from local source...
Hints much appreciated!
The text was updated successfully, but these errors were encountered:
I'm trying to build a python environment with
mach-nix
where one of the packages I would like in the environment is a local poetry-based project. What's the best way to go about this? I've tried something likebut
mach-nix
doesn't seem to be happy with that, yieldingHowever, if I simply include the project directly in the top-level
requirements
from pypi and then the derivation works. Ideally I would like to install it from local source...Hints much appreciated!
The text was updated successfully, but these errors were encountered: