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.0.tar.gz (6.8 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.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: setversion-1.0.0.tar.gz
  • Upload date:
  • Size: 6.8 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.0.tar.gz
Algorithm Hash digest
SHA256 8ea75389f2fbbc810c2b92af04dc91b74ebbe1b53459ad6688aedb3f316c604d
MD5 54328b7a1ac090a2041a895dfaa14b4e
BLAKE2b-256 13abea169c4622ea20ffccdb024c8e5f24613493ec512834a7790a30cbc1e3cd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: setversion-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.5 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 741276759e3dd0ae669d1da73b5d26f13afd0919d4f3f1e24ec4b3dd9cccaa1c
MD5 50b3b1328c91720c517f3be00502dee8
BLAKE2b-256 dd13a869410e6c4bcc6d0a7ca8eb4bb66b819b9cb663026b93e8c5ea6ad4c889

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