Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

Code style: black pre-commit codecov CircleCI

Description

Removes private packages from a general requirements.txt file.

Usage

An example of usage is installing private packages. My usual workflow consists of

  1. changes in the source code,
  2. pip freeze > requirements.txt
  3. and git add . and git commit -m "commit massage". However, my private packages were included and the CI build would fail because of the peculiar syntax required to install private packages.
  4. The private package was manually removed from the requirements.txt and another commit was executed.

This package was created to avoid this situation. Storing the private packages in a different file (e.g., requirements-private.txt), it removes the packages already presented inside requirements-private.txt from the requirements.txt avoiding the manual deletion and the commit correcting the change.

The recommended use is adding in the .pre-commit-config.yaml file

  - repo: https://github.com/mashi/requirements-filter
    rev: v0.0.0  # replace by desired tag version
    hooks:
      - id: rqf
        args: [--filename1, requirements.txt, --filename2, requirements-private.txt]  # example with arguments

In this way, the packages are checked before the commit and prevents the inclusion in the version control.

Instructions (Development)

Create a virtual environment and install the required packages with

python3 -m venv .venv
source .venv/bin/activate
pip install wheel
pip install -r requirements.txt
pre-commit install

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages