This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Description

This plugin checks your requirements files for specific versions, and compares those versions with the installed libraries in your environment, failing your test suite if any are invalid or out of date.

This is useful for keeping virtual environments up-to-date, and ensuring that your test suite is always being passed with the requirements you have specified.

It also has the added bonus of verifying that your requirements files are syntatically valid.

Usage

install via:

pip install pytest-reqs

if you then type:

py.test --reqs

it will search for dependencies in the files matching:

  • req*.txt
  • req*.pip
  • requirements/*.txt
  • requirements/*.pip

and the declared dependencies will be checked against the current environment.

A little example

If your environment has dependencies installed like this:

$ pip freeze
foo==0.9.9

But you have a requirements.txt file like this:

$ cat requirements.txt
foo==1.0.0

you can run py.test with the plugin installed:

$ py.test --reqs
=================================== FAILURES ===================================
______________________________ requirements-check ______________________________
Distribution "foo" requires foo==1.0.0 (from -r requirements.txt (line 1)) but 0.9.9 is installed

It also handles pip’s version containment syntax (e.g, foo<=1.0.0, foo>=1.0.0, etc):

$ py.test --reqs
=================================== FAILURES ===================================
______________________________ requirements-check ______________________________
Distribution "foo" requires foo>=1.0.0 (from -r requirements.txt (line 1)) but 0.9.9 is installed

Furthermore, it will tell you if your requirements file is invalid (for example, if there is not enough = symbols):

$ py.test --reqs
______________________________ requirements-check ______________________________
Invalid requirement: 'foo=1.0.0' (from -r requirements.txt)

Configuring options

Ignoring local projects

You might have requirements files with paths to local projects, e.g. for local development:

$ cat requirements/local_development.txt
-e ../foo

However, testing these requirements will fail if the test environment is missing the local project (e.g., on a CI build):

=================================== FAILURES ===================================
______________________________ requirements-check ______________________________
../foo should either be a path to a local project or a VCS url beginning with svn+, git+, hg+, or bzr+ (from -r requirements.txt)

To get around this, you can disable checking for local projects with the following pytest option:

# content of setup.cfg
[pytest]
reqsignorelocal = True

Running requirements checks and no other tests

You can also restrict your test run to only perform “reqs” tests and not any other tests by typing:

py.test --reqs -m reqs

This will only run test items with the “reqs” marker which this plugin adds dynamically.

Authors

License

Open source MIT license.

Notes

The repository of this plugin is at http://github.com/di/pytest-reqs.

For more info on py.test see http://pytest.org.

Release History

Release History

0.0.4

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pytest_reqs-0.0.4-py2-none-any.whl (6.0 kB) Copy SHA256 Checksum SHA256 2.7 Wheel Aug 2, 2016
pytest_reqs-0.0.4-py3-none-any.whl (6.0 kB) Copy SHA256 Checksum SHA256 3.5 Wheel Aug 2, 2016
pytest-reqs-0.0.4.tar.gz (5.3 kB) Copy SHA256 Checksum SHA256 Source Aug 2, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting