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 details)

Uploaded Source

Built Distribution

thx-0.2.0-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for thx-0.2.0.tar.gz
Algorithm Hash digest
SHA256 485d6c33f984d4c5eca409491f3da9164b7fb307f36a79ebaf821d0106fe95d5
MD5 9584ef4ca5d96f8d08793f56e6e638aa
BLAKE2b-256 4f6bc21ed1b2924ed7a8288c2212d0935e745f76182e23576ae1038a939efb94

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for thx-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e748b563dbda737afefee0222a77517de8ef326f7f2fc7ebdd113e636efe90ef
MD5 26581ebc4a8a91a9400b48bc169be127
BLAKE2b-256 664b9016f4d4c9dc2d5b4399118df11cfcc7b9067e7feb27cdb949e9e0b422b9

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