add template for python requirements.txt projects

This commit is contained in:
Noah Masur 2022-06-26 22:10:57 -04:00
parent e4b15ea100
commit 720ca5d94c
5 changed files with 71 additions and 0 deletions

View File

@ -93,6 +93,10 @@
path = ./templates/poetry;
description = "Poetry template";
};
python = {
path = ./templates/python;
description = "Legacy Python template";
};
};
};

1
templates/python/.envrc Normal file
View File

@ -0,0 +1 @@
use flake . --no-use-registries

4
templates/python/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
.direnv
result
*.pyc
.DS_Store

42
templates/python/flake.lock generated Normal file
View File

@ -0,0 +1,42 @@
{
"nodes": {
"flake-utils": {
"locked": {
"lastModified": 1653893745,
"narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1655779787,
"narHash": "sha256-Z5VL2AANN3Rk92xFs/3pPVyDQVTIcmNAIeTQNFOJnNE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ce83dc760cd3428ce9938aa711a0c7c81f55c567",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

View File

@ -0,0 +1,20 @@
{
description = "Python pip flake";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
pythonEnv = pkgs.python310.withPackages (pypi:
with pypi;
[
# Add requirements here
requests
]);
in {
devShells.default = pkgs.mkShell { buildInputs = [ pythonEnv ]; };
});
}