Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Puppet pre-releases causing corrective changes #549

Open
negast opened this issue May 29, 2020 · 4 comments · May be fixed by egnyte/puppet-python#1
Open

Puppet pre-releases causing corrective changes #549

negast opened this issue May 29, 2020 · 4 comments · May be fixed by egnyte/puppet-python#1

Comments

@negast
Copy link

negast commented May 29, 2020

Pip pre releases are set as the latest available package by puppet.
This is done by following command

pip --log /tmp/pip.log install pip==notreallyaversion 2>&1 | grep -oP "\(from versions: .*\)" | sed -E "s/\(from versions: (.*?, )*(.*)\)/\2/g" | tr -d "[:space:]") = $(pip freeze --all | grep -i -e ^pip== | cut -d= -f3 | tr -d '[:space:]'

As of time of writing i got 20.2b1
however when you try to upgrade you dont get the pre release but latest stable version as that is not tagged latest version
https://pypi.org/project/pip/#history

Thus puppet tries to correct this each time and you get a coorective change.

I think the check command should be changed so the pre releases are excluded from the latest version check. Or have the option to install pre-releases and keep the old check.

I checked and following command gave me the latest release:

pip --log /tmp/pip.log install pip==notreallyaversion 2>&1 | grep -oP "\(from versions: .*\)" | tr " " "\n" | grep -v b | sed 's/,//g' | tail -n 1

@creativefre
Copy link

Any updates on this?

@gdubicki
Copy link
Member

We are also affected by this and I would like to fix it.

But it's at least slightly more complicated than you suggest, @negast. Pre-releases have more possible segments than "bN", see https://peps.python.org/pep-0440/#pre-releases .

@gdubicki
Copy link
Member

I think that this works, although it could use some optimisation (probably one sed in place of tr and those 2 seds will do):
pip install pip==notreallyaversion 2>&1 | grep -oP "(from versions: .*)" | tr " " "\n" | sed 's/,//g' | sed 's/)//g' | grep -vP '\d(a|b|rc)\d+((\.post|dev)\d+)?$' | tail -n 1

@gdubicki
Copy link
Member

Note to self: we need to remember that the behavior of this should change if we add —pre to the params passed to pip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants