What's the standard way to package a python project with dependencies?

前端 未结 3 1506
野性不改
野性不改 2021-01-14 00:55

I have a python project that has a few dependencies (defined under install_requires in setup.py). My ops people requires a package to be self contained and only

3条回答
  •  花落未央
    2021-01-14 01:15

    In most cases you should be able to "vendor" all the dependencies. It's basically a crude version of virtualenv.

    For example look at how the requests package includes chardet and urllib3 in its own source tree. Here's an example script that should do the initial downloading and copying for you: https://gist.github.com/proppy/1136723

    Once you have the dependencies installed, you can reference them with from .some.namespace import dependency_name to make sure that you're using your local versions.

提交回复
热议问题