GithubHelp home page GithubHelp logo

check_requirements's Introduction

check_requirements

PyPI version PyPI pyversions Python package Check requirements codecov Codacy Badge PyPI download month PyPI download week PyPI download day GitHub all releases GitHub contributors CodeFactor Codacy BadgePyPI license

check_requirements is a Python tool for managing and analyzing dependencies in your projects. It helps you identify missing and extra dependencies in your project, ensuring a clean and reliable environment. Its error-raising feature is particularly valuable for continuous integration (CI) pipelines, where maintaining a consistent dependency set is crucial.

Features

  • List project dependencies.
  • Check for missing and extra dependencies.
  • Ignore specific packages.
  • Include Python version and system platform information.
  • Raise errors for missing or extra dependencies, enhancing your CI workflows and preventing unexpected issues in production.

Installation

check_requirements can be installed using pip:

pip install check_requirements

# to make sure you have the latest version
pip install -U check_requirements

# latest available code base
pip install -U git+https://github.com/eftalgezer/check_requirements.git

Usage

Listing Dependencies

To list project dependencies to the console:

check_requirements -l

Checking for Missing and Extra Dependencies

The primary strength of check_requirements lies in checking for missing and extra dependencies. This is particularly useful for maintaining a consistent environment across different stages of your project.

# Check for missing dependencies and raise an error if any are found
check_requirements -cm requirements.txt -rme

# Check for extra dependencies and raise an error if any are found
check_requirements -ce requirements.txt -ree

Utilizing these checks in your CI pipelines can help catch potential problems before they reach production.

For more information and usage options, refer to the documentation .

Using check_requirements in Python Code

check_requirements can also be utilized directly in your Python code to programmatically manage dependencies and raise errors:

from check_requirements import check_and_raise_error

# Define your project's dependencies
project_deps = [
    # ...
]

# Load existing dependencies from a file or other source
existing_deps = load_existing_dependencies()

# Check for missing dependencies and raise an error if any are found
check_and_raise_error(project_deps, existing_deps)

Unit Tests

check_requirements comes with a comprehensive set of unit tests to ensure its functionality. To run the tests, navigate to the main directory and execute:

pytest

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

GNU General Public License v3.0

check_requirements's People

Contributors

dependabot[bot] avatar eftalgezer avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.