diff options
author | Calum Lind <calumlind@gmail.com> | 2018-10-02 16:39:51 +0200 |
---|---|---|
committer | Calum Lind <calumlind@gmail.com> | 2018-10-03 16:21:53 +0200 |
commit | b1cdc32f7357e9777eb6cc2d90094c7d122af2eb (patch) | |
tree | 9106ac399a7df178c8dbed6fe58009d36b18159a /packaging/source/make_release.py | |
parent | [Common] Fix config missing value assignment (diff) | |
download | deluge-b1cdc32f7357e9777eb6cc2d90094c7d122af2eb.tar.xz deluge-b1cdc32f7357e9777eb6cc2d90094c7d122af2eb.zip |
[Lint] Use Black to auto-format code
The move to using auto-formatter makes it easier to read, submit and
speeds up development time. https://github.com/ambv/black/
Although I would prefer 79 chars, the default line length of 88 chars
used by black suffices. The flake8 line length remains at 120 chars
since black does not touch comments or docstrings and this will require
another round of fixes.
The only black setting that is not standard is the use of double-quotes
for strings so disabled any formatting of these. Note however that
flake8 will still flag usage of double-quotes. I may change my mind on
double vs single quotes but for now leave them.
A new pyproject.toml file has been created for black configuration.
Diffstat (limited to 'packaging/source/make_release.py')
-rwxr-xr-x | packaging/source/make_release.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/packaging/source/make_release.py b/packaging/source/make_release.py index 62806f04e..542897ed0 100755 --- a/packaging/source/make_release.py +++ b/packaging/source/make_release.py @@ -31,7 +31,11 @@ version = check_output(['python', 'version.py']).strip() # Create release archive release_dir = 'dist/release-%s' % version print('Creating release archive for ' + version) -call('python setup.py --quiet egg_info --egg-base /tmp sdist --formats=tar --dist-dir=%s' % release_dir, shell=True) +call( + 'python setup.py --quiet egg_info --egg-base /tmp sdist --formats=tar --dist-dir=%s' + % release_dir, + shell=True, +) # Compress release archive with xz tar_path = os.path.join(release_dir, 'deluge-%s.tar' % version) @@ -39,13 +43,18 @@ tarxz_path = tar_path + '.xz' print('Compressing tar (%s) with xz' % tar_path) if lzma: with open(tar_path, 'rb') as tar_file, open(tarxz_path, 'wb') as xz_file: - xz_file.write(lzma.compress(bytes(tar_file.read()), preset=9 | lzma.PRESET_EXTREME)) + xz_file.write( + lzma.compress(bytes(tar_file.read()), preset=9 | lzma.PRESET_EXTREME) + ) else: call(['xz', '-e9zkf', tar_path]) # Calculate shasum and add to sha256sums.txt with open(tarxz_path, 'rb') as _file: - sha256sum = '%s %s' % (sha256(_file.read()).hexdigest(), os.path.basename(tarxz_path)) + sha256sum = '%s %s' % ( + sha256(_file.read()).hexdigest(), + os.path.basename(tarxz_path), + ) with open(os.path.join(release_dir, 'sha256sums.txt'), 'w') as _file: _file.write(sha256sum + '\n') |