author | Laurent Peuch <cortex@worlddomination.be> |
Thu, 05 Dec 2019 02:10:23 +0100 | |
changeset 12796 | 4fe765f2f155 |
parent 11968 | bb0dfc7d2d0e |
permissions | -rw-r--r-- |
0 | 1 |
#!/usr/bin/env python |
6840
fe5162da6e70
[skel] setup.py patched to get easy_install to work
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6326
diff
changeset
|
2 |
# pylint: disable=W0142,W0403,W0404,W0613,W0622,W0622,W0704,R0904,C0103,E0611 |
fe5162da6e70
[skel] setup.py patched to get easy_install to work
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6326
diff
changeset
|
3 |
# |
11152
fccc6ddd975c
[skeleton] do not import the __pkginfo__.py module to make cubes installable via setuptools
David Douard <david.douard@logilab.fr>
parents:
11085
diff
changeset
|
4 |
# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
5421
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4212
diff
changeset
|
5 |
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr |
6840
fe5162da6e70
[skel] setup.py patched to get easy_install to work
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6326
diff
changeset
|
6 |
# |
11455
d686c4e8cdb2
[devtools] Adjust skeleton setup.py to have it read information from __pkginfo__.py
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11424
diff
changeset
|
7 |
# This file is part of a %(distname)s. |
6840
fe5162da6e70
[skel] setup.py patched to get easy_install to work
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6326
diff
changeset
|
8 |
# |
fe5162da6e70
[skel] setup.py patched to get easy_install to work
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6326
diff
changeset
|
9 |
# CubicWeb is free software: you can redistribute it and/or modify it under the |
fe5162da6e70
[skel] setup.py patched to get easy_install to work
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6326
diff
changeset
|
10 |
# terms of the GNU Lesser General Public License as published by the Free |
fe5162da6e70
[skel] setup.py patched to get easy_install to work
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6326
diff
changeset
|
11 |
# Software Foundation, either version 2.1 of the License, or (at your option) |
fe5162da6e70
[skel] setup.py patched to get easy_install to work
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6326
diff
changeset
|
12 |
# any later version. |
fe5162da6e70
[skel] setup.py patched to get easy_install to work
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6326
diff
changeset
|
13 |
# |
fe5162da6e70
[skel] setup.py patched to get easy_install to work
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6326
diff
changeset
|
14 |
# CubicWeb is distributed in the hope that it will be useful, but WITHOUT |
fe5162da6e70
[skel] setup.py patched to get easy_install to work
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6326
diff
changeset
|
15 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
fe5162da6e70
[skel] setup.py patched to get easy_install to work
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6326
diff
changeset
|
16 |
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more |
fe5162da6e70
[skel] setup.py patched to get easy_install to work
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6326
diff
changeset
|
17 |
# details. |
fe5162da6e70
[skel] setup.py patched to get easy_install to work
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6326
diff
changeset
|
18 |
# |
10214
88f60d4b9952
[newcube] Make the generated code PEP-8 compliant
Christophe de Vienne <christophe@unlish.com>
parents:
9516
diff
changeset
|
19 |
# You should have received a copy of the GNU Lesser General Public License |
10471
f04a77fe8418
[skeleton] remove no-break space from skeleton setup.py
Julien Cristau <julien.cristau@logilab.fr>
parents:
10214
diff
changeset
|
20 |
# along with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
11456
077f32a7a4c3
[devtools] Update skeleton's setup.py to install cube as a package
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11455
diff
changeset
|
21 |
"""cubicweb_%(cubename)s setup module using data from |
077f32a7a4c3
[devtools] Update skeleton's setup.py to install cube as a package
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11455
diff
changeset
|
22 |
cubicweb_%(cubename)s/__pkginfo__.py file |
6840
fe5162da6e70
[skel] setup.py patched to get easy_install to work
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6326
diff
changeset
|
23 |
""" |
5024
9e718abe3fde
add egg support with dependencies auto-installation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
4212
diff
changeset
|
24 |
|
11456
077f32a7a4c3
[devtools] Update skeleton's setup.py to install cube as a package
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11455
diff
changeset
|
25 |
from os.path import join, dirname |
1977
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
26 |
|
11456
077f32a7a4c3
[devtools] Update skeleton's setup.py to install cube as a package
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11455
diff
changeset
|
27 |
from setuptools import find_packages, setup |
077f32a7a4c3
[devtools] Update skeleton's setup.py to install cube as a package
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11455
diff
changeset
|
28 |
|
0 | 29 |
|
11455
d686c4e8cdb2
[devtools] Adjust skeleton setup.py to have it read information from __pkginfo__.py
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11424
diff
changeset
|
30 |
here = dirname(__file__) |
11152
fccc6ddd975c
[skeleton] do not import the __pkginfo__.py module to make cubes installable via setuptools
David Douard <david.douard@logilab.fr>
parents:
11085
diff
changeset
|
31 |
|
fccc6ddd975c
[skeleton] do not import the __pkginfo__.py module to make cubes installable via setuptools
David Douard <david.douard@logilab.fr>
parents:
11085
diff
changeset
|
32 |
# load metadata from the __pkginfo__.py file so there is no risk of conflict |
fccc6ddd975c
[skeleton] do not import the __pkginfo__.py module to make cubes installable via setuptools
David Douard <david.douard@logilab.fr>
parents:
11085
diff
changeset
|
33 |
# see https://packaging.python.org/en/latest/single_source_version.html |
11455
d686c4e8cdb2
[devtools] Adjust skeleton setup.py to have it read information from __pkginfo__.py
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11424
diff
changeset
|
34 |
pkginfo = join(here, 'cubicweb_%(cubename)s', '__pkginfo__.py') |
d686c4e8cdb2
[devtools] Adjust skeleton setup.py to have it read information from __pkginfo__.py
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11424
diff
changeset
|
35 |
__pkginfo__ = {} |
d686c4e8cdb2
[devtools] Adjust skeleton setup.py to have it read information from __pkginfo__.py
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11424
diff
changeset
|
36 |
with open(pkginfo) as f: |
d686c4e8cdb2
[devtools] Adjust skeleton setup.py to have it read information from __pkginfo__.py
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11424
diff
changeset
|
37 |
exec(f.read(), __pkginfo__) |
5024
9e718abe3fde
add egg support with dependencies auto-installation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
4212
diff
changeset
|
38 |
|
11152
fccc6ddd975c
[skeleton] do not import the __pkginfo__.py module to make cubes installable via setuptools
David Douard <david.douard@logilab.fr>
parents:
11085
diff
changeset
|
39 |
# get required metadatas |
11471
013d16661c7f
[skeleton] Use distname directly in setup.py
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11456
diff
changeset
|
40 |
distname = __pkginfo__['distname'] |
11455
d686c4e8cdb2
[devtools] Adjust skeleton setup.py to have it read information from __pkginfo__.py
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11424
diff
changeset
|
41 |
version = __pkginfo__['version'] |
d686c4e8cdb2
[devtools] Adjust skeleton setup.py to have it read information from __pkginfo__.py
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11424
diff
changeset
|
42 |
license = __pkginfo__['license'] |
d686c4e8cdb2
[devtools] Adjust skeleton setup.py to have it read information from __pkginfo__.py
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11424
diff
changeset
|
43 |
description = __pkginfo__['description'] |
d686c4e8cdb2
[devtools] Adjust skeleton setup.py to have it read information from __pkginfo__.py
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11424
diff
changeset
|
44 |
web = __pkginfo__['web'] |
d686c4e8cdb2
[devtools] Adjust skeleton setup.py to have it read information from __pkginfo__.py
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11424
diff
changeset
|
45 |
author = __pkginfo__['author'] |
d686c4e8cdb2
[devtools] Adjust skeleton setup.py to have it read information from __pkginfo__.py
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11424
diff
changeset
|
46 |
author_email = __pkginfo__['author_email'] |
d686c4e8cdb2
[devtools] Adjust skeleton setup.py to have it read information from __pkginfo__.py
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11424
diff
changeset
|
47 |
classifiers = __pkginfo__['classifiers'] |
6840
fe5162da6e70
[skel] setup.py patched to get easy_install to work
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6326
diff
changeset
|
48 |
|
11455
d686c4e8cdb2
[devtools] Adjust skeleton setup.py to have it read information from __pkginfo__.py
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11424
diff
changeset
|
49 |
with open(join(here, 'README')) as f: |
11152
fccc6ddd975c
[skeleton] do not import the __pkginfo__.py module to make cubes installable via setuptools
David Douard <david.douard@logilab.fr>
parents:
11085
diff
changeset
|
50 |
long_description = f.read() |
fccc6ddd975c
[skeleton] do not import the __pkginfo__.py module to make cubes installable via setuptools
David Douard <david.douard@logilab.fr>
parents:
11085
diff
changeset
|
51 |
|
fccc6ddd975c
[skeleton] do not import the __pkginfo__.py module to make cubes installable via setuptools
David Douard <david.douard@logilab.fr>
parents:
11085
diff
changeset
|
52 |
# get optional metadatas |
11455
d686c4e8cdb2
[devtools] Adjust skeleton setup.py to have it read information from __pkginfo__.py
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11424
diff
changeset
|
53 |
data_files = __pkginfo__.get('data_files', None) |
d686c4e8cdb2
[devtools] Adjust skeleton setup.py to have it read information from __pkginfo__.py
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11424
diff
changeset
|
54 |
dependency_links = __pkginfo__.get('dependency_links', ()) |
11152
fccc6ddd975c
[skeleton] do not import the __pkginfo__.py module to make cubes installable via setuptools
David Douard <david.douard@logilab.fr>
parents:
11085
diff
changeset
|
55 |
|
11424
1451f040555f
[pkg] Drop NO_SETUPTOOLS option
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11152
diff
changeset
|
56 |
requires = {} |
1451f040555f
[pkg] Drop NO_SETUPTOOLS option
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11152
diff
changeset
|
57 |
for entry in ("__depends__",): # "__recommends__"): |
11455
d686c4e8cdb2
[devtools] Adjust skeleton setup.py to have it read information from __pkginfo__.py
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11424
diff
changeset
|
58 |
requires.update(__pkginfo__.get(entry, {})) |
d686c4e8cdb2
[devtools] Adjust skeleton setup.py to have it read information from __pkginfo__.py
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11424
diff
changeset
|
59 |
install_requires = ["{0} {1}".format(d, v and v or "").strip() |
11424
1451f040555f
[pkg] Drop NO_SETUPTOOLS option
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11152
diff
changeset
|
60 |
for d, v in requires.items()] |
6840
fe5162da6e70
[skel] setup.py patched to get easy_install to work
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6326
diff
changeset
|
61 |
|
5024
9e718abe3fde
add egg support with dependencies auto-installation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
4212
diff
changeset
|
62 |
|
11456
077f32a7a4c3
[devtools] Update skeleton's setup.py to install cube as a package
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11455
diff
changeset
|
63 |
setup( |
077f32a7a4c3
[devtools] Update skeleton's setup.py to install cube as a package
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11455
diff
changeset
|
64 |
name=distname, |
077f32a7a4c3
[devtools] Update skeleton's setup.py to install cube as a package
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11455
diff
changeset
|
65 |
version=version, |
077f32a7a4c3
[devtools] Update skeleton's setup.py to install cube as a package
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11455
diff
changeset
|
66 |
license=license, |
077f32a7a4c3
[devtools] Update skeleton's setup.py to install cube as a package
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11455
diff
changeset
|
67 |
description=description, |
077f32a7a4c3
[devtools] Update skeleton's setup.py to install cube as a package
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11455
diff
changeset
|
68 |
long_description=long_description, |
077f32a7a4c3
[devtools] Update skeleton's setup.py to install cube as a package
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11455
diff
changeset
|
69 |
author=author, |
077f32a7a4c3
[devtools] Update skeleton's setup.py to install cube as a package
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11455
diff
changeset
|
70 |
author_email=author_email, |
077f32a7a4c3
[devtools] Update skeleton's setup.py to install cube as a package
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11455
diff
changeset
|
71 |
url=web, |
077f32a7a4c3
[devtools] Update skeleton's setup.py to install cube as a package
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11455
diff
changeset
|
72 |
classifiers=classifiers, |
077f32a7a4c3
[devtools] Update skeleton's setup.py to install cube as a package
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11455
diff
changeset
|
73 |
packages=find_packages(exclude=['test']), |
077f32a7a4c3
[devtools] Update skeleton's setup.py to install cube as a package
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11455
diff
changeset
|
74 |
install_requires=install_requires, |
11697
7b6c3cb0e103
[skeleton] Have setuptools install data files
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11472
diff
changeset
|
75 |
include_package_data=True, |
11472
bc04039acd2e
[config] Make available_cubes aware of cubes installed as packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11471
diff
changeset
|
76 |
entry_points={ |
bc04039acd2e
[config] Make available_cubes aware of cubes installed as packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11471
diff
changeset
|
77 |
'cubicweb.cubes': [ |
bc04039acd2e
[config] Make available_cubes aware of cubes installed as packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11471
diff
changeset
|
78 |
'%(cubename)s=cubicweb_%(cubename)s', |
bc04039acd2e
[config] Make available_cubes aware of cubes installed as packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11471
diff
changeset
|
79 |
], |
bc04039acd2e
[config] Make available_cubes aware of cubes installed as packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11471
diff
changeset
|
80 |
}, |
11456
077f32a7a4c3
[devtools] Update skeleton's setup.py to install cube as a package
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11455
diff
changeset
|
81 |
zip_safe=False, |
077f32a7a4c3
[devtools] Update skeleton's setup.py to install cube as a package
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
11455
diff
changeset
|
82 |
) |