Skip to main content

Fast command runner for Python projects.

Project description

Rapid development assistant, and fast command runner for Python projects.

PyPI Release Documentation Status Changelog MIT Licensed

thx (“thanks”) is capable of running arbitrary jobs, configured via simple options in the PEP 518 standardized pyproject.toml. Jobs can be run on multiple Python versions at once, and independent steps can be executed in parallel for faster results.

Watch thx format the codebase, build sphinx docs, run the test and linter suites on five Python versions, and generate a final coverage report:

Demo of thx

thx can also watch for modifications to your project, and automatically run jobs every time changes are detected—it will even reload its configuration when your pyproject.toml changes:

Demo of thx in watch mode

Usage

Configuration uses standard TOML elements, and jobs can reference shared values, which will be interpolated at runtime:

[tool.thx.values]
module = "thx"

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

The configuration above defines two jobs, “lint” and “test”; the “lint” job defines two steps, and these can optionally be run in parallel. Both jobs present themselves as separate commands in thx. Note the automatic replacement of {module} with the configured value thx when running jobs:

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

They can also be run together in order, similar to makefiles:

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

By default, thx uses the active Python runtime for jobs, but can also run jobs on multiple runtimes in parallel:

[tool.thx]
python_versions = ["3.7", "3.8", "3.9"]
$ thx test
3.9> python -m unittest thx.tests
3.8> python -m unittest thx.tests
3.7> python -m unittest thx.tests

See the user guide for details on all available configuration options.

Install

thx is available on PyPI:

$ pip install thx

See the user guide for help getting started.

License

thx is copyright Amethyst 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.6.0.tar.gz (75.9 kB view details)

Uploaded Source

Built Distribution

thx-0.6.0-py3-none-any.whl (29.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for thx-0.6.0.tar.gz
Algorithm Hash digest
SHA256 3098d51de48c9c59bea315dadff5c5023025f16a140b43cf825d201dbb6720d1
MD5 ada224b83bf2e26220a8eea48d4af9ed
BLAKE2b-256 9a4680db7e259f549967e6250c6c56549e7ba6c283cae022a6f1afdbfd3aa2c8

See more details on using hashes here.

Provenance

File details

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

File metadata

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

File hashes

Hashes for thx-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7d7ba0b37007653c1c28e2b4e7ef72d680fc5738368888fc50242774f58a653b
MD5 40278cc4e5b9fc85e92ebc306a2aa02b
BLAKE2b-256 72dd3f4865f0c3f6100f6c2ed6fc943bab76ab49dc5cbadd3d85380d575f973d

See more details on using hashes here.

Provenance

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