Read version variable from _version.py and make incremental version
Project description
Authbox Setup Version
Overview
Setup file of library has version parameter. This library help you to generate version and increment version for next release.
How to use?
Just type:
> pip install authbox-setup-version
Example code:
> from authbox-setup-version import get_version, increment_version
> get_version('path/to/_version.py')
> 1.0.31
> increment_version('path/to/_version.py')
> # from 1.0.31 become 1.0.32
> increment_version('path/to/_version.py', major=1)
> # from 1.0.31 become 2.0.31
> increment_version('path/to/_version.py', minor=1)
> # from 1.0.31 become 1.1.31
file '_version.py' has been generate using other library, name 'incremental'
> pip install incremental
generate file '_version.py'
> python -m incremental.update <package_name> --create
Example setup.py:
from setuptools import setup, find_packages
from authbox_setup_version import get_version, increment_version
setup(
name='package-name',
version=get_version('/path/to/_version.py'),
description='short desctiption',
author='Iwan Setiawan',
author_email="suratiwan03@gmail.com",
packages=find_packages(exclude=['tests', 'tests.*']),
classifiers=[
'License :: OSI Approved :: BSD License',
'Intended Audience :: Developers',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
],
)
Testing:
Activate your virtual environment using 'venv' or 'pyenv' or up your choice. And type this code in command prompt:
> git pull git@github.com:PROJECT-AUTHBOX/authbox-setup-version.git
> cd authbox-setup-version
> pytest
> result:
=========================== test session starts =======================
platform linux -- Python 3.8.18, pytest-8.0.2, pluggy-1.4.0
rootdir: /path/to/library/authbox_setup_version
collected 2 items
tests/test_init.py .. [100%]
============================= 2 passed in 0.37s =======================
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file authbox-setup-version-1.0.8.tar.gz
.
File metadata
- Download URL: authbox-setup-version-1.0.8.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c06115af685651318a1ccd7db4e71c7976c77f7ef19277df071872b845c31c3e |
|
MD5 | 5f6f84ebe4fda2edf953608026a60507 |
|
BLAKE2b-256 | 5ef481cc1d9e7c18dcda76c9f4c55cb61fd63a5869f417b467ae397b4bc83f7d |
Provenance
File details
Details for the file authbox_setup_version-1.0.8-py3-none-any.whl
.
File metadata
- Download URL: authbox_setup_version-1.0.8-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d16669f68c9b459d3f1c033e1767cb50c39dbbb915376e05e50454bd4a8fb7a8 |
|
MD5 | 0b429a4c2ce22201d6d1c966d25b18a5 |
|
BLAKE2b-256 | 18629b5480c82953a9e709ad0601725a5835c495c4e36ad00b66455e641e870f |