Skip to content

Commit a85ff27

Browse files
committed
Abstracted pkg_<dir|name>, deleted bump()
1 parent 48ee5e7 commit a85ff27

2 files changed

Lines changed: 12 additions & 8 deletions

File tree

remove-json-keys/noxfile.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
import nox
2+
from pathlib import Path
23

34
def session(func) : return nox.session(venv_backend='none')(func)
45

6+
pkg_dir = Path(__file__).parent.name
7+
pkg_name = pkg_dir.replace('-', '_')
8+
59
@session
6-
def test(session) : session.run('py', '-m', 'remove_json_keys', *session.posargs, env={'PYTHONPATH': 'src'})
10+
def test(session) : session.run('py', '-m', pkg_name, *session.posargs, env={'PYTHONPATH': 'src'})
711
@session
8-
def test_build(session) : session.run('pip', 'install', '-e', '.') ; session.run('remove_json_keys', *session.posargs)
12+
def test_build(session) : session.run('pip', 'install', '-e', '.') ; session.run(pkg_dir, *session.posargs)
913

10-
@session
11-
def bump(session) : session.run('py', 'utils/bump.py', *session.posargs)
1214
@session
1315
def bump_patch(session) : session.run('py', 'utils/bump.py', '--patch', *session.posargs)
1416
@session

translate-messages/noxfile.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
import nox
2+
from pathlib import Path
23

34
def session(func) : return nox.session(venv_backend='none')(func)
45

6+
pkg_dir = Path(__file__).parent.name
7+
pkg_name = pkg_dir.replace('-', '_')
8+
59
@session
6-
def test(session) : session.run('py', '-m', 'translate_messages', *session.posargs, env={'PYTHONPATH': 'src'})
10+
def test(session) : session.run('py', '-m', pkg_name, *session.posargs, env={'PYTHONPATH': 'src'})
711
@session
8-
def test_build(session) : session.run('pip', 'install', '-e', '.') ; session.run('translate-messages', *session.posargs)
12+
def test_build(session) : session.run('pip', 'install', '-e', '.') ; session.run(pkg_dir, *session.posargs)
913

10-
@session
11-
def bump(session) : session.run('py', 'utils/bump.py', *session.posargs)
1214
@session
1315
def bump_patch(session) : session.run('py', 'utils/bump.py', '--patch', *session.posargs)
1416
@session

0 commit comments

Comments
 (0)