mirror of
https://github.com/vale981/poetry2nix
synced 2025-03-04 16:51:40 -05:00
Add test for dependencyEnv passthru
This commit is contained in:
parent
d7d4fdc8de
commit
d550dd4d99
5 changed files with 60 additions and 0 deletions
|
@ -35,6 +35,7 @@ builtins.removeAttrs
|
|||
source-filter = callTest ./source-filter { };
|
||||
canonical-module-names = callTest ./canonical-module-names { };
|
||||
wandb = callTest ./wandb { };
|
||||
dependency-environment = callTest ./dependency-environment { };
|
||||
|
||||
# Test building poetry
|
||||
inherit poetry;
|
||||
|
|
15
tests/dependency-environment/default.nix
Normal file
15
tests/dependency-environment/default.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ curl, lib, poetry2nix, python3, runCommand }:
|
||||
let
|
||||
app = poetry2nix.mkPoetryApplication {
|
||||
python = python3;
|
||||
src = lib.cleanSource ./.;
|
||||
pyproject = ./pyproject.toml;
|
||||
poetrylock = ./poetry.lock;
|
||||
};
|
||||
in
|
||||
runCommand "app-env-test" { } ''
|
||||
${app.dependencyEnv}/bin/gunicorn --bind=unix:socket trivial:app &
|
||||
sleep 1
|
||||
${curl}/bin/curl --unix-socket socket localhost
|
||||
touch $out
|
||||
''
|
22
tests/dependency-environment/poetry.lock
generated
Normal file
22
tests/dependency-environment/poetry.lock
generated
Normal file
|
@ -0,0 +1,22 @@
|
|||
[[package]]
|
||||
category = "main"
|
||||
description = "WSGI HTTP Server for UNIX"
|
||||
name = "gunicorn"
|
||||
optional = false
|
||||
python-versions = ">=2.6, !=3.0.*, !=3.1.*"
|
||||
version = "19.10.0"
|
||||
|
||||
[package.extras]
|
||||
eventlet = ["eventlet (>=0.9.7)"]
|
||||
gevent = ["gevent (>=0.13)"]
|
||||
tornado = ["tornado (>=0.2)"]
|
||||
|
||||
[metadata]
|
||||
content-hash = "0114cd5ff6f51e66caf2a287d7cd723e38549ec1c57b4999a2585ac6c86b9b06"
|
||||
python-versions = "*"
|
||||
|
||||
[metadata.files]
|
||||
gunicorn = [
|
||||
{file = "gunicorn-19.10.0-py2.py3-none-any.whl", hash = "sha256:c3930fe8de6778ab5ea716cab432ae6335fa9f03b3f2c3e02529214c476f4bcb"},
|
||||
{file = "gunicorn-19.10.0.tar.gz", hash = "sha256:f9de24e358b841567063629cd0a656b26792a41e23a24d0dcb40224fc3940081"},
|
||||
]
|
12
tests/dependency-environment/pyproject.toml
Normal file
12
tests/dependency-environment/pyproject.toml
Normal file
|
@ -0,0 +1,12 @@
|
|||
[tool.poetry]
|
||||
name = "trivial"
|
||||
version = "0.1.0"
|
||||
description = "poetry2nix test"
|
||||
authors = ["Your Name <you@example.com>"]
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
gunicorn = "*"
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry>=0.12"]
|
||||
build-backend = "poetry.masonry.api"
|
10
tests/dependency-environment/trivial.py
Normal file
10
tests/dependency-environment/trivial.py
Normal file
|
@ -0,0 +1,10 @@
|
|||
def app(environ, start_response):
|
||||
"""Simplest possible application object"""
|
||||
data = b'Hello, World!\n'
|
||||
status = '200 OK'
|
||||
response_headers = [
|
||||
('Content-type', 'text/plain'),
|
||||
('Content-Length', str(len(data)))
|
||||
]
|
||||
start_response(status, response_headers)
|
||||
return iter([data])
|
Loading…
Add table
Reference in a new issue