Skip to main content

Removes private packages with @ from requirements file

Project description

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

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

requirements_filter-0.0.0.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

requirements_filter-0.0.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file requirements_filter-0.0.0.tar.gz.

File metadata

  • Download URL: requirements_filter-0.0.0.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for requirements_filter-0.0.0.tar.gz
Algorithm Hash digest
SHA256 4516b1f6221ac0d7182f531770da22fff19c463d3584076a7a7a179205b6a3bc
MD5 2f9faf4f0e962d4c8c5ac0f8ea5c787c
BLAKE2b-256 0794754ed073d02edab933fb83f394f94e273cc8569f13ee29ee2039268c6119

See more details on using hashes here.

File details

Details for the file requirements_filter-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: requirements_filter-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for requirements_filter-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9228baada80adf34f2fdd5ed2767441d83c9e0c6faaa8c71ea39d6c4202268f5
MD5 f2b5e7f70d8203c38847a2d0c5de4e62
BLAKE2b-256 ceb2f12e32ce0038cc4eee22486b4c67efcc82df50b92197404d7e9ef58b1396

See more details on using hashes here.

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