Idan Haim Shalom
Idan Haim Shalom

Reputation: 1244

setup.py install show only the folders

I am trying to make a library for pypi in python so I made setup.py file. I uploaded it after looking at some tutorials but when I am trying to install it via pip install pyravendb I only get an empty folder.

Tried to install it directly from python setup.py install. Again getting only an pyravendb empty folder.

my setup.py file

from distutils.core import setup

    setup(
        name='pyravendb',
        packages=['pyravendb'],
        version='1.0.1',
        description='This is the official python client for RavenDB document database',
        author='Idan Haim Shalom',
        author_email='my email',
        url='https://github.com/IdanHaim/RavenDB-Python-Client/',
        download_url='https://github.com/IdanHaim/RavenDB-Python-Client/tarball/1.0.1',
        keywords='ravendb pyravendb database',
        license='GNU',
        requires=
        [
            'pycrypto',
            'requests',
            'Inflector'
        ],
        zip_safe=False,
    )

Upvotes: 0

Views: 282

Answers (2)

Your project appears to have the following structure:

pyravendb/
  connection/
  custom_exceptions/
  d_commands/
  data/
  hilo/
  store/
  tests/
  tools/

Add your setup.py file to the project root folder and change packages to include each module/folder you want to include in your distribution. You can explicitly state all modules to be packaged as follows:

packages=[
        'pyravendb',
        'pyravendb.connection',
        'pyravendb.custom_exceptions',
        'pyravendb.d_commands',
        'pyravendb.data',
        'pyravendb.hilo',
        'pyravendb.store',
        # and so on....
],

Alternatively, you can use setuptools and import find_packages and then use packages=find_packages(), to automatically use all packages in the directory.

Upvotes: 1

Idan Haim Shalom
Idan Haim Shalom

Reputation: 1244

Ok I manage to find the correct answer. like PRNDL suggested but with a little less work.

from setuptools import setup, find_packages

and in the packages add find_packages() method to find all my packages

setup(
    name='pyravendb',
    packages=find_packages(),

Because my project structure have multi sub directory packages I had to include all of them in my setup.py that`s why my first attempt was a failure. Doing like the above solved my problem without write all my packages name

Upvotes: 0

Related Questions