diff --git a/templates/python-project/flake-module.nix b/templates/python-project/flake-module.nix index cfd5c552f..5b130500e 100644 --- a/templates/python-project/flake-module.nix +++ b/templates/python-project/flake-module.nix @@ -1,10 +1,16 @@ -{ - perSystem = { pkgs, ... }: +{ self, ... }: { + perSystem = { self', pkgs, ... }: let - package = pkgs.callPackage ./default.nix { }; + name = "python-template"; in { - # packages.${name} = package; - checks.python-template = package.tests.check; + packages.${name} = pkgs.callPackage ./default.nix { }; + + devShells.${name} = pkgs.callPackage ./shell.nix { + inherit self; + package = (self'.packages.${name}); + }; + + checks.python-template = self'.packages.${name}.tests.check; }; } diff --git a/templates/python-project/pyproject.toml b/templates/python-project/pyproject.toml index 22a6c9afb..10656441c 100644 --- a/templates/python-project/pyproject.toml +++ b/templates/python-project/pyproject.toml @@ -2,8 +2,8 @@ requires = ["setuptools"] build-backend = "setuptools.build_meta" -[tool.setuptools.packages.find] -include = ["my_tool*"] +[tool.setuptools] +packages = ["my_tool"] [project] name = "my_tool" diff --git a/templates/python-project/shell.nix b/templates/python-project/shell.nix index 8b7985030..035e87f94 100644 --- a/templates/python-project/shell.nix +++ b/templates/python-project/shell.nix @@ -1,11 +1,6 @@ -{ pkgs ? import { } }: +{ package, pkgs, ... }: let - lib = pkgs.lib; - python3 = pkgs.python3; - package = import ./default.nix { - inherit lib python3; - }; - pythonWithDeps = python3.withPackages ( + pythonWithDeps = pkgs.python3.withPackages ( ps: package.propagatedBuildInputs ++ package.devDependencies