Skip to main content

Simple, composable command runner for Python projects.

Project description

A simple, composable command runner for Python projects.

MIT Licensed PyPI Release Changelog Documentation Status Build Status

Goals

“makefiles, but with pyproject.toml”

—author

thx should be capable of running one or more jobs or commands, configured via simple and obvious options in the PEP 517 standardized pyproject.toml. Jobs are defined as simple strings, or lists of strings, each representing a command to be run, with basic interpolation of values.

[tool.thx]
default = ["lint", "test"]
module = "thx"

[tool.thx.jobs]
lint = [
    "flake8 {module}",
    "ufmt check {module}",
]
test = "python -m unittest -v {module}.tests"

With the given configuration, the following commands are possible. Note the automatic replacement of {module} with thx:

$ thx lint
> flake8 thx
> ufmt check thx
$ thx test
> python -m unittest thx.tests

Without a command, thx will run the configured list of default jobs:

$ thx
> flake8 thx
> ufmt check thx
> python -m unittest thx.tests

Terminology

  • command refers to an individual program executed by thx as a subprocess, including any rendered template values. An example command could include running unit tests via python -m unittest thx.

  • step refers to a pending command, before any template values are rendered, and includes the configuration, environment, and any other values that may affect the final program and arguments that will be executed.

  • job refers to a named job, consisting of one or more steps, and a list of any other jobs that must be completed before this job can begin (“requires”). These are the primary unit defined in the project’s pyproject.toml.

Install

thx is not yet ready for production use. Check the Github repo for development status.

License

thx is copyright John Reese, and licensed under the MIT license. I am providing code in this repository to you under an open source license. This is my personal repository; the license you receive to my code is from me and not from my employer. See the LICENSE file for details.

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

thx-0.2.0.tar.gz (22.4 kB view hashes)

Uploaded Source

Built Distribution

thx-0.2.0-py3-none-any.whl (22.0 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