0

I have a file with pip install requirements for a repo (requirements.txt). For testing I have another file (requirements_tests.txt) that should contain same requirements and more. Can I reference requirements.txt from inside requirements_tests.txt?

esantix
  • 323
  • 5
  • 26

1 Answers1

5

Solution

Add -r requirements.txt at first line i.e. -r path/to/file in your requirements_test.txt.
Which means when you do pip install -r requirements_test.txt it will come at line -r requirements.txt and will install all it's requirement and will again continue in requirements_test.txt

E.g.

requirements.txt

pandas
numpy
matplotlib

requirements_test.txt

-r requirements.txt
tox
pytest
black
flake

PS: There are some other options also depending on what you are using for managing the environment or any other packages for managing different environments from a single file.

GodWin1100
  • 1,380
  • 1
  • 6
  • 14