0

I'm a beginner in the process of learning how to create a skeleton directory complete with automated tests, install scripts etc. I am a fair ways from understanding all of this process despite the amount of time spent attempting to.

At this point in time all I can do in relation to this is make a source distribution and executable installer for a single module.

The format of my setup.py (using a template provided by my beginners book) for my skeleton project is:

#!/usr/bin/env
try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup

config = {
    "description": "asks a question",
    "author": "David",
    "url": "none",
    "download_url": "none",
    "author email": "dmt257257@gmail.com",
    "version": "0.1",
    "install_requires": ["nose"],
    "packages": ["ask_main", "tests"],
    "scripts": [],
    "name": "ask"
}

setup(**config)

However I see the format on python.org as:

#!/usr/bin/env python

from distutils.core import setup

setup(name='Distutils',
      version='1.0',
      description='Python Distribution Utilities',
      author='Greg Ward',
      author_email='gward@python.net',
      url='https://www.python.org/sigs/distutils-sig/',
      packages=['distutils', 'distutils.command'],
     )

Can anyone explain why you would use the config method? What is '**' doing in setup(**config)?

Michael Johnson
  • 470
  • 6
  • 18
  • Your second question is covered by [What does ** (double star) and * (star) do for Python parameters?](http://stackoverflow.com/q/36901/744178) – jwodder Aug 22 '16 at 12:28
  • They are identical as far as the setup function is concerned. I prefer skipping the dictionary just because it's a useless addition, but there may be sometimes when a dictionary is required. I've just never found one of those times. – zondo Apr 03 '17 at 19:36

0 Answers0