Backgroup
If you want to release python project on PyPI, you must need to know about PyPI usage characteristics, then I did some test about pip install command.
For example: I have a Python project called demo-pip
. and beta release would like 1.1.0.xxxx
, offical release version is 1.1.0
to see if could success upgrade when using pip
command.
Base on the below test results, I summarized as follows:
- Install a specific version of demo-pip from PyPI, with
--upgrade
option or not, they’ll all both success. - Install the latest package version of demo-pip from PyPI that version is large than the locally installed package version, with
--upgrade
option installs successfully. without--upgrade
option install failed. - Install the latest package version of demo-pip from PyPI that version is less than the locally installed package version, with
--upgrade
option or not, install failed. - 1.1.0.xxxx version naming is OK, but when the beta version is larger than 1.1.0, for example, the beta version is 1.1.0.1000, pip install with
--upgrade
not work when our official release version is 1.1.0.
a. One option is the official release version start from 1.1.0.1000, beta version starts from 1.1.0.0001, 1.1.0.0002… Or the beta version should be less than 1.1.0, maybe 1.0.0.xxxx
b. Another option is follow up python official versioning that is the best practice, then the beta release version will be 1.1.b1, 1.1.b2, 1.1.bN… (it passed No.5 test below)