Skip to content
This repository was archived by the owner on Jan 26, 2026. It is now read-only.
This repository was archived by the owner on Jan 26, 2026. It is now read-only.

Improve extraction of version #137

@mathisloevenich

Description

@mathisloevenich

It would be nice to get the current version with:
htcanalyze --version dynimically with by the latest tag number.

The current solution uses pip, under the condition that the script was installed with pip:

def version():
    """Get version from setup.py."""
    output = subprocess.check_output(
        "pip show htcanalyze | grep Version",
        shell=True
    )
    return output.decode('utf-8').split()[-1]

There are some modules that are able to do so, but they seem to add more complexety than they solve.
Look at the column: Write discovered version to a file of the comparisons described here.

I don't like the standard way of defininig a __version__ variable as this is not bounded to the lastest tag version

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions