pythonpip

Is there a way to exclude a specific version when installing a package from pypi using pip?


In my local pypi server let's say I have 3 versions of the package example like below:

example==20200903
example==20200904 
example==202009089 # I need to exclude this
example==20200909

As you can see I have used date to manage our versioning, but in the middle of the versioning we have a package that has a version like 202009089 so it always match as it has a bigger number and the versioning gets broken. Is there a way to exclude that specific version when installing via pip install and install the latest version except 202009089?


Solution

  • One approach would be to number future versions using a new epoch (PEP440)

    For example

    version='1!20200910
    

    another option is to delete the offending package from your internal pypi

    another option is to select example!=202009089 (the bad version) or pin using example==... (some good version)