~fginther/fake-juju/remove-txjuju-ppa

« back to all changes in this revision

Viewing changes to python/setup.py

  • Committer: Landscape Builder
  • Author(s): Eric Snow
  • Date: 2016-10-12 23:17:00 UTC
  • mfrom: (36.1.2 python-lib-init)
  • Revision ID: landscape_builder-20161012231700-bnfzihz2ky5ejf2a
Merge python-lib-init [f=] [r=chad.smith,free.ekanayaka,landscape-builder] [a=Eric Snow]
Init the Python project for a fake-juju library.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import os
 
2
from importlib import import_module
 
3
try:
 
4
    from setuptools import setup
 
5
except ImportError:
 
6
    from distutils.core import setup
 
7
 
 
8
 
 
9
basedir = os.path.abspath(os.path.dirname(__file__) or '.')
 
10
 
 
11
# required data
 
12
 
 
13
package_name = 'fakejuju'
 
14
NAME = package_name
 
15
SUMMARY = 'A limited adaptation of Juju\'s client, with testing hooks.'
 
16
AUTHOR = 'Canonical Landscape team'
 
17
EMAIL = 'juju@lists.ubuntu.com'
 
18
PROJECT_URL = 'https://launchpad.net/fake-juju'
 
19
LICENSE = 'LGPLv3'
 
20
 
 
21
with open(os.path.join(basedir, 'README.md')) as readme_file:
 
22
    DESCRIPTION = readme_file.read()
 
23
 
 
24
# dymanically generated data
 
25
 
 
26
VERSION = import_module(package_name).__version__
 
27
 
 
28
# set up packages
 
29
 
 
30
exclude_dirs = [
 
31
        'tests',
 
32
        ]
 
33
 
 
34
PACKAGES = []
 
35
for path, dirs, files in os.walk(package_name):
 
36
    if "__init__.py" not in files:
 
37
        continue
 
38
    path = path.split(os.sep)
 
39
    if path[-1] in exclude_dirs:
 
40
        continue
 
41
    PACKAGES.append(".".join(path))
 
42
 
 
43
# dependencies
 
44
 
 
45
DEPS = ['yaml',
 
46
        # for testing
 
47
        'txjuju',
 
48
        'fixtures',
 
49
        'testtools',
 
50
        ]
 
51
 
 
52
 
 
53
if __name__ == "__main__":
 
54
    setup(name=NAME,
 
55
          version=VERSION,
 
56
          author=AUTHOR,
 
57
          author_email=EMAIL,
 
58
          url=PROJECT_URL,
 
59
          license=LICENSE,
 
60
          description=SUMMARY,
 
61
          long_description=DESCRIPTION,
 
62
          packages=PACKAGES,
 
63
 
 
64
          # for distutils
 
65
          requires=DEPS,
 
66
 
 
67
          # for setuptools
 
68
          install_requires=DEPS,
 
69
          )