Fix packaging, stop using symlink

authorSylvain Thénault <sylvain.thenault@logilab.fr>
changesetcfd59d5e0433
branchdefault
phasepublic
hiddenno
parent revision#3d3cc986d255 pypi/deb/rpm packaging of a 0.1
child revision#88ffd0b84d45 Keeps documentation defined in the XML Schema, #6d39fb3068c6 Update debian watch file - download.logilab.org should not be used anymore
files modified by this revision
__pkginfo__.py
pyxst/__pkginfo__.py
setup.py
# HG changeset patch
# User Sylvain Thénault <sylvain.thenault@logilab.fr>
# Date 1462353311 -7200
# Wed May 04 11:15:11 2016 +0200
# Node ID cfd59d5e0433a212bca29f13c49dfd24e623284c
# Parent 3d3cc986d255095c7a6ef6c5cf3fb4a2c5041973
Fix packaging, stop using symlink

diff --git a/__pkginfo__.py b/__pkginfo__.py
@@ -1,1 +0,0 @@
1 -pyxst/__pkginfo__.py
2 \ No newline at end of file
diff --git a/pyxst/__pkginfo__.py b/pyxst/__pkginfo__.py
@@ -29,13 +29,11 @@
3 
4  # license and copyright
5  license = 'LGPL'
6 
7  # short and long description
8 -short_desc = "XML Schema Tools for Python"
9 -long_desc = """
10 -"""
11 +description = "XML Schema Tools for Python"
12 
13  # author name and email
14  author = "Logilab"
15  author_email = "devel@logilab.fr"
16 
diff --git a/setup.py b/setup.py
@@ -22,11 +22,11 @@
17 
18  __docformat__ = "restructuredtext en"
19 
20  import os
21  import sys
22 -from os.path import isdir, exists, join
23 +from os.path import isdir, exists, join, dirname
24 
25  try:
26      if os.environ.get('NO_SETUPTOOLS'):
27          raise ImportError()
28      from setuptools import setup
@@ -34,23 +34,43 @@
29  except ImportError:
30      from distutils.core import setup
31      USE_SETUPTOOLS = 0
32 
33 
34 -sys.modules.pop('__pkginfo__', None)
35 +here = dirname(__file__)
36 +pkginfo = join(here, 'pyxst', '__pkginfo__.py')
37 +__pkginfo__ = {}
38 +with open(pkginfo) as f:
39 +    exec(f.read(), __pkginfo__)
40 +
41  # import required features
42 -from __pkginfo__ import modname, version, license, short_desc, long_desc, \
43 -    web, author, author_email
44 +modname = __pkginfo__['modname']
45 +version = __pkginfo__['version']
46 +license = __pkginfo__['license']
47 +description = __pkginfo__['description']
48 +web = __pkginfo__['web']
49 +author = __pkginfo__['author']
50 +author_email = __pkginfo__['author_email']
51 +
52 +long_description = open('README').read()
53 +
54  # import optional features
55 -import __pkginfo__
56 -distname = getattr(__pkginfo__, 'distname', modname)
57 -scripts = getattr(__pkginfo__, 'scripts', [])
58 -data_files = getattr(__pkginfo__, 'data_files', None)
59 -include_dirs = getattr(__pkginfo__, 'include_dirs', [])
60 -ext_modules = getattr(__pkginfo__, 'ext_modules', None)
61 -install_requires = getattr(__pkginfo__, 'install_requires', None)
62 -dependency_links = getattr(__pkginfo__, 'dependency_links', [])
63 +distname = __pkginfo__.get('distname', modname)
64 +scripts = __pkginfo__.get('scripts', ())
65 +include_dirs = __pkginfo__.get('include_dirs', ())
66 +data_files = __pkginfo__.get('data_files', None)
67 +subpackage_of = __pkginfo__.get('subpackage_of', None)
68 +ext_modules = __pkginfo__.get('ext_modules', None)
69 +package_data = __pkginfo__.get('package_data', {})
70 +if USE_SETUPTOOLS:
71 +    requires = {}
72 +    for entry in ("__depends__",): # "__recommends__"):
73 +        requires.update(__pkginfo__.get(entry, {}))
74 +    install_requires = [("%s %s" % (d, v and v or "")).strip()
75 +                       for d, v in requires.items()]
76 +else:
77 +    install_requires = []
78 
79  STD_BLACKLIST = ('CVS', '.svn', '.hg', 'debian', 'dist', 'build')
80 
81  IGNORED_EXTENSIONS = ('.pyc', '.pyo', '.elc', '~')
82 
@@ -94,17 +114,16 @@
83          sys.argv.remove('--install-layout=deb')
84      kwargs['package_dir'] = {modname: modname}
85      packages = [modname] + get_packages(modname, modname)
86      if USE_SETUPTOOLS and install_requires:
87          kwargs['install_requires'] = install_requires
88 -        kwargs['dependency_links'] = dependency_links
89      kwargs['packages'] = packages
90      return setup(name=distname,
91                   version=version,
92                   license=license,
93 -                 description=short_desc,
94 -                 long_description=long_desc,
95 +                 description=description,
96 +                 long_description=long_description,
97                   author=author,
98                   author_email=author_email,
99                   url=web,
100                   scripts=ensure_scripts(scripts),
101                   data_files=data_files,