|
1 | 1 | from pathlib import Path |
| 2 | +from types import SimpleNamespace as sn |
2 | 3 | import nox |
3 | 4 |
|
4 | 5 | def session(func) : return nox.session(venv_backend='none')(func) |
5 | 6 |
|
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('-', '_') |
8 | 9 |
|
9 | 10 | @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' }) |
11 | 12 | @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' }) |
13 | 14 | @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) |
15 | 16 |
|
16 | 17 | @session |
17 | 18 | def bump_patch(session) : session.run('py', 'utils/bump.py', '--patch', *session.posargs) |
|
0 commit comments