Skip to main content

A collection of tools for commmon package scripts

Project description

JGT Tools is a collection of package helpers for common CLI functions within a properly-formatted repository.

Quickstart

Just include jgt_tools in your package VirtualEnv, and you’ll have access to these CLI calls:

  • env-setup - set up the development environment with all packages and pre-commit checks

  • self-check - run self-checks/linters/etc. on your repository

  • run-tests - run your in-repo test suite

  • build-docs - build repo documentation locally

  • build-and-push-docs - both build the docs, then publish to your gh-pages branch

  • check-version - raise an error if package-relevant files have changed without a version bump

Details for each script can be found by calling with the --help flag.

Configuration

A number of the actions to be called can be customized in a [tool.jgt_tools] in your pyproject.toml file. Available values are:

  • env_setup_commands - a list of commands to be run under the env-setup call

  • self_check_commands - a list of commands to be run under the self-check call

  • run_tests_commands - a list of commands to be run under the run-tests call

  • doc_build_types - a list of types for doc construction: - api is currently the only supported option

For example:

[tool.jgt_tools]
env_setup_commands = [
    "poetry install",
    "poetry run pip install other_package",
    "./my_custom_setup_script.sh"
]
doc_build_types = []

would run your specified commands for env-setup and skip the api doc builder.

In addition, the function to verify which files are relevant to check-version can be customized. By default, if any files in the diff against master are .py files, a version bump is expected, but the user can provide an alternate function to verify filenames.

The function should expected a list of strings representing file paths relative from project root (as provided by git diff master --name-only) and return a boolean representing if a version change should be ensured (i.e. True if version should be checked).

This can be registered as a plugin in your pyproject.toml file:

[tools.poetry.plugins."file_checkers"]
"version_trigger" = "my_module:my_function"

or in your setup.py file:

setup(
    ...
    entry_points={
        "version_trigger": ["version_trigger = my_module:my_fuction"]
    }
)

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

jgt_tools-0.1.5.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jgt_tools-0.1.5-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file jgt_tools-0.1.5.tar.gz.

File metadata

  • Download URL: jgt_tools-0.1.5.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.17 CPython/3.6.3 Linux/4.4.0-101-generic

File hashes

Hashes for jgt_tools-0.1.5.tar.gz
Algorithm Hash digest
SHA256 2d216630982c0d03a2290d140dd7e2df2e1492e8ac95e1ba5ced9d2fdb168983
MD5 6d2760a05def1c3fb2a38272db6e8d0f
BLAKE2b-256 614240aac085a41e6a6a5ccb6be6f0d1055c580a17d8f0367e0dc8d9e48b7c78

See more details on using hashes here.

File details

Details for the file jgt_tools-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: jgt_tools-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.17 CPython/3.6.3 Linux/4.4.0-101-generic

File hashes

Hashes for jgt_tools-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8b23b84b0e14fda2b1ceaafd568ec28872e998b983b7e68188e8e57415dc2385
MD5 f9da3b3572aaed3472b5e64d954558e3
BLAKE2b-256 558e5075cdae694c284675cc1707de70afb1d4aef79999c8f80fa6c221d791b5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page