No project description provided
Project description
pip-split-requirements
Split a pip requirement files according to regular expression patterns rules.
Table of Contents
Installation
pipx install pip-split-requirements
Quick start
Assume the following requirements.txt
:
--find-links wheelhouse
pkga
git+https://github.com/some/project
pkgb
Running
pip-split-requirements -g slow:git requirements.txt
Will create requirementsgroup-slow.txt
:
--find-links wheelhouse
git+https://github.com/some/project
and requirementsgroup-other.txt
:
--find-links wheelhouse
pkga
pkgb
CLI Usage
Usage: pip-split-requirements [OPTIONS] REQUIREMENTS_FILE...
Split a pip requirements file into multiple files according to patterns.
Comment lines are ignored. Option lines are emitted in all groups.
Arguments:
REQUIREMENTS_FILE... [required]
Options:
-g, --group-spec TEXT Group specifications in form name:pattern.
-p, --prefix TEXT Each requirements group file will be named
{prefix}-{group_name}.txt. The prefix can
contain path separators, to generate files
into a chosen directory. [default:
requirementsgroup]
--default-group / --no-default-group
Automatically append a group named 'other',
matching all lines not matched by other
groups. [default: default-group]
--help Show this message and exit.
Usage as a pre-commit hook
The following section of .pre-commit-config.yaml
will split requirements.txt
into a
group named vcs
with requirements containing the word git
and another group with
everything else, as build/reqgroup-*.txt
.
- repo: https://github.com/sbidoul/pip-split-requirements
rev: v0.1.0
hooks:
- id: pip-split-requirements
files: ^requirements\.txt$
args:
- --prefix=build/reqgroup
- --group-spec=vcs:git
License
pip-split-requirements
is distributed under the terms of the
MIT license.
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
Built Distribution
File details
Details for the file pip_split_requirements-0.2.0.tar.gz
.
File metadata
- Download URL: pip_split_requirements-0.2.0.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea3a15d07f9c3f4b8a31429cc6f8b3dcb080d41115f0ca66e8d321c82435f135 |
|
MD5 | 04223b8fd48e813e9b59936695e5b09d |
|
BLAKE2b-256 | a5b50012525745ed30787b220ae597ac19cd8e33565c0f71bb1a549ea68caba3 |
File details
Details for the file pip_split_requirements-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: pip_split_requirements-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e7b63a38c9bd534d13cef7ef6aafe2b6131b18361f9767388c80ff3f450016f |
|
MD5 | ec426e673ea4772cc61eb19733479c02 |
|
BLAKE2b-256 | b8f311f3de5c290428ba11d99f4d8e450380daa9d5b9d9051b7bf41ade6dc4b7 |