{"id":21127000,"url":"https://github.com/pyrustic/buildver","last_synced_at":"2025-07-08T23:32:42.938Z","repository":{"id":60721961,"uuid":"472500614","full_name":"pyrustic/buildver","owner":"pyrustic","description":"Tool to build Python packages with built-in intuitive versioning mechanism","archived":false,"fork":false,"pushed_at":"2023-02-25T01:37:12.000Z","size":13,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-22T00:38:28.454Z","etag":null,"topics":["api","build","cli","packaging","pyrustic","python","version","versioning","wheel"],"latest_commit_sha":null,"homepage":"https://pyrustic.github.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pyrustic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-21T20:25:51.000Z","updated_at":"2024-01-22T10:41:13.000Z","dependencies_parsed_at":"2024-11-20T06:15:14.846Z","dependency_job_id":null,"html_url":"https://github.com/pyrustic/buildver","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"af0d9d961ec8c557e47609ee746a9b27262b9656"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/pyrustic/buildver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyrustic%2Fbuildver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyrustic%2Fbuildver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyrustic%2Fbuildver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyrustic%2Fbuildver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyrustic","download_url":"https://codeload.github.com/pyrustic/buildver/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyrustic%2Fbuildver/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262914113,"owners_count":23383827,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","build","cli","packaging","pyrustic","python","version","versioning","wheel"],"created_at":"2024-11-20T04:46:13.898Z","updated_at":"2025-07-08T23:32:42.667Z","avatar_url":"https://github.com/pyrustic.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Buildver\n\u003cb\u003e Tool to build Python packages with built-in intuitive versioning mechanism \u003c/b\u003e\n    \nThis project is part of the [Pyrustic Open Ecosystem](https://pyrustic.github.io).\n\u003e [Installation](#installation) . [Latest](https://github.com/pyrustic/buildver/tags) . [Documentation](https://github.com/pyrustic/buildver/tree/master/docs/modules#readme)\n\n## Table of contents\n- [Overview](#overview)\n- [Set a new version](#set-a-new-version)\n- [Version modifiers](#version-modifiers)\n- [Version width](#version-width)\n- [Build a project](#build-a-project)\n- [Check a project](#check-a-project)\n- [API](#api)\n- [Under the hood](#under-the-hood)\n- [Related projects](#related-projects)\n- [Installation](#installation)\n\n# Overview\nCreating distribution packages and managing version numbers are two related tasks that should be done intelligently to avoid confusion regarding version numbers. \n\n**Buildver** defines a standard versioning mechanism and automates the close relationship between versioning and distribution package creation while giving the developer full control.\n\n**Buildver** is a Python package that comes as a command-line tool with an API.\n\nThis tool saves me headaches when I have to release a new version of one of my [many projects](https://pyrustic.github.io).\n\n\u003e **Fun fact:** **Buildver** itself is built with... **Buildver**\n\n# Set a new version\nYou can change the current version of your Python project like this: `buildver set \u003cnew-version\u003e`.\n\nHere, `\u003cnew-version\u003e` is either a canonical version (e.g., `3.0.1`) or a version modifier (e.g., `+rev`).\n\n```bash\n$ cd /path/to/project\n$ buildver set +rev\nVERSION file updated from 0.0.1 to 0.0.2\n\n$ buildver set 0.0.3\nVERSION file updated from 0.0.2 to 0.0.3\n```\n\n# Version modifiers\nUse `+maj`, `+min`, and `+rev` to increment the current version of your project. \n\nThese version modifiers increment the `major`, `minor`, and `revision` numbers respectively.\n\n| Current | Modifier | Next   |\n|---------|----------|--------|\n| 1.0.0   | +rev     | 1.0.1  |\n| 1.0.1   | +min     | 1.1.0  |\n| 1.1.0   | +maj     | 2.0.0  |\n \n\n# Version width\nPeople usually limit their version scheme to 3 numbers, from left to right: the `major`, `minor`, and `revision` number. **Buildver** supports any version scheme as long as integers and dots are used. \n\nBy default, **Buildver** works with the `major.minor.revision` scheme, but you can expand your version width, then **Buildver** will update this version according to your scheme. \n\nFor this, **Buildver** follows simple rules:\n- the `major` is the **first** number of a version\n- the `minor` is the **second** number of a version\n- the `revision` is the **last** number of a version\n\n# Build a project\nTo build a Python distribution package with **Buildver**, simply run `buildver build`:\n\n```bash\n$ cd /path/to/demo\n$ buildver build\nbuilding v0.0.1 ...\nSuccessfully built 'demo' v0.0.1 !\nVERSION file updated from 0.0.1 to 0.0.2\n```\n\nThe above command will **build** a distribution package, **update** a `build_report` file then **increment** the revision number of the project version.\n\nIf you **only want to build** a distribution package, add `then pass` to the previous command:\n\n```bash\n$ cd /path/to/demo\n$ buildver build then pass\nbuilding v0.0.1 ...\nSuccessfully built 'demo' v0.0.1 !\nVERSION file not updated\n```\n\n# Check a project\nGet some basic information about your project with the `check` command:\n\n```bash\n$ cd /path/to/demo\n$ buildver check\ndemo v0.0.2 (source)\n.whl v0.0.1 (package) built 7 secs ago\n```\n\n# API\n**Buildver** exposes an API (the same used by the CLI) with which you can interact programmatically in Python.\n\n```python\nimport buildver\n\nPROJECT_DIR = \"/path/to/project\"\n\n# Set a new version\nbuildver.set_version(\"2.0.0\", PROJECT_DIR)\n\n# Get the current version\ncur_version = buildver.get_version(PROJECT_DIR)  # returns \"2.0.0\"\n\n# Increment the minor number with the '+min' version modifier\nnew_version = buildver.interpret_version(cur_version, \"+min\")  # returns \"2.1.0\"\nbuildver.set_version(new_version, PROJECT_DIR)\n\n# Build the project\nsuccess, errors = buildver.build_project(PROJECT_DIR)\n\nif success:\n    # Update the build_report file\n    buildver.update_build_report(new_version, PROJECT_DIR)\n\n# Get the latest build info\nversion, timestamp = buildver.get_latest_build(PROJECT_DIR)\n\n```\n\n\u003e **Read the [modules documentation](https://github.com/pyrustic/buildver/tree/master/docs/modules#readme).**\n\n# Under the hood\nTo build a `.whl` Python distribution package, **Buildver** uses [Subrun](https://github.com/pyrustic/subrun) to run the `setup.py` module on the root of a Python project.\n\nThe project version is stored in a `VERSION` file at the root. This file is referenced in `setup.cfg`. So you can safely read and write the `VERSION` file. Obviously, it is recommended to use **Buildver** to change the version of the project.\n\nThe `build_report` file is located in `$PROJECT_DIR/.pyrustic/buildver`. \n\nEach line of this file can be split into two parts: the `version` on the left and the `timestamp` on the right. The first line represents the latest build.\n\n# Related projects\nFollowing are some related projects.\n\n## Setupinit\n**Buildver** needs your project to follow a standard Python project structure in order to build it.\n**Setupinit** is a command line tool to properly initialize your Python project.\n\n\u003e **Discover [Setupinit](https://github.com/pyrustic/setupinit#readme) !**\n\n\n## Backstage\n**Backstage** is a **language-agnostic** command-line tool that allows the developer to define, coordinate and use the various resources at his disposal to create and manage a software project.\n\n**Backstage**'s default behavior involves using **Buildver**.\n\n\u003e **Discover [Backstage](https://github.com/pyrustic/backstage#readme) !**\n\n# Installation\n**Buildver** is **cross platform** and versions under **1.0.0** will be considered **Beta** at best. It is built on [Ubuntu](https://ubuntu.com/download/desktop) with [Python 3.8](https://www.python.org/downloads/) and should work on **Python 3.5** or **newer**.\n\n## For the first time\n\n```bash\n$ pip install buildver\n```\n\n## Upgrade\n```bash\n$ pip install buildver --upgrade --upgrade-strategy eager\n\n```\n\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\n[Back to top](#readme)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyrustic%2Fbuildver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyrustic%2Fbuildver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyrustic%2Fbuildver/lists"}