Skip to content

Commit

Permalink
pdm: add rudimentary devShell
Browse files Browse the repository at this point in the history
Also fix lock script to not swallow error messages
  • Loading branch information
DavHau committed Feb 20, 2024
1 parent 5a5ae25 commit cc7b5c0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion modules/dream2nix/WIP-python-pdm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ in {
buildPackages
curl
jq
mkShell
runCommand
stdenvNoCC
stdenv
Expand All @@ -100,6 +101,11 @@ in {
# all packages attrs prefixed with version
(lib.attrValues config.groups.default.packages);
};
public.devShell = let
interpreter = config.deps.python.withPackages (ps: config.mkDerivation.propagatedBuildInputs);
in config.deps.mkShell {
packages = [interpreter];
};
groups = let
groupNames = lib.attrNames groups_with_deps;
populateGroup = groupname: let
Expand Down Expand Up @@ -131,7 +137,7 @@ in {
(dream2nix.overrides.python.${name} or {})
];
inherit name;
version = pkg.version;
version = lib.mkDefault pkg.version;
buildPythonPackage = {
format = lib.mkDefault (
if lib.hasSuffix ".whl" source.file
Expand Down
2 changes: 1 addition & 1 deletion modules/dream2nix/core/lock/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
repo_path = Path(subprocess.run(
['${config.paths.findRoot}'], # noqa: E501
check=True, text=True, capture_output=True
check=True, text=True, stdout=subprocess.PIPE
).stdout.strip())
lock_path_rel = Path('${config.paths.package}/${config.paths.lockFile}') # noqa: E501
lock_path = repo_path / lock_path_rel.relative_to(lock_path_rel.anchor)
Expand Down

0 comments on commit cc7b5c0

Please sign in to comment.