Install-time dependencies in requirements.txt

前端 未结 3 1103
灰色年华
灰色年华 2021-01-21 04:14

I\'m using tox to prepare venv and run unit tests and my application needs openopt library which in turn imports numpy.distutils.core in its setup.py.

No ma

3条回答
  •  攒了一身酷
    2021-01-21 04:42

    I have a generic way to bootstrap build-time dependencies in setup.py. You can use this even if you are not using tox. For this case, add the following snippet to the top of the setup.py script.

    from setuptools.dist import Distribution
    
    # Bootstrapping dependencies required for the setup
    Distribution(dict(setup_requires=['numpy']))
    

    Warning: This will install numpy using easy_install. Installing numpy with this method is somewhat tricky.

提交回复
热议问题