[Python] How to store the latest Git commit hash in a Python CLI tool installed via pip?...

Discussão em 'Python' iniciado por Stack, Outubro 1, 2024.

  1. Stack

    Stack Membro Participativo

    I am creating a CLI tool that can be installed through pip install git+. I'm trying to create an update function which needs to verify first if the latest version is same as the installed version. I want to include the latest Git commit hash in the installation and be able to check it later when the tool is run.

    1. During the installation of the tool via pip, retrieve the latest Git commit hash from the repository.
    2. Store this commit hash within the installed package in a way that I can access it when the CLI tool is executed.
    3. If possible, retrieve the commit hash without requiring the .git folder, since it's not available post-installation.

    Continue reading...

Compartilhe esta Página