Skip to main content

Quickly change the version of stack by adjusting the compose file

Project description

setversion

Commandline tool to update version numbers in a project.

Existing tools already exist such as bump-my-version. This tool's uniqueness is in the use of code comments to designate version strings to change.

Usage

usage: setversion.py [-h] {init,search,bump} ...

Quickly change the version of stack by adjusting the compose file.

positional arguments:
  {init,search,bump}  command help
    init              Create settings file to prep folder for use
    search            Search source files
    bump              Bump version

options:
  -h, --help          show this help message and exit

Generate Steps to get started are:

  1. Initialize a project folder (creates setversion.ini)

    $ setversion init /my/project
    Initial version: 1.0.0
    Initialized /my/project/setversion.ini
    
  2. Find occurrences of your version string in the project

    $ cd /my/project
    $ setverion search 1.0.0
    
    Project:     /my/project
    
    build\lib\setversion.py[14]: VERSION='1.0.0'
    pyproject.toml[7]: version = "1.0.0"
    README.md[30]: Initial version: 1.0.0
    setversion.egg-info\PKG-INFO[3]: Version: 1.0.0
    setversion.ini[2]: current_version = 1.0.0
    setversion.py[14]: VERSION='1.0.0'
    
  3. Modify your source files with markers

    [build-system]
    requires = ["setuptools>=61.0", "wheel"]
    build-backend = "setuptools.build_meta"
    
    [project]
    name = "setversion"
    version = "1.0.0"      # setversion      <--------------------------------------------
    description = "Quickly change the version of stack by adjusting the compose file"
    authors = [
        {name = "Nathan Shearer", email = "shearern@gmail.com"}
    ]
    readme = "README.md"
    license = {text = "MIT"}
    requires-python = ">=3.7"
    
    [project.scripts]
    setversion = "setversion:main"
    
    [tool.setuptools]
    py-modules = ["setversion"]
    
  4. Now you can bump the version as needed

    Project:     /my/project
    Component:   default
    Current:     1.0.0
    New Version: 1.0.1
    
    pyproject.toml[7]: version = "1.0.1" # setversion
    README.md[40]: build\lib\setversion.py[14]: VERSION='1.0.1'
    README.md[44]: setversion.ini[2]: current_version = 1.0.1
    README.md[45]: setversion.py[14]: VERSION='1.0.1'
    README.md[55]: version = "1.0.1"      # setversion      <--------------------------------------------
    setversion.py[14]: VERSION='1.0.1' # setversion
    
    Continue (y/n)? y
    
    Modifying pyproject.toml
    Modifying README.md
    Modifying setversion.ini
    Modifying setversion.py
    
    Finished
    

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

setversion-1.0.1.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

setversion-1.0.1-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file setversion-1.0.1.tar.gz.

File metadata

  • Download URL: setversion-1.0.1.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for setversion-1.0.1.tar.gz
Algorithm Hash digest
SHA256 a2d46848b8a55a698ee6abc6d4174f6742d1d43341947a5eb274ec0ebfe6b18e
MD5 aed72e64c38962d81506a1d96a302274
BLAKE2b-256 80106d4007eba101ad60b92361e0b85c2cd541816c16b8fd0c4a25fe24147b42

See more details on using hashes here.

File details

Details for the file setversion-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: setversion-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for setversion-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1b75339f4e0e8d41881afebf3a55f5226f9b7604f899556e82f5994ffcc30e9a
MD5 5cac4cebfa9fb39485b7040cee379699
BLAKE2b-256 1bff7fd30b527657f96763b536899b56996cf49bd132f786df3aff04143cd988

See more details on using hashes here.

Supported by

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