Commit graph

15 commits

Author SHA1 Message Date
Abu Talha
21ed19c264 verify_release: PEP 484 compliant annotations
Signed-off-by: Abu Talha <itsabutalha@gmail.com>
2022-11-21 06:41:17 +00:00
Joshua Lock
4c8e965169 verify_release: do a deep comparison of the files
dircmp[1] does a shallow[2] comparison of files, that is only the file
type, size and modification time are compared -- not the file size or
contents. Therefore, switch to using cmp with the shallow option set to
False to perform a full comparison of the local files and retrieved files.

1. https://docs.python.org/3/library/filecmp.html?filecmp.dircmp#filecmp.dircmp
2. https://docs.python.org/3/library/filecmp.html?filecmp.dircmp#filecmp.cmp

Signed-off-by: Joshua Lock <jlock@vmware.com>
2022-09-29 20:47:21 +01:00
Lukas Puehringer
7b9cf4ac8e verify_release: add constant 5s HTTP timeout
Add 5 seconds HTTP timeout constant and use it for requests to
GitHub. Setting timeout is recommended by requests docs and flagged
by latest pylint:
```
W3101: Missing timeout argument for method 'requests.get' can cause
your program to hang indefinitely (missing-timeout)
```
https://requests.readthedocs.io/en/latest/user/quickstart/#timeouts

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2022-08-30 09:06:17 +02:00
Jussi Kukkonen
96232d2db0 verify_release: Tweak pip download
It seems --no-deps does not work as it used to (and actually installs
all build dependencies). This is very bad because verify_release also
uses "--no-binary :all:" leading to actually _building_ all build
dependencies from source.

Use "--no-binary tuf" instead: build dependencies will still be
installed (into a working environment) but at least they won't be built
from source.

Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
2022-04-27 17:54:36 +03:00
Lukas Pühringer
a3d5a37e43 build: minor style/wording fixes in verify_release
Co-authored-by: Joshua Lock <jlock@vmware.com>
Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2022-04-27 13:09:48 +02:00
Lukas Puehringer
e56ff07b1a build: add 'gpg sign' option to verify_release
Add option to sign locally built release artifacts with gpg,
if they match the downloaded artifacts from GitHub, PyPI.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2022-04-27 12:47:15 +02:00
Lukas Puehringer
e7544bfbe7 build: fix success message in verify_release
Prior to #1946 the verify_release script was successful if both PyPI
and GitHub release artifacts matched the local build.

Now, if the `--skip-pypi` option is provided, the script can also
be successful if only the GitHub release artifacts match the local
build.

This commit splits the final success message in two separate
success messages, one for PyPI and one for GitHub.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2022-04-27 12:34:07 +02:00
Lukas Pühringer
72424a958b
Merge pull request #1946 from lukpueh/auto-release
Add GH workflow to build and release on GH and PyPI
2022-04-21 13:03:25 +02:00
Jussi Kukkonen
62580abf9c verify_release: Build from git sources only
Make a new (local) git clone to build from. This ensures uncommitted
files do not affect the build.

Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
2022-04-08 16:54:02 +03:00
Lukas Puehringer
4f275ad636 build: add skip-pypi flag to verify_release script
Add '--skip-pypi' flag to 'verify_release' script to allow for
pre-release checks, when the automatic build job has uploaded the
build assets to GitHub and is awaiting review/approval in order to
upload it to PyPI eventually.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2022-04-07 12:16:00 +02:00
Lukas Puehringer
a76ed28c02 build: lint 'verify_release' with tox
Enable tox to lint 'verify_release' script and fix:
- whitespace
- unused import (we only import here to see if the module is
  available for use in a subprocess)
- unfound import (same as unused import)

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2022-04-07 12:16:00 +02:00
Jussi Kukkonen
bf878ceaa6 verify_release: Warn about missing requirements
This is mostly useful for build module as it's not imported otherwise:
we explicitly call "python -m build" so everything works like in a
real release build.

Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
2022-03-25 11:50:15 +02:00
Jussi Kukkonen
6819d4174a verify_release: Be specific about expected artifacts
Use a hard-coded list of artifacts that we expect to find in a
release. Specifically check that each of those files matches
the corresponding file in locally built release.

Also add two missing annotations.

Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
2022-03-24 14:39:59 +02:00
Jussi Kukkonen
65d6503e63 verify_release: Be explicit about PyPI version
We are interested in what pip thinks is the current tuf version: make
that explicit in method naming and comments.

Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
2022-03-23 15:22:27 +02:00
Jussi Kukkonen
53bacdf7e3 build: Add verify-release script
verify-release
* Builds a release from current commit
* Notifies if git describe does not match built version
* Notifies if built version is not the latest GitHub or PyPI version
* Asserts that the GitHub and PyPI release artifacts match the built
  release artifacts

This should be useful after release as any developer (or a CI job) can
easily verify that the release matches the sources in git.

Note that the last checks currently fail as the 1.0 build was not
reproducible. They should succeed after next release.

Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
2022-03-22 14:47:17 +02:00