Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tillahoffmann/version-wizard
https://github.com/tillahoffmann/version-wizard
Last synced: 27 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/tillahoffmann/version-wizard
- Owner: tillahoffmann
- License: bsd-3-clause
- Created: 2022-10-25T13:16:44.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-25T20:50:03.000Z (about 2 years ago)
- Last Synced: 2024-09-14T03:56:34.075Z (about 2 months ago)
- Language: Python
- Size: 13.7 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
🧙 version-wizard
=================.. image:: https://github.com/tillahoffmann/version-wizard/actions/workflows/main.yml/badge.svg
:target: https://github.com/tillahoffmann/version-wizard/
.. image:: https://badge.fury.io/py/version-wizard.svg
:target: https://pypi.org/project/version-wizard/
.. image:: https://readthedocs.org/projects/version-wizard/badge/?version=latest
:target: https://version-wizard.readthedocs.io/en/latest/?badge=latestThe version wizard extracts version information from a git tag and includes it in your python package so you don't have to worry about commit messages like :code:`Bump version to 0.8.1` anymore. Here's how to use the wizard:
1. Install by running :code:`pip install version-wizard`.
2. Add :code:`include VERSION` to your :code:`MANIFEST.in` file (or create one by running :code:`echo "include VERSION" > MANIFEST.in`).
3. Update your :code:`setup.py` as shown below.
4. Push `semantic versioning `_ tags to your GitHub branch, e.g, :code:`0.8.1`... code-block:: python
# setup.py
from setuptools import setup, ...
from version_wizard import from_github_tagsetup(
version=from_github_tag(),
...
)Behind the scenes
-----------------The call to :code:`from_github_tag` will do one of two things:
1. If the :code:`VERSION` file exists, it simply returns its contents. This is the typical behavior when your installing the package from pypi, for example.
2. If the :code:`VERSION` file does *not* exist, it will try to extract the version from the :code:`GITHUB_REF` environment variable and write it to the :code:`VERSION` file.Because the :code:`MANIFEST.in` includes :code:`VERSION`, the :code:`VERSION` file will be included in any distribution, e.g., when you run :code:`python setup.py sdist`. The correct version is thus automatically packaged with your distribution elminiating any possible inconsistencies.
Interface
---------.. automodule:: version_wizard
:members: