@@ -223,59 +223,13 @@ def __init__ (self, attrs=None):
223223 else :
224224 sys .stderr .write (msg + "\n " )
225225
226- # Build up the requires sequence
227- from distutils .version import LooseVersion
228- requires = attrs .get ('requires' )
229- if requires :
230- if isinstance (requires , type ('' )):
231- raise DistutilsOptionError , 'requires should be a sequence'
232- newreq = []
233- for req in requires :
234- if '-' not in req :
235- # We have a plain package name - any version will do
236- newreq .append ((req ,None ))
237- else :
238- pkg , ver = string .split (req , '-' , 1 )
239- newreq .append ((pkg , LooseVersion (ver )))
240- attrs ['requires' ] = newreq
241-
242- # Build up the provides object. If the setup() has no
243- # provides line, we use packages or modules and the version
244- # to synthesise the provides. If no version is provided (no
245- # pun intended) we don't have a provides entry at all.
246- provides = attrs .get ('provides' )
247- if provides :
248- if isinstance (provides , type ('' )):
249- raise DistutilsOptionError , 'provides should be a sequence'
250- newprov = []
251- for prov in provides :
252- if '-' not in prov :
253- # We have a plain package name - any version will do
254- newprov .append ((prov ,None ))
255- else :
256- pkg , ver = string .split (prov , '-' , 1 )
257- newprov .append ((pkg , LooseVersion (ver )))
258- attrs ['provides' ] = newprov
259- elif attrs .get ('version' ):
260- # Build a provides line
261- prov = []
262- if attrs .get ('packages' ):
263- for pkg in attrs ['packages' ]:
264- pkg = string .replace (pkg , '/' , '.' )
265- prov .append ('%s-%s' % (pkg , attrs ['version' ]))
266- elif attrs .get ('modules' ):
267- for mod in attrs ['modules' ]:
268- prov .append ('%s-%s' % (mod , attrs ['version' ]))
269- attrs ['provides' ] = prov
270-
271226 # Now work on the rest of the attributes. Any attribute that's
272227 # not already defined is invalid!
273228 for (key ,val ) in attrs .items ():
274229 if hasattr (self .metadata , key ):
275230 setattr (self .metadata , key , val )
276231 elif hasattr (self , key ):
277232 setattr (self , key , val )
278- else :
279233 msg = "Unknown distribution option: %s" % repr (key )
280234 if warnings is not None :
281235 warnings .warn (msg )
@@ -1060,7 +1014,7 @@ class DistributionMetadata:
10601014 "license" , "description" , "long_description" ,
10611015 "keywords" , "platforms" , "fullname" , "contact" ,
10621016 "contact_email" , "license" , "classifiers" ,
1063- "download_url" , "provides" , "requires" , )
1017+ "download_url" )
10641018
10651019 def __init__ (self ):
10661020 self .name = None
@@ -1077,8 +1031,6 @@ def __init__ (self):
10771031 self .platforms = None
10781032 self .classifiers = None
10791033 self .download_url = None
1080- self .requires = []
1081- self .provides = []
10821034
10831035 def write_pkg_info (self , base_dir ):
10841036 """Write the PKG-INFO file into the release tree.
@@ -1094,10 +1046,6 @@ def write_pkg_info (self, base_dir):
10941046 pkg_info .write ('Author: %s\n ' % self .get_contact () )
10951047 pkg_info .write ('Author-email: %s\n ' % self .get_contact_email () )
10961048 pkg_info .write ('License: %s\n ' % self .get_license () )
1097- for req in self .get_requires ():
1098- pkg_info .write ('Requires: %s\n ' % req )
1099- for prov in self .get_provides ():
1100- pkg_info .write ('Provides: %s\n ' % prov )
11011049 if self .download_url :
11021050 pkg_info .write ('Download-URL: %s\n ' % self .download_url )
11031051
@@ -1176,13 +1124,6 @@ def get_classifiers(self):
11761124 def get_download_url (self ):
11771125 return self .download_url or "UNKNOWN"
11781126
1179- def get_requires (self ):
1180- return [ '%s%s%s' % (x , (y and '-' ) or '' , y or '' )
1181- for x ,y in self .requires ]
1182-
1183- def get_provides (self ):
1184- return self .provides
1185-
11861127# class DistributionMetadata
11871128
11881129
0 commit comments