Merge lp:~exarkun/divmod.org/nevow-setup.py-mandatory-setuptools into lp:divmod.org

Proposed by Jean-Paul Calderone on 2014-06-07
Status: Merged
Approved by: Tristan Seligmann on 2014-06-07
Approved revision: 2743
Merged at revision: 2743
Proposed branch: lp:~exarkun/divmod.org/nevow-setup.py-mandatory-setuptools
Merge into: lp:divmod.org
Prerequisite: lp:~exarkun/divmod.org/nevow-setup.py-trailing-whitespace
Diff against target: 74 lines (+6/-52)
1 file modified
Nevow/setup.py (+6/-52)
To merge this branch: bzr merge lp:~exarkun/divmod.org/nevow-setup.py-mandatory-setuptools
Reviewer Review Type Date Requested Status
Tristan Seligmann 2014-06-07 Approve on 2014-06-07
Review via email: mp+222429@code.launchpad.net

Commit message

Remove the support for using Nevow's setup.py without setuptools.

To post a comment you must log in.
Jean-Paul Calderone (exarkun) wrote :

I verified that `setup.py sdist` and `setup.py wheel` produce the same output with the trunk version and with this version (except that the setup.py in the sdist produced by the branch has exactly the differences that the setup.py in the branch has, of course).

Tristan Seligmann (mithrandi) wrote :

Also looks good, please merge.

review: Approve
Glyph Lefkowitz (glyph) wrote :

Perhaps this goes without saying, but it would be nice to get a release that includes this ASAP.

Jean-Paul Calderone (exarkun) wrote :

Quite so, but on the waaaaaaaay outside chance that someone is raring to go on the Nevow release process, please wait until the version issue is also fixed (iow this branch is a step towards a modernly packaged Nevow but we're not quite there yet).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Nevow/setup.py'
2--- Nevow/setup.py 2014-06-07 12:29:29 +0000
3+++ Nevow/setup.py 2014-06-07 12:29:29 +0000
4@@ -2,10 +2,7 @@
5
6 from nevow import __version__ as version
7
8-try:
9- import setuptools
10-except ImportError:
11- setuptools = None
12+from setuptools import setup, find_packages
13
14 import os
15 data_files=[]
16@@ -83,54 +80,11 @@
17 }
18 }
19
20-if setuptools:
21- # Importing setuptools worked -- then we do the following setup script:
22- from setuptools import setup, find_packages
23-
24- setupdict['packages'] = find_packages()
25- setupdict['include_package_data'] = True
26-else:
27- # No setuptools -- decide where the data files should go and explicitly list
28- # the packages.
29-
30- from distutils.core import setup
31-
32- import os.path
33- import glob
34- import sys
35-
36- # Where should our data files go?
37- # They want to go in our package directory , which is under site-packages.
38- # We determine the location of site-packages here, for later use. It will be
39- # interpreted as relative to sys.prefix.
40-
41- # This junk can go once we decide to drop Python 2.3 support or switch to
42- # requiring setuptools. package_data is a much cleaner solution.
43- if sys.platform.lower().startswith('win'):
44- site_packages = 'Lib/site-packages/'
45- else:
46- version = '.'.join([str(i) for i in sys.version_info[:2]])
47- site_packages = 'lib/python' + version + '/site-packages/'
48-
49- # Turn the package_data into a data_files for 2.3 compatability
50- setupdict['data_files'] = []
51- for pkg, patterns in setupdict['package_data'].items():
52- pkgdir = os.path.join(*pkg.split('.'))
53- for pattern in patterns:
54- globdir = os.path.dirname(pattern)
55- files = glob.glob(os.path.join(pkgdir, pattern))
56- setupdict['data_files'].append((os.path.join(site_packages,pkgdir,globdir),files))
57-
58- # We need to list the packages explicitly.
59- setupdict['packages'] = [
60- 'formless', 'formless.test', 'nevow', 'nevow.flat',
61- 'nevow.scripts', 'nevow.test', 'nevow.taglibrary',
62- 'nevow.plugins', 'nevow.livetrial', 'twisted.plugins']
63-
64-if setuptools is not None:
65- from distutils.command.sdist import sdist
66- setupdict['cmdclass'] = {'sdist': sdist}
67-
68+setupdict['packages'] = find_packages()
69+setupdict['include_package_data'] = True
70+
71+from distutils.command.sdist import sdist
72+setupdict['cmdclass'] = {'sdist': sdist}
73
74 setup(**setupdict)
75

Subscribers

People subscribed via source and target branches