Skip to main content

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

authbox-setup-version-1.0.5.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

authbox_setup_version-1.0.5-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file authbox-setup-version-1.0.5.tar.gz.

File metadata

  • Download URL: authbox-setup-version-1.0.5.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for authbox-setup-version-1.0.5.tar.gz
Algorithm Hash digest
SHA256 f3bbe2228f4bdf3fa44621f28e92d7d087e2c358404c27c26b851f8559014ce0
MD5 e925211b2246cea0dedaf76fe03aa144
BLAKE2b-256 4c8b92b31be54eebe9c64201387d6e2ecad68923a9aeabff7a94ab1a758e9515

See more details on using hashes here.

Provenance

File details

Details for the file authbox_setup_version-1.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for authbox_setup_version-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 ebe766a0af364f98788be93280752a8e2de33f586628bfbcd61b1f10c7da4fb5
MD5 4b5f3a85c825d613ce36c001f2df4ab9
BLAKE2b-256 3638dcd11de7efbd9655971506374d8adaf9f4202785baba97939a19f8063f48

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page