Skip to content

Commit 648622a

Browse files
committed
Adopt Poetry and add a Nix build
1 parent d582ffa commit 648622a

43 files changed

Lines changed: 775 additions & 36 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ temp
55
config_local.py
66
logs/
77
input/
8-
static/swaggerui
8+
static/swaggerui
9+
result*

default.nix

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{ sources ? import ./nix/sources.nix
2+
, pkgs ? import sources.nixpkgs { }
3+
, poetry2nix ? import sources.poetry2nix { inherit pkgs; }
4+
}:
5+
6+
let
7+
hackyplayer = poetry2nix.mkPoetryApplication {
8+
groups = [ "prod" ];
9+
projectDir = ./.;
10+
overrides = poetry2nix.overrides.withDefaults (final: prev: {
11+
celery-singleton = prev.celery-singleton.overridePythonAttrs (old: {
12+
postPatch = ''
13+
substituteInPlace pyproject.toml \
14+
--replace-fail "poetry.masonry.api" "poetry.core.masonry.api"
15+
'';
16+
});
17+
});
18+
};
19+
in
20+
hackyplayer.dependencyEnv

hackyplayer/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"""EMF Camp VoC post production pipeline"""
2+
3+
__version__ = '0.0.1'

app.py renamed to hackyplayer/app.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
import flask
1010

1111
# Local
12-
import config
13-
import tasks
12+
from . import config
13+
from . import tasks
1414

1515
app = tasks.flask_app
1616
app_cel = tasks.celery_app
@@ -39,6 +39,7 @@ def get_files(target, ext_filter = []):
3939
except FileNotFoundError:
4040
return None
4141

42+
4243
@app.route("/")
4344
def index():
4445
files = []
@@ -150,7 +151,7 @@ def api_tasks():
150151
"in_tc": task["args"][2],
151152
"out_tc": task["args"][3],
152153
"node": task["hostname"],
153-
"state": state.state
154+
"state": state.state,
154155
})
155156

156157
if scheduled_tasks:
@@ -168,7 +169,7 @@ def api_tasks():
168169
"in_tc": task["args"][2],
169170
"out_tc": task["args"][3],
170171
"node": task["hostname"],
171-
"state": state.state
172+
"state": state.state,
172173
})
173174
return flask.jsonify(result)
174175

@@ -263,4 +264,4 @@ def api_ingest_stop(taskid=None):
263264
return flask.jsonify({'success':True})
264265

265266
if __name__ == "__main__":
266-
app.run(debug=True)
267+
app.run(debug=True)

config.py renamed to hackyplayer/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ def create_app():
5454
)
5555
app.config.from_prefixed_env()
5656
celery_init_app(app)
57-
return app
57+
return app
File renamed without changes.

0 commit comments

Comments
 (0)