How to "pip-upgrade" a (private) package from a VCS (git) repository?

Viewed 317

i've installed a private package with :

pip install git+https://gitlab.com/toto/titi.git@master

my private packge is:

└───titi
    │   README.md
    │   setup.py
    └───titi
            functions.py
            __init__.py

my setup.py before the upgrade was :

import setuptools

with open("README.md", "r") as fh:
    long_description = fh.read()

setuptools.setup(
    name="titi",
    version="0.0.1",
    author="toto",
    author_email="titi@gmail.com",
    description="pouet",
    long_description=long_description,
    url="+https://gitlab.com/toto/titi",
    packages=setuptools.find_packages(),
    classifiers=[
        "Programming Language :: Python :: 3",
        "License :: raymond :: aron",
        "Operating System :: OS Independent",
    ],
)

i've changed things in my package and updated setup.py :

import setuptools

with open("README.md", "r") as fh:
    long_description = fh.read()

setuptools.setup(
    name="gitandpip",
    version="0.0.2",
    author="toto",
    author_email="titi@gmail.com",
    description="pouet",
    long_description=long_description,
    url="+https://gitlab.com/toto/titi",
    packages=setuptools.find_packages(),
    classifiers=[
        "Programming Language :: Python :: 3",
        "License :: raymond :: aron",
        "Operating System :: OS Independent",
    ],
)

but when i do a :

pip install --upgrade titi 

i have a :

Requirement already satisfied: titi in /home/toto/.local/share/virtualenvs/test_module-EH1iEwqJ/lib/python3.7/site-packages (0.0.1)

How to upgrade my private package ?

I can do a

pip uninstall titi

then

pip install git+https://gitlab.com/toto/titi.git@master

But it's not elegant.

regards

0 Answers
Related