Make Python CLI tools win the speed race, by cheating!
Project description
Jump the Gun
Make Python CLI tools win the speed race, by cheating!
What?
Make Python CLI tools blazing fast, by entirely avoiding the time taken for Python interpreter startup and module imports.
Why?
CLI tools should be fast. Ideally, running them should be near-instant.
This is especially significant, for example, when running code linting and formatting tools on just a few files in SCM hooks, such as via pre-commit.
Installation
Install into the same Python env where you have tools like black or flake8 installed:
pip install jumpthegun
Usage
Example:
jumpthegun run black --help
time black --help
time jumpthegun run black --help
time black --check .
time jumpthegun run black --check .
With pre-commit
pre-commit is awesome, but it makes commits slower. JumpTheGun fixes that!
Example config (.pre-commit-config.yaml
):
repos:
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
entry: jumpthegun run flake8
additional_dependencies:
- jumpthegun
You may need to run pre-commit install --install-hooks
if you've changed the
config in an existing working copy of a project.
Then, edit your .git/hooks/pre-commit
and make this change:
if [ -x "$INSTALL_PYTHON" ]; then
#exec "$INSTALL_PYTHON" -mpre_commit "${ARGS[@]}"
exec jumpthegun run pre-commit "${ARGS[@]}"
Copyright & License
Copyright 2022-2023 Tal Einat.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Version 3.90 of the filelock library is included in this codebase as-is. It is made available under the terms of the Unlicense software license. See it's LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for jumpthegun-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2be9729b6c27014ceaa6f0a261c31840ed682e8e36a35e0f3902d13a2b6d256b |
|
MD5 | 2a4b50a0dfd107fadd984986e8526a19 |
|
BLAKE2b-256 | e1a8be26850887a72ed0a3691ad2c559d1ff124a33193ba941f3be8240e40ddc |