0

I have a Python package myapp which depends on a Python package theirapp.

theirapp is used by others and may update occasionally, but it is not hosted on PyPI.

I currently have my repository setup like this:

my-app/
    myapp/
        __init__.py
    requirements.txt
    their-app/
        setup.py
        theirapp/
            __init__.py

My requirements.txt file contains the following line (among others):

./their-app/

their-app is not hosted on PyPI but I want to make sure the latest version is installed. Up to this point I have been downloading a zip file containing my-app and typing pip install -U requirements.txt and using the application manually.

I would like to make an installable Python package. Ideally I would like to download a my-app.zip file and type pip install my-app.zip to install myapp, theirapp and any other dependencies.

Is this possible? If not, what is the best way to handle this scenario?

Trey Hunner
  • 10,975
  • 4
  • 55
  • 114

1 Answers1

1

You may just need to bundle theirapp as part of your project and import it as myapp.contrib.theirapp. If both projects are versioned in git you can impliment it as a submodule, but it may increase complexity for maintainers.

How pip handles a similar problem: https://github.com/pypa/pip/tree/develop/pip/_vendor

You can see pip imports bundled vendor packages as pip._vendor.theirapp.

macro
  • 496
  • 4
  • 6