Skip to content

Commit ed18e17

Browse files
committed
Moved pkg_<dir|name> into pkg
1 parent 1427f75 commit ed18e17

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

remove-json-keys/noxfile.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
from pathlib import Path
2+
from types import SimpleNamespace as sn
23
import nox
34

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

6-
pkg_dir = Path(__file__).parent.name
7-
pkg_name = pkg_dir.replace('-', '_')
7+
pkg = sn(dir=Path(__file__).parent.name)
8+
pkg.name = pkg.dir.replace('-', '_')
89

910
@session
10-
def test(session) : session.run('py', '-m', pkg_name, *session.posargs, env={ 'PYTHONPATH': 'src' })
11+
def test(session) : session.run('py', '-m', pkg.name, *session.posargs, env={ 'PYTHONPATH': 'src' })
1112
@session
12-
def test_help(session) : session.run('py', '-m', pkg_name, '--help', *session.posargs, env={ 'PYTHONPATH': 'src' })
13+
def test_help(session) : session.run('py', '-m', pkg.name, '--help', *session.posargs, env={ 'PYTHONPATH': 'src' })
1314
@session
14-
def test_build(session) : session.run('pip', 'install', '-e', '.') ; session.run(pkg_dir, *session.posargs)
15+
def test_build(session) : session.run('pip', 'install', '-e', '.') ; session.run(pkg.dir, *session.posargs)
1516

1617
@session
1718
def bump_patch(session) : session.run('py', 'utils/bump.py', '--patch', *session.posargs)

translate-messages/noxfile.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
from pathlib import Path
2+
from types import SimpleNamespace as sn
23
import nox
34

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

6-
pkg_dir = Path(__file__).parent.name
7-
pkg_name = pkg_dir.replace('-', '_')
7+
pkg = sn(dir=Path(__file__).parent.name)
8+
pkg.name = pkg.dir.replace('-', '_')
89

910
@session
10-
def test(session) : session.run('py', '-m', pkg_name, *session.posargs, env={ 'PYTHONPATH': 'src' })
11+
def test(session) : session.run('py', '-m', pkg.name, *session.posargs, env={ 'PYTHONPATH': 'src' })
1112
@session
12-
def test_help(session) : session.run('py', '-m', pkg_name, '--help', *session.posargs, env={ 'PYTHONPATH': 'src' })
13+
def test_help(session) : session.run('py', '-m', pkg.name, '--help', *session.posargs, env={ 'PYTHONPATH': 'src' })
1314
@session
14-
def test_build(session) : session.run('pip', 'install', '-e', '.') ; session.run(pkg_dir, *session.posargs)
15+
def test_build(session) : session.run('pip', 'install', '-e', '.') ; session.run(pkg.dir, *session.posargs)
1516

1617
@session
1718
def bump_patch(session) : session.run('py', 'utils/bump.py', '--patch', *session.posargs)

0 commit comments

Comments
 (0)