0

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?

Alireza
  • 5,659
  • 11
  • 52
  • 118

2 Answers2

1

You can:

pip install "example<202000000"

It will pick the last version before the erroneous one: 202009089.

Related answer: https://stackoverflow.com/a/8811418/4709400

stellasia
  • 4,869
  • 4
  • 21
  • 43
1

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)

Anthony Sottile
  • 49,611
  • 12
  • 110
  • 158
  • `pip install example!=202009089` will install the latest version and also ignores the bad version. I will go this way as I do not have access to pypi server. – Alireza Sep 08 '20 at 07:39