8

Are there conventions for storing multiple requirements.txt files in a Python code repository. For example, one file for simply running the program, another for day-to-day development, another for making a Windows build.

  • Some repositories contain two files, requirements.txt and requirements_dev.txt, or requirements.txt and requirements_win.txt - this seems pretty ad-hoc.
  • I have others with a requires subfolder. But I'm not sure what the meaning of requires/requirements.txt is in this context -- running the application, or for development?
  • There is no mention of storing multiple requirements files in Structuring your project (Hitchhiker's guide to Python) or pip install (pip documentation).
lofidevops
  • 15,528
  • 14
  • 79
  • 119

1 Answers1

5

As far as I am aware, there are no hard-and-fast rules here. At least not via PEP (but someone feel free to correct me).

The Hitchhiker's Guide to Python recommends putting the pip requirements file at the root of your project.

There does not appear to be any requirement that a pip requirements file has to be called requirements.txt. The pip install documentation even uses the example of pip install -r example-requirements.txt.

I would think that the conventions vary from project-to-project and largely depend on your deployment process and project-specific documentation.

alex
  • 6,818
  • 9
  • 52
  • 103