4

Is it possible for pip to exclude folders when installing from requirements.txt? For example I want pip to skip all static folders when installing on heroku (to keep the slug size down). I havent managed to find any info on it whatsoever.

I know I can push the directories without the folders myself and use https://devcenter.heroku.com/articles/python-pip#local-file-backed-distributions but this seems like a lot of work for something that could/should be easy!

Any other clever ways of achieving the same thing?

UPDATE:

I found that I can add in the packages setup.py exclude_package_data which is great but it means going through many different packages and adding a lookup for an ENV var or something similar like described here.

exclude_package_data = {'': ['.gitignore', 'artwork/*'],
                          'model': ['config.py']},
Community
  • 1
  • 1
7wonders
  • 1,639
  • 1
  • 17
  • 34

0 Answers0