Skip to main content

File support for setuptools declarative setup.cfg

Project description

Declarative setuptools Config Requirements Files Support

This projects adds the ability for projects using setuptools declarative configuration to specify requirements using requirements files.

There's a reason why this isn't, at least yet, supported by default. Please read why.

Anyway, if you know what you're doing, then this library solves the missing feature of defining requirements using requirements files.

setup.cfg

Your setup.cfg should include a section named requirements-files like:

[requirements-files]
setup_requires = requirements/setup.txt
install_requires = requirements/base.txt
tests_require = requirements/tests.txt
extras_require =
  docs = requirements/docs.txt
  cli = requirements/cli.txt

pyproject.toml

You pyproject.toml should also include setuptools-declarative-requirements:

[build-system]
requires = ["setuptools>=50.3.2", "wheel", "setuptools-declarative-requirements"]
build-backend = "setuptools.build_meta"

setup.py

Some projects still use a setup.py shim, similar to:

#!/usr/bin/env python
import setuptools

if __name__ == "__main__":
    setuptools.setup()

If this is your case your setup.cfg needs an extra bit of tweak. Make sure you have setuptools-declarative-requirements in your setup_requires:

[options]
setup_requires =
  setuptools>=50.3.2
  setuptools-declarative-requirements

Do Note That

⚠ This project makes no attempt to validate your requirements files.

The only thing it does is include every non empty line from your requirements files which does not start with #, -r or --.

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

Built Distribution

File details

Details for the file setuptools-declarative-requirements-1.1.0.tar.gz.

File metadata

  • Download URL: setuptools-declarative-requirements-1.1.0.tar.gz
  • Upload date:
  • Size: 19.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.7

File hashes

Hashes for setuptools-declarative-requirements-1.1.0.tar.gz
Algorithm Hash digest
SHA256 97697ee0a0434df14af0a0bc89af385888d95057a2e2b4e605d0026c8a301b92
MD5 2d43a570f060fbf1315818f58ddf8f3c
BLAKE2b-256 66e326bf4eddbd2feb1eb7ebdf11c0c2eae56646b8bdc9bf8649390bc6da7e4c

See more details on using hashes here.

File details

Details for the file setuptools_declarative_requirements-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for setuptools_declarative_requirements-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 87d82039ed9ed0dda94f3e22d274b1b867f1fd9d9581a3e422d5fedced93ee6f
MD5 6247a4ff942e25a35f8447c604449251
BLAKE2b-256 cce67862d4687b501d7c30f904e2b43c4ad9345644ee96d76d47bcb09b5b503c

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