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

Your 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.2.0.tar.gz.

File metadata

  • Download URL: setuptools-declarative-requirements-1.2.0.tar.gz
  • Upload date:
  • Size: 20.0 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.2.0.tar.gz
Algorithm Hash digest
SHA256 d11fdb5ef818c65b20bc241e0f5ef44905a5640b681dae21ba1ac1742dab1fd1
MD5 45eb0cb2224396f1da376c5f5d96837c
BLAKE2b-256 db4d4a828c4fcec19c5275f1bed6320de8cb6b65e9ba5bbcf58b93846a9195c1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for setuptools_declarative_requirements-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5c259a972eb9aa7c2cd91b046d8cbadec863d1169d4caad312ddd8767a5586a9
MD5 1c085cf38dbf955875e19a65a0e5347f
BLAKE2b-256 9e5474affb7ec2f11e174243f33788cc5ff7c276e24fc821e74ee18bdf994d02

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