1

I have a library, which has a demo website. The setup.py for the library looks like this:

setup(
    ...
    install_requires=[
        ...
    ],
    extras_require={
        "test": [
            ...
        ],
        "demo": [
            ...
        ]
    },
    ...
)

I run the demo on Heroku. How do I tell heroku to do pip install -e .[demo]?

My reading of the docs was somewhat fruitful. I've added requirements.txt which does

# heroku needs this
-e .[demo]

But perhaps there is a better way? I'm aiming to solve this without creating a requirements.txt file.

Rich Tier
  • 9,021
  • 10
  • 48
  • 71

1 Answers1

0

I don't know about the extras_require, but if your issue is to adapt the requirements to the platform, you could try the following:

First find a way to check inside setup.py if it runs on Heroku or not, see this SO question.

And then you can use this strategy to adapt the install_requires variable of setuptools.setup to what you need on Heroku.

Amos Egel
  • 937
  • 10
  • 24