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

Proposed by Jean-Paul Calderone
Status: Merged
Approved by: Tristan Seligmann
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 Approve
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.
Revision history for this message
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).

Revision history for this message
Tristan Seligmann (mithrandi) wrote :

Also looks good, please merge.

review: Approve
Revision history for this message
Glyph Lefkowitz (glyph) wrote :

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

Revision history for this message
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
=== modified file 'Nevow/setup.py'
--- Nevow/setup.py 2014-06-07 12:29:29 +0000
+++ Nevow/setup.py 2014-06-07 12:29:29 +0000
@@ -2,10 +2,7 @@
22
3from nevow import __version__ as version3from nevow import __version__ as version
44
5try:5from setuptools import setup, find_packages
6 import setuptools
7except ImportError:
8 setuptools = None
96
10import os7import os
11data_files=[]8data_files=[]
@@ -83,54 +80,11 @@
83 }80 }
84}81}
8582
86if setuptools:83setupdict['packages'] = find_packages()
87 # Importing setuptools worked -- then we do the following setup script:84setupdict['include_package_data'] = True
88 from setuptools import setup, find_packages85
8986from distutils.command.sdist import sdist
90 setupdict['packages'] = find_packages()87setupdict['cmdclass'] = {'sdist': sdist}
91 setupdict['include_package_data'] = True
92else:
93 # No setuptools -- decide where the data files should go and explicitly list
94 # the packages.
95
96 from distutils.core import setup
97
98 import os.path
99 import glob
100 import sys
101
102 # Where should our data files go?
103 # They want to go in our package directory , which is under site-packages.
104 # We determine the location of site-packages here, for later use. It will be
105 # interpreted as relative to sys.prefix.
106
107 # This junk can go once we decide to drop Python 2.3 support or switch to
108 # requiring setuptools. package_data is a much cleaner solution.
109 if sys.platform.lower().startswith('win'):
110 site_packages = 'Lib/site-packages/'
111 else:
112 version = '.'.join([str(i) for i in sys.version_info[:2]])
113 site_packages = 'lib/python' + version + '/site-packages/'
114
115 # Turn the package_data into a data_files for 2.3 compatability
116 setupdict['data_files'] = []
117 for pkg, patterns in setupdict['package_data'].items():
118 pkgdir = os.path.join(*pkg.split('.'))
119 for pattern in patterns:
120 globdir = os.path.dirname(pattern)
121 files = glob.glob(os.path.join(pkgdir, pattern))
122 setupdict['data_files'].append((os.path.join(site_packages,pkgdir,globdir),files))
123
124 # We need to list the packages explicitly.
125 setupdict['packages'] = [
126 'formless', 'formless.test', 'nevow', 'nevow.flat',
127 'nevow.scripts', 'nevow.test', 'nevow.taglibrary',
128 'nevow.plugins', 'nevow.livetrial', 'twisted.plugins']
129
130if setuptools is not None:
131 from distutils.command.sdist import sdist
132 setupdict['cmdclass'] = {'sdist': sdist}
133
13488
135setup(**setupdict)89setup(**setupdict)
13690

Subscribers

People subscribed via source and target branches