https://github.com/flying-sheep/get_version
Automatically use the latest “vX.X.X” tag as version in your Python package
https://github.com/flying-sheep/get_version
Last synced: 2 months ago
JSON representation
Automatically use the latest “vX.X.X” tag as version in your Python package
- Host: GitHub
- URL: https://github.com/flying-sheep/get_version
- Owner: flying-sheep
- License: gpl-3.0
- Created: 2018-07-19T10:24:15.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2025-04-22T06:51:29.000Z (2 months ago)
- Last Synced: 2025-04-23T19:24:37.516Z (2 months ago)
- Language: Python
- Size: 133 KB
- Stars: 13
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
get_version |b-pypi| |b-conda| |b-ci| |b-cover|
===============================================
Automatically use the latest “vX.X.X” Git tag as version in your Python package.It also supports getting the version from Python source distributions (``sdist``) or,
once your package is installed, via ``importlib.metadata``.usage
-----
Add the following into ``yourpackage.py`` (or ``__init__.py``):.. code-block:: python
from get_version import get_version
__version__ = get_version(__file__)
del get_version.. |b-ci| image:: https://github.com/flying-sheep/get_version/actions/workflows/run_tests.yml/badge.svg
:target: https://github.com/flying-sheep/get_version/actions/workflows/run_tests.yml
.. |b-cover| image:: https://coveralls.io/repos/github/flying-sheep/get_version/badge.svg
:target: https://coveralls.io/github/flying-sheep/get_version
.. |b-pypi| image:: https://img.shields.io/pypi/v/get_version.svg
:target: https://pypi.org/project/get_version
.. |b-conda| image:: https://img.shields.io/conda/vn/conda-forge/get_version.svg
:target: https://anaconda.org/conda-forge/get_version