mirror of
https://github.com/vale981/poetry2nix
synced 2025-03-06 01:31:39 -05:00
+docs: build binary with mkPoetryApplication
and build webserver wrapper binary
This commit is contained in:
parent
d45ca6fb03
commit
5f915f9500
1 changed files with 9 additions and 0 deletions
|
@ -47,6 +47,13 @@ Creates a Python application using the Python interpreter specified based on the
|
|||
|
||||
Other attributes are passed through to `buildPythonApplication`.
|
||||
|
||||
Make sure to add in your `pyproject.toml` the py-object for your `main()`. Otherwise, the result is empty.
|
||||
|
||||
```toml
|
||||
[tool.poetry.scripts]
|
||||
poetry = "poetry.console.application:main"
|
||||
```
|
||||
|
||||
#### Example
|
||||
```nix
|
||||
poetry2nix.mkPoetryApplication {
|
||||
|
@ -77,6 +84,8 @@ $ result/bin/python -m admin
|
|||
$ result/bin/gunicorn web:app
|
||||
```
|
||||
|
||||
If you prefer to build a single binary that runs `gunicorn web:app`, use [`pkgs.writeShellApplication`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/trivial-builders.nix#L317) for a simple wrapper.
|
||||
|
||||
Note: If you need to perform overrides on the application, use `app.dependencyEnv.override { app = app.override { ... }; }`. See [./tests/dependency-environment/default.nix](./tests/dependency-environment/default.nix) for a full example.
|
||||
|
||||
### mkPoetryEnv
|
||||
|
|
Loading…
Add table
Reference in a new issue