Installation instructions

See Installation using pip for the short version of the install instructions.

System requirements

Optional library packages

These packages are not needed to install or use pytest-dependency. They are mostly only needed by the maintainer.

  • git-props

    This package is used to extract some metadata such as the version number out of git, the version control system. All releases embed that metadata in the distribution. So this package is only needed to build out of the plain development source tree as cloned from GitHub, but not to build a release distribution.

  • distutils-pytest >= 0.2

    Only needed to run the test suite.

Interaction with other packages

pytest-order

pytest-dependency is based on the assumption that dependencies are run before the test that depends on them. If this assumption is not satisfied in the default execution order in pytest, you may want to have a look on pytest-order. It implements reordering of tests and supports taking the dependencies into account.

pytest-xdist

pytest-xdist features test run parallelization, e.g. distributing tests over separate processes that run in parallel. This is based on the assumption that the tests can be run independent of each other. Obviously, if you are using pytest-dependency, this assumption is not valid. Thus, pytest-dependency will only work if you do not enable parallelization in pytest-xdist.

Installation

Installation using pip

You can install pytest-dependency from the Python Package Index (PyPI) using pip:

$ pip install pytest-dependency

Note that while installing from PyPI is convenient, there is no way to verify the integrity of the source distribution, which may be considered a security risk.

Manual installation from the source distribution

Release distributions are published on the GitHub. Steps to manually build from the source distribution:

  1. Download the sources.

    The Release Page offers download of the source distribution pytest-dependency-X.X.tar.gz and a detached signature file pytest-dependency-X.X.tar.gz.asc, where the “X.X” is to be replaced by the version number.

  2. Check the signature (optional).

    You may verify the integrity of the source distribution by checking the signature:

    $ gpg --verify pytest-dependency-0.5.1.tar.gz.asc
    gpg: assuming signed data in 'pytest-dependency-0.5.1.tar.gz'
    gpg: Signature made Fri Feb 14 21:58:30 2020 CET
    gpg:                using RSA key B4EB920861DF33F31B55A07C08A1264175343E6E
    gpg: Good signature from "Rolf Krahl <rolf@rotkraut.de>" [ultimate]
    gpg:                 aka "Rolf Krahl <rolf@uni-bremen.de>" [ultimate]
    gpg:                 aka "Rolf Krahl <Rolf.Krahl@gmx.net>" [ultimate]
    

    The signature should be made by the key 0xB4EB920861DF33F31B55A07C08A1264175343E6E. The fingerprint of that key is:

    B4EB 9208 61DF 33F3 1B55  A07C 08A1 2641 7534 3E6E
    
  3. Unpack and change into the source directory.

  4. Build (optional):

    $ python setup.py build
    
  5. Test (optional):

    $ python setup.py test
    
  6. Install:

    $ python setup.py install