How to only pip install the latest tagged version when using setuptools_scm

202 Views Asked by At

I'm using setuptools_scm for version control for a python project. I'm also using Python 3.10 and am on Windows 10.

My 2nd to last commit is tagged with "v0.1" At this stage, I installed my package using the line below and got version 0.1 automatically installed:

python -m pip install git+url

My last commit was pushed after I installed my package, but I did not tag it. However, when I tried to install my package in a different venv, version 0.2.dev1+[key] of my package got installed.

I'm aware that this versioning is the intended behavior of setuptools_scm, but I specifically want only the latest tagged version of my package to be installed when I run

python -m pip install git+url

In this case, I want v0.1 to be automatically installed, not version 0.2.dev1+[key], when installing it for the first time.

I would also like for my package to only be given the outdated status if a new tag is created and not when any commit is pushed. This would be applicable for

python -m pip list --outdated

python -m pip install --update

One obvious work around is

python -m pip install git+url@v0.1

However, this requires knowing what the latest tagged version is.

My question is this: Is there a way to only be able to install tagged commits of my package instead of also the automatically generated ones from scm?

0

There are 0 best solutions below