Skip to content

Commit 8032024

Browse files
committed
Added publish/release scripts
1 parent 2cf3b79 commit 8032024

2 files changed

Lines changed: 36 additions & 32 deletions

File tree

remove-json-keys/noxfile.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,34 @@
33
import nox
44

55
@nox.session(venv_backend='none')
6-
def bump_major(session):
7-
session.run('python', 'utils/bump.py', '--major', *session.posargs)
6+
def bump_patch(session) : session.run('python', 'utils/bump.py', '--patch', *session.posargs)
87

98
@nox.session(venv_backend='none')
10-
def bump_minor(session):
11-
session.run('python', 'utils/bump.py', '--minor', *session.posargs)
9+
def bump_minor(session) : session.run('python', 'utils/bump.py', '--minor', *session.posargs)
1210

1311
@nox.session(venv_backend='none')
14-
def bump_patch(session):
15-
session.run('python', 'utils/bump.py', '--patch', *session.posargs)
12+
def bump_major(session) : session.run('python', 'utils/bump.py', '--major', *session.posargs)
1613

1714
@nox.session(venv_backend='none')
18-
def build(session):
19-
clean(session)
20-
session.run('python', '-m', 'build')
21-
print('Build complete!')
15+
def build(session) : clean(session) ; session.run('python', '-m', 'build') ; print('Build complete!')
16+
17+
@nox.session(venv_backend='none')
18+
def publish(session) : session.run('bash', 'utils/publish.sh', *session.posargs)
19+
20+
@nox.session(venv_backend='none')
21+
def release_patch(session) : bump_patch(session) ; build(session) ; publish(session)
22+
23+
@nox.session(venv_backend='none')
24+
def release_minor(session) : bump_minor(session) ; build(session) ; publish(session)
25+
26+
@nox.session(venv_backend='none')
27+
def release_major(session) : bump_major(session) ; build(session) ; publish(session)
2228

2329
@nox.session(venv_backend='none')
2430
def clean(session):
2531
paths_to_remove = ['dist', 'build']
2632
for path in paths_to_remove:
27-
if Path(path).exists():
28-
shutil.rmtree(path)
29-
print(f'Removed {path}/')
33+
if Path(path).exists() : shutil.rmtree(path) ; print(f'Removed {path}/')
3034
for item in Path('.').glob('*.egg-info'):
31-
if item.is_dir():
32-
shutil.rmtree(item)
33-
print(f'Removed {item}/')
35+
if item.is_dir() : shutil.rmtree(item) ; print(f'Removed {item}/')
3436
print('Clean complete!')

translate-messages/noxfile.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,34 @@
33
import nox
44

55
@nox.session(venv_backend='none')
6-
def bump_major(session):
7-
session.run('python', 'utils/bump.py', '--major', *session.posargs)
6+
def bump_patch(session) : session.run('python', 'utils/bump.py', '--patch', *session.posargs)
87

98
@nox.session(venv_backend='none')
10-
def bump_minor(session):
11-
session.run('python', 'utils/bump.py', '--minor', *session.posargs)
9+
def bump_minor(session) : session.run('python', 'utils/bump.py', '--minor', *session.posargs)
1210

1311
@nox.session(venv_backend='none')
14-
def bump_patch(session):
15-
session.run('python', 'utils/bump.py', '--patch', *session.posargs)
12+
def bump_major(session) : session.run('python', 'utils/bump.py', '--major', *session.posargs)
1613

1714
@nox.session(venv_backend='none')
18-
def build(session):
19-
clean(session)
20-
session.run('python', '-m', 'build')
21-
print('Build complete!')
15+
def build(session) : clean(session) ; session.run('python', '-m', 'build') ; print('Build complete!')
16+
17+
@nox.session(venv_backend='none')
18+
def publish(session) : session.run('bash', 'utils/publish.sh', *session.posargs)
19+
20+
@nox.session(venv_backend='none')
21+
def release_patch(session) : bump_patch(session) ; build(session) ; publish(session)
22+
23+
@nox.session(venv_backend='none')
24+
def release_minor(session) : bump_minor(session) ; build(session) ; publish(session)
25+
26+
@nox.session(venv_backend='none')
27+
def release_major(session) : bump_major(session) ; build(session) ; publish(session)
2228

2329
@nox.session(venv_backend='none')
2430
def clean(session):
2531
paths_to_remove = ['dist', 'build']
2632
for path in paths_to_remove:
27-
if Path(path).exists():
28-
shutil.rmtree(path)
29-
print(f'Removed {path}/')
33+
if Path(path).exists() : shutil.rmtree(path) ; print(f'Removed {path}/')
3034
for item in Path('.').glob('*.egg-info'):
31-
if item.is_dir():
32-
shutil.rmtree(item)
33-
print(f'Removed {item}/')
35+
if item.is_dir() : shutil.rmtree(item) ; print(f'Removed {item}/')
3436
print('Clean complete!')

0 commit comments

Comments
 (0)