Skip to main content

Yet Another Build Script

Project description

logo yabs

Build Status Latest Version License Documentation Status Coverage Status Code style: black StackOverflow: yabs

Test, Build, Deliver!

YABS

(See grunt-yabs for a JavaScript-based variant.)

Preconditions

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yabs-0.0.1.tar.gz (28.5 kB view hashes)

Uploaded Source

Built Distribution

yabs-0.0.1-py3-none-any.whl (34.2 kB view hashes)

Uploaded Python 3

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