Yet Another Build Script
Project description
yabs
Test, Build, Deliver!
YABS
(See grunt-yabs for a JavaScript-based variant.)
Preconditions
- Use git, PyPI and GitHub.
- Version numbers follow roughly the Semantic Versioning pattern.
- The project's version number is maintained in one of the supported locations
Different Version Locations
Following some typical patterns how Python projects store version numbers.
In order for YAML to find and bump this versions, we need to pass a hint in
the YAML configuration can be configured in yabs.yaml
like so:
file_version: yabs#1
config:
...
version:
- mode: pyproject
...
Note: YAML assumes that a version number consists of three parts and optional extension, as described in Semantic Versioning.
pyproject.toml
in the project's root folder
[project]
name = "my_project"
version = "1.2.3"
can be configured in yabs.yaml
like so:
config:
version:
- mode: pyproject
__init__.py
of the project's root package
__version__ = "1.2.3"
can be configured in yabs.yaml
like so:
- file: setup.cfg
entry: metadata.version
template:
Or a variant the mimics Python's sys.version_info
style:
version_info = (1, 2, 3)
version = ".".join(str(c) for c in version_info)
can be configured in yabs.yaml
like so:
- file: setup.cfg
entry: metadata.version
template:
A Plain Text File
For example a _version.txt
file in the procect's src
folder containing:
1.2.3
can be configured in yabs.yaml
like so:
- file: src/version.txt
template:
setup.cfg
of the project's root folder
See also PEP-396 and setuptools.
[metadata]
name = my_package
version = 1.2.3
can be configured in yabs.yaml
like so:
- file: setup.cfg
entry: metadata.version
template:
However the follwing examples for setup.cfg assume that the version is stored in a separate text or Python file, which is covered above:
[metadata]
name = my_package
version = attr: src.VERSION
[metadata]
version-file = version.txt
[metadata]
version-from-file = elle.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.