Skip to content

Move developer requirements into setup.py #696

@peanutfun

Description

@peanutfun

Having two separate conda environment files causes some problems with automated build systems, as these usually expect only a single environment file. On the other hand, Python setuptools supports stating optional dependencies in the setup.py. I think this would be a nice place to put the requirements for both building the documentation and running the tests (it is actually suggested by setuptools to do exactly that).

So my proposal would be to add the requirements for running tests and building docs to the setup.py, and removing the env_developer.yml environment file altogether. Installing the additional dependencies can then be requested while installing the climada package with pip like so:

python -m pip install climada  # No additional deps
python -m pip install climada[docs]  # With additional deps for building docs
python -m pip install climada[test,docs]  # With additional deps for running test and building docs
python -m pip install .[test,docs]  # Same syntax for local installation

The setup.py would look like this:

from setuptools import setup

setup(
    install_requires=[...],  # Required dependencies
    extras_require={
        "docs": ["sphinx>2.0", "sphinx-book-theme", ...],
        "test": ["coverage>=4.5", "pylint==2.7.1", ...],
    },
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions