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.1.0.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

thx-0.1.0-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file thx-0.1.0.tar.gz.

File metadata

  • Download URL: thx-0.1.0.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.26.0

File hashes

Hashes for thx-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2e484b7a7ef1c19ab1213292e307bdc7a8410f5624013d0be9f75403c8528af8
MD5 71918bf4f7a0897f6b7c2b4ddc89a89e
BLAKE2b-256 59de50f7c7cb826e32e88974b5e536e2e2075c3ab8e6e44474e2990688b73f03

See more details on using hashes here.

File details

Details for the file thx-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: thx-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.26.0

File hashes

Hashes for thx-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 10ee83245384d13f7d2d7600b0c17787b39c0b1637b8968f930055084794dbdf
MD5 f3e5ee7935cf9a4b8fd52263b269f8c4
BLAKE2b-256 201d478fc0e214f4a55008a98c88f0d94c06b3454df294c621eba31ac5ff21ef

See more details on using hashes here.

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