diff options
author | Florian Bruhin <me@the-compiler.org> | 2021-12-03 15:58:48 +0100 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2021-12-03 15:58:48 +0100 |
commit | 5e6bae39833149c27a4c380be662a05e7f6d08ed (patch) | |
tree | e23225b08ab7aeaa7d653ac6f41ef4a3c14a8849 | |
parent | 42fac2a5c101e2dd07c47e00edc4f078151ee127 (diff) | |
parent | 2378ba7886558436254a8cdd3a455b91bcfc6c8a (diff) | |
download | qutebrowser-5e6bae39833149c27a4c380be662a05e7f6d08ed.tar.gz qutebrowser-5e6bae39833149c27a4c380be662a05e7f6d08ed.zip |
Merge branch 'packaging-update'
# Conflicts:
# misc/requirements/requirements-dev.txt
-rw-r--r-- | misc/requirements/requirements-dev.txt | 19 | ||||
-rw-r--r-- | misc/requirements/requirements-dev.txt-raw | 2 | ||||
-rwxr-xr-x | scripts/dev/build_release.py | 46 | ||||
-rw-r--r-- | scripts/dev/recompile_requirements.py | 11 |
4 files changed, 60 insertions, 18 deletions
diff --git a/misc/requirements/requirements-dev.txt b/misc/requirements/requirements-dev.txt index d9d5c9a34..126924092 100644 --- a/misc/requirements/requirements-dev.txt +++ b/misc/requirements/requirements-dev.txt @@ -1,26 +1,45 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py +bleach==4.1.0 +build==0.7.0 bump2version==1.0.1 certifi==2021.10.8 cffi==1.15.0 charset-normalizer==2.0.8 +colorama==0.4.4 cryptography==36.0.0 Deprecated==1.2.13 +docutils==0.18.1 github3.py==3.0.0 hunter==3.3.8 idna==3.3 +importlib-metadata==4.8.2 +jeepney==0.7.1 jwcrypto==1.0 +keyring==23.4.0 manhole==1.8.0 packaging==21.3 +pep517==0.12.0 +pkginfo==1.8.2 pycparser==2.21 +Pygments==2.10.0 Pympler==0.9 pyparsing==3.0.6 PyQt-builder==1.12.2 python-dateutil==2.8.2 +readme-renderer==30.0 requests==2.26.0 +requests-toolbelt==0.9.1 +rfc3986==1.5.0 +SecretStorage==3.3.1 sip==6.5.0 six==1.16.0 toml==0.10.2 +tomli==1.2.2 +tqdm==4.62.3 +twine==3.7.0 uritemplate==4.1.1 # urllib3==1.26.7 +webencodings==0.5.1 wrapt==1.13.3 +zipp==3.6.0 diff --git a/misc/requirements/requirements-dev.txt-raw b/misc/requirements/requirements-dev.txt-raw index fd840bab1..261f4459f 100644 --- a/misc/requirements/requirements-dev.txt-raw +++ b/misc/requirements/requirements-dev.txt-raw @@ -4,6 +4,8 @@ github3.py bump2version requests pyqt-builder +build +twine # Already included via test requirements #@ ignore: urllib3 diff --git a/scripts/dev/build_release.py b/scripts/dev/build_release.py index 2b3aff4b4..5463441be 100755 --- a/scripts/dev/build_release.py +++ b/scripts/dev/build_release.py @@ -26,6 +26,7 @@ import os.path import sys import time import shutil +import pathlib import plistlib import subprocess import argparse @@ -480,14 +481,17 @@ def build_sdist(): """Build an sdist and list the contents.""" utils.print_title("Building sdist") - _maybe_remove('dist') + dist_path = pathlib.Path('dist') + _maybe_remove(dist_path) - subprocess.run([sys.executable, 'setup.py', 'sdist'], check=True) - dist_files = os.listdir(os.path.abspath('dist')) - assert len(dist_files) == 1 + subprocess.run([sys.executable, '-m', 'build'], check=True) - dist_file = os.path.join('dist', dist_files[0]) - subprocess.run(['gpg', '--detach-sign', '-a', dist_file], check=True) + dist_files = list(dist_path.glob('*.tar.gz')) + filename = 'qutebrowser-{}.tar.gz'.format(qutebrowser.__version__) + assert dist_files == [dist_path / filename], dist_files + dist_file = dist_files[0] + + subprocess.run(['gpg', '--detach-sign', '-a', str(dist_file)], check=True) by_ext = collections.defaultdict(list) @@ -507,11 +511,13 @@ def build_sdist(): utils.print_subtitle(ext) print('\n'.join(files)) - filename = 'qutebrowser-{}.tar.gz'.format(qutebrowser.__version__) artifacts = [ - (os.path.join('dist', filename), 'application/gzip', 'Source release'), - (os.path.join('dist', filename + '.asc'), 'application/pgp-signature', - 'Source release - PGP signature'), + (str(dist_file), 'application/gzip', 'Source release'), + ( + str(dist_file.with_suffix(dist_file.suffix + '.asc')), + 'application/pgp-signature', + 'Source release - PGP signature', + ), ] return artifacts @@ -600,15 +606,19 @@ def github_upload(artifacts, tag, gh_token): def pypi_upload(artifacts): """Upload the given artifacts to PyPI using twine.""" utils.print_title("Uploading to PyPI...") - filenames = [a[0] for a in artifacts] - subprocess.run([sys.executable, '-m', 'twine', 'upload'] + filenames, - check=True) + run_twine('upload', artifacts) -def upgrade_sdist_dependencies(): - """Make sure we have the latest tools for an sdist release.""" - subprocess.run([sys.executable, '-m', 'pip', 'install', '-U', 'twine', - 'pip', 'wheel', 'setuptools'], check=True) +def twine_check(artifacts): + """Check packages using 'twine check'.""" + utils.print_title("Running twine check...") + run_twine('check', artifacts, '--strict') + + +def run_twine(command, artifacts, *args): + filenames = [a[0] for a in artifacts] + subprocess.run([sys.executable, '-m', 'twine', command] + list(args) + filenames, + check=True) def main(): @@ -668,9 +678,9 @@ def main(): elif sys.platform == 'darwin': artifacts = build_mac(gh_token=gh_token, debug=args.debug) else: - upgrade_sdist_dependencies() test_makefile() artifacts = build_sdist() + twine_check(artifacts) upload_to_pypi = True if args.upload: diff --git a/scripts/dev/recompile_requirements.py b/scripts/dev/recompile_requirements.py index f052fe638..89b0fe515 100644 --- a/scripts/dev/recompile_requirements.py +++ b/scripts/dev/recompile_requirements.py @@ -188,6 +188,17 @@ CHANGELOG_URLS = { 'future': 'https://python-future.org/whatsnew.html', 'pefile': 'https://github.com/erocarrera/pefile/commits/master', 'Deprecated': 'https://github.com/tantale/deprecated/blob/master/CHANGELOG.rst', + 'SecretStorage': 'https://github.com/mitya57/secretstorage/blob/master/changelog', + 'bleach': 'https://github.com/mozilla/bleach/blob/main/CHANGES', + 'jeepney': 'https://gitlab.com/takluyver/jeepney/-/blob/master/docs/release-notes.rst', + 'keyring': 'https://github.com/jaraco/keyring/blob/main/CHANGES.rst', + 'pkginfo': 'https://bazaar.launchpad.net/~tseaver/pkginfo/trunk/view/head:/CHANGES.txt', + 'readme-renderer': 'https://github.com/pypa/readme_renderer/blob/main/CHANGES.rst', + 'requests-toolbelt': 'https://github.com/requests/toolbelt/blob/master/HISTORY.rst', + 'rfc3986': 'https://rfc3986.readthedocs.io/en/latest/release-notes/index.html', + 'tqdm': 'https://tqdm.github.io/releases/', + 'twine': 'https://twine.readthedocs.io/en/stable/changelog.html', + 'webencodings': 'https://github.com/gsnedders/python-webencodings/commits/master', } |