-
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #969 from purepani/pdm-editables
Pdm editables
- Loading branch information
Showing
18 changed files
with
499 additions
and
52 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
examples/packages/languages/python-local-development-pdm/default.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# An example package with dependencies defined via pyproject.toml | ||
{ | ||
config, | ||
lib, | ||
dream2nix, | ||
... | ||
}: { | ||
imports = [ | ||
dream2nix.modules.dream2nix.WIP-python-pdm | ||
]; | ||
|
||
deps = {nixpkgs, ...}: { | ||
python = nixpkgs.python3; | ||
}; | ||
|
||
mkDerivation = { | ||
src = lib.cleanSourceWith { | ||
src = lib.cleanSource ./.; | ||
filter = name: type: | ||
!(builtins.any (x: x) [ | ||
(lib.hasSuffix ".nix" name) | ||
(lib.hasPrefix "." (builtins.baseNameOf name)) | ||
(lib.hasSuffix "flake.lock" name) | ||
]); | ||
}; | ||
}; | ||
pdm.lockfile = ./pdm.lock; | ||
pdm.pyproject = ./pyproject.toml; | ||
|
||
buildPythonPackage = { | ||
format = lib.mkForce "pyproject"; | ||
pythonImportsCheck = [ | ||
"mytool" | ||
]; | ||
}; | ||
} |
112 changes: 112 additions & 0 deletions
112
examples/packages/languages/python-local-development-pdm/flake.lock
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
39 changes: 39 additions & 0 deletions
39
examples/packages/languages/python-local-development-pdm/flake.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
description = "My flake with dream2nix packages"; | ||
|
||
inputs = { | ||
dream2nix.url = "github:nix-community/dream2nix"; | ||
nixpkgs.follows = "dream2nix/nixpkgs"; | ||
}; | ||
|
||
outputs = inputs @ { | ||
self, | ||
dream2nix, | ||
nixpkgs, | ||
... | ||
}: let | ||
system = "x86_64-linux"; | ||
pkgs = nixpkgs.legacyPackages.${system}; | ||
in { | ||
packages.${system}.default = dream2nix.lib.evalModules { | ||
packageSets.nixpkgs = pkgs; | ||
modules = [ | ||
./default.nix | ||
{ | ||
paths.projectRoot = ./.; | ||
# can be changed to ".git" or "flake.nix" to get rid of .project-root | ||
paths.projectRootFile = "flake.nix"; | ||
paths.package = ./.; | ||
} | ||
]; | ||
}; | ||
devShells.${system}.default = pkgs.mkShell { | ||
# inherit from the dream2nix generated dev shell | ||
inputsFrom = [self.packages.${system}.default.devShell]; | ||
# add extra packages | ||
packages = [ | ||
pkgs.hello | ||
]; | ||
}; | ||
}; | ||
} |
File renamed without changes.
144 changes: 144 additions & 0 deletions
144
examples/packages/languages/python-local-development-pdm/pdm.lock
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
examples/packages/languages/python-local-development-pdm/pyproject.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[build-system] | ||
requires = [ "setuptools" ] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "mytool" | ||
description = "my tool" | ||
version = "1.0.0" | ||
dependencies = [ | ||
"requests", | ||
] | ||
requires-python = ">=3.8" | ||
|
||
[project.scripts] | ||
my-tool = "my_tool:main" | ||
|
||
[project.optional-dependencies] | ||
extra = [ | ||
"simplejson>=3.19.2", | ||
] | ||
[tool.pdm.dev-dependencies] | ||
test = [ | ||
"pytest>=8.2.1", | ||
] |
Oops, something went wrong.