5

I have a setup.py file for a project I'm working on that needs to pull in several third party packages that aren't (yet) released in the cheese shop. One of these is the 'spine' and 'pyguts' modules from this git repository:

https://github.com/terrysimons/spine-python

Usually I can install things from gitgub by specifying the following items in my setup.py file (several lines have been omitted for clarity):

#! /usr/bin/python
# Encoding: UTF-8

from setuptools import setup, find_packages


setup(
    # More stuff in here...
    dependency_links=[
            'https://github.com/bitcraft/PyTMX/archive/master.zip#egg=PyTMX',
        ],
    install_requires=[
        'PyTMX',
        ],
)

However, this only works because PyTMX has it's setup.py file in the root of the repository.

If I try and do something similar for the spine and pyguts repositories, like so:

#! /usr/bin/python
# Encoding: UTF-8

from setuptools import setup, find_packages

__version__ = '0.0.1'



setup(
    dependency_links=[
            'https://github.com/bitcraft/PyTMX/archive/master.zip#egg=PyTMX',
            'https://github.com/terrysimons/spine-python/archive/master.zip#egg=spine',
        ],
    install_requires=[
        'PyTMX',
        'spine',
        ],
)

Then distutils complains when I run python setup.py install:

Searching for spine
Best match: spine [unknown version]
Downloading https://github.com/terrysimons/spine-python/archive/master.zip#egg=spine
Processing master.zip
error: Couldn't find a setup script in /tmp/easy_install-OXsH6T/master.zip

How can I get distutils to install packages when the setup.py file is not in the root of the package repository?

Thomi
  • 11,647
  • 13
  • 72
  • 110

1 Answers1

0

As far as I know the approach on this is to include the modules in your package, as subdirectories, instead of installing them.

Obviously this means that you will not able to access them directly from outside the module. Still, you will be able to import my_module.my_submodule

When they are ready to be decoupled from the master module, just make new packages for them.

sorin
  • 161,544
  • 178
  • 535
  • 806