puppet-python icon indicating copy to clipboard operation
puppet-python copied to clipboard

Fix update for pre-release version

Open teluq-pbrideau opened this issue 1 year ago • 5 comments
trafficstars

Pull Request (PR) description

Fix the resolution of the latest version from the pip repository, by removing the pre-release version from the list of the latest package available. See #690 for details.

~~I’ve added a boolean parameter pre_release. It should be used instead of install_args => '--pre' for the ensure => latest to be aware of the version. I chose to add this parameter instead of trying to parse the install_args parameter.~~

~~The new pip version (24.1b2) does not support notreallyaversion as a package version. I used 0.0 as replacement~~ EDIT: I’ve reused the version that was changed in master.

:~$ pip --version
pip 24.1b2 from /opt/puppetapi/lib64/python3.9/site-packages/pip (python 3.9)
:~$ pip install pip==notreallyaversion
ERROR: Invalid requirement: 'pip==notreallyaversion': Expected end or semicolon (after name and no valid version specifier)
    pip==notreallyaversion
       ^
:~$ pip install pip==0.0
ERROR: Ignored the following yanked versions: 20.0, 20.3.2, 21.2
ERROR: Could not find a version that satisfies the requirement pip==0.0 (from versions: 0.2, 0.2.1, 0.3, 0.3.1, 0.4, 0.5, 0.5.1, 0.6, 0.6.1, 0.6.2, 0.6.3, 0.7, 0.7.1, 0.7.2, 0.8, 0.8.1, 0.8.2, 0.8.3, 1.0, 1.0.1, 1.0.2, 1.1, 1.2, 1.2.1, 1.3, 1.3.1, 1.4, 1.4.1, 1.5, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.5.5, 1.5.6, 6.0, 6.0.1, 6.0.2, 6.0.3, 6.0.4, 6.0.5, 6.0.6, 6.0.7, 6.0.8, 6.1.0, 6.1.1, 7.0.0, 7.0.1, 7.0.2, 7.0.3, 7.1.0, 7.1.1, 7.1.2, 8.0.0, 8.0.1, 8.0.2, 8.0.3, 8.1.0, 8.1.1, 8.1.2, 9.0.0, 9.0.1, 9.0.2, 9.0.3, 10.0.0b1, 10.0.0b2, 10.0.0, 10.0.1, 18.0, 18.1, 19.0, 19.0.1, 19.0.2, 19.0.3, 19.1, 19.1.1, 19.2, 19.2.1, 19.2.2, 19.2.3, 19.3, 19.3.1, 20.0.1, 20.0.2, 20.1b1, 20.1, 20.1.1, 20.2b1, 20.2, 20.2.1, 20.2.2, 20.2.3, 20.2.4, 20.3b1, 20.3, 20.3.1, 20.3.3, 20.3.4, 21.0, 21.0.1, 21.1, 21.1.1, 21.1.2, 21.1.3, 21.2.1, 21.2.2, 21.2.3, 21.2.4, 21.3, 21.3.1, 22.0, 22.0.1, 22.0.2, 22.0.3, 22.0.4, 22.1b1, 22.1, 22.1.1, 22.1.2, 22.2, 22.2.1, 22.2.2, 22.3, 22.3.1, 23.0, 23.0.1, 23.1, 23.1.1, 23.1.2, 23.2, 23.2.1, 23.3, 23.3.1, 23.3.2, 24.0, 24.1b1, 24.1b2)
ERROR: No matching distribution found for pip==0.0

This Pull Request (PR) fixes the following issues

Fixes #690

teluq-pbrideau avatar Jun 17 '24 16:06 teluq-pbrideau

Well, thinking more about it, it is probably better for me to parse install_args for the --pre flag, because it does not create a breaking change… I’ll modify the PR.

teluq-pbrideau avatar Jun 17 '24 16:06 teluq-pbrideau

Hi @teluq-pbrideau , we recently merged https://github.com/voxpupuli/puppet-python/pull/696 . can you please rebase?

bastelfreak avatar Aug 21 '24 08:08 bastelfreak

I’ve discovered a potential difference when a package have only pre-release version. I’ve tried with the first package i’ve found with this criteria: glint4py: https://pypi.org/project/glint4py/#history

When package installed with pip install, the package is installed, but with the python::pip class with my change, it is required to add the install_args => '--pre' parameter. Not sure it is desired…

Also, I cannot find a package with pre-release and a previous stable release to test as I did with pip==24.1.b2

teluq-pbrideau avatar Aug 22 '24 15:08 teluq-pbrideau

@kenyon just to make sure you understood my previous comment: Every current user of this module will have a breaking change and will have to add install_args => '--pre' if there is no stable release on pypi

teluq-pbrideau avatar Aug 22 '24 20:08 teluq-pbrideau

@teluq-pbrideau thanks for the clarification. I'm not using this functionality of this module, so this doesn't really affect me, but it seems like it's OK if you have to explicitly do something to enable installation of prereleases, even if pip itself doesn't behave this way. But maybe we wait for more input from users to see whether the breaking change is acceptable.

I know some tools like pipenv have extra difficulty dealing with prereleases, so this problem has some precedent in the Python world. The popular formatter black caused a lot of consternation for years because it was only a prerelease: https://github.com/psf/black/issues/517

kenyon avatar Aug 22 '24 21:08 kenyon