[PATCH 1 of 3] scripts: new maintainer script validate-minimum-dependency-versions
Thomas De Schampheleire
patrickdepinguin at gmail.com
Tue Oct 22 19:23:26 UTC 2019
El mar., 22 oct. 2019 a las 13:01, Mads Kiilerich
(<mads at kiilerich.com>) escribió:
>
> On 10/21/19 10:19 PM, Thomas De Schampheleire wrote:
> > # HG changeset patch
> > # User Thomas De Schampheleire <thomas.de_schampheleire at nokia.com>
> > # Date 1571684857 -7200
> > # Mon Oct 21 21:07:37 2019 +0200
> > # Node ID d13fbe9d0a9e6b59e11cf8c546da66672b087c96
> > # Parent f00117816704857e610250e3ffca987a745a2284
> > scripts: new maintainer script validate-minimum-dependency-versions
> >
> > Automate what we can.
> >
> > This script could be added later to an encompassing script
> > 'prepare-for-release' (which would also do other release-related steps).
> >
> > The inverse script to test maximum versions is more difficult, because we
> > currently express the upper bound as '< xxx' which we cannot change to '==
> > xxx' because the original range does not include 'xxx'.
> > It would be easier if we'd express the upper bound as '<= yyy' instead.
>
>
> But we can't do that, as we want to allow for minor version bumps with
> bugfixes.
>
> Also, the main use case for validation of upper bounds must be to see if
> pip has later versions that probably should be supported.
> The best way to do that might be to first install as usual, dump `pip
> freeze`, then install again without upper bounds at all (with
> exceptions, that perhaps should have comments in setup.py), and compare
> pip freeze (for the targets that we install explicitly).
>
>
> >
> > diff --git a/scripts/validate-minimum-dependency-versions b/scripts/validate-minimum-dependency-versions
> > new file mode 100755
> > --- /dev/null
> > +++ b/scripts/validate-minimum-dependency-versions
> > @@ -0,0 +1,58 @@
> > +#!/usr/bin/env bash
> > +# Test that installation of all dependencies works fine if versions are set to
> > +# the minimum ones.
> > +
> > +set -e
> > +
> > +if [ -n "$VIRTUAL_ENV" ]; then
> > + echo "This script will create its own virtualenv - please don't run it inside an existing one." >&2
> > + exit 1
> > +fi
> > +
> > +if ! hg update --check -q .; then
> > + echo "Working dir is not clean, please commit/revert changes first." >&2
> > + exit 1
> > +fi
> > +
> > +cd "$(hg root)"
> > +
> > +venv=build/minimum-dependency-versions-venv
> > +log=build/minimum-dependency-versions-log
>
>
> Perhaps make that .log
>
>
> > +echo "virtualenv: $venv"
> > +echo "log: $log"
> > +
> > +# clean up previous runs
> > +rm -rf "$venv" "$log"
> > +mkdir -p "$venv"
> > +
> > +# Set minimum versions
> > +sed -i '/"/s/>=/==/' setup.py dev_requirements.txt
>
>
> As mentioned before, perhaps first pip install on default setup.py (to
> make sure we get dependencies not covered by the following), then create
> a requirements.txt with explicit minimum versions.
For testing the maximum versions, I think I understand what you mean.
But for minimum versions, I don't what you suggest to change.
Could you clarify?
Thanks,
Thomas
More information about the kallithea-general
mailing list