Demonstrate bundling a console application.

pull/10/head
Joshua Potter 2023-11-27 20:49:55 -07:00
parent ffa29d401c
commit 21d7c3a9d6
4 changed files with 11 additions and 6 deletions

View File

@ -0,0 +1,2 @@
def main():
print("hello world")

View File

@ -64,21 +64,23 @@
in in
{ {
packages = { packages = {
tmpl-app = mkPoetryApplication { app = mkPoetryApplication {
projectDir = ./.; projectDir = ./.;
overrides = poetry2nix-overrides; overrides = poetry2nix-overrides;
}; };
default = self.packages.${system}.tmpl-app;
default = self.packages.${system}.app;
}; };
devShells.default = pkgs.mkShell { devShells.default = pkgs.mkShell {
inputsFrom = [ self.packages.${system}.tmpl-app ]; inputsFrom = [ self.packages.${system}.app ];
packages = [ packages = [
pkgs.poetry pkgs.poetry
] ++ (with pkgs.python311Packages; [ ] ++ (with pkgs.python311Packages; [
black black
debugpy debugpy
mccabe mccabe
mypy
pycodestyle pycodestyle
pyflakes pyflakes
python-lsp-black python-lsp-black

View File

@ -1,2 +0,0 @@
if __name__ == '__main__':
pass

View File

@ -1,5 +1,5 @@
[tool.poetry] [tool.poetry]
name = "tmpl" name = "app"
version = "0.1.0" version = "0.1.0"
description = "" description = ""
authors = ["Your Name <you@example.com>"] authors = ["Your Name <you@example.com>"]
@ -12,3 +12,6 @@ python = "^3.11"
[build-system] [build-system]
requires = ["poetry-core"] requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api" build-backend = "poetry.core.masonry.api"
[tool.poetry.scripts]
app = "app:main"