-
Notifications
You must be signed in to change notification settings - Fork 3
/
nox.py
48 lines (37 loc) · 1.21 KB
/
nox.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# -*- coding: utf-8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import nox
@nox.session
def translations(session):
session.install('Babel')
session.install('jinja2')
# Extract messages and compile all translations.
# https://github.com/whogoesfirst/who-goes-first/blob/master/docs/TRANSLATING.md
session.run(
'pybabel',
'extract',
'-F',
'babel.cfg',
'--no-wrap',
'-o',
'messages.pot',
'.')
session.run(
'pybabel', 'update', '-i', 'messages.pot', '-d', './translations')
@nox.session
def freeze(session):
# Install all development dependencies.
session.install('-r', 'requirements.txt')
# Freeze the app.
# This should fail if there are any redirects, 404s, or server errors.
session.run('pybabel', 'compile', '-d', './translations')
session.run('python', 'freeze.py')
@nox.session
def lint(session):
session.install('flake8')
session.run('flake8', '--exclude', '.nox,.cache,env', '.')
@nox.session
def js(session):
session.run('npm', 'test')