Commits

Daniel Holth  committed b50eecd

replace setup.py requirements with setup.cfg values if present

  • Participants
  • Parent commits cc8c1c4
  • Tags 0.9.6

Comments (0)

Files changed (4)

+0.9.6
+=====
+- requires-dist from setup.cfg overwrites any requirements from setup.py
+  Care must be taken that the requirements are the same in both cases,
+  or just always install from wheel.
+- drop dirspec requirement on win32
+- improved command line utility, adds 'wheel convert [egg or wininst]' to
+  convert legacy binary formats to wheel
+
 0.9.5
 =====
 - Wheel's own wheel file can be executed by Python, and can install itself: 
 with-doctest=1
 
 [metadata]
-requires_dist = argparse; python_version < '2.7'
+provides-extra = 
+    tool
+    signatures
+    faster-signatures
+requires-dist = 
+    distribute >= 0.6.28
+    markerlib
+    argparse; python_version < '2.7'
+    keyring; extra == 'tool'
+    dirspec; sys.platform != 'win32' and extra == 'tool'
+    ed25519ll; extra == 'faster-signatures'
     tool_reqs.append('dirspec')
 
 setup(name='wheel',
-      version='0.9.5',
+      version='0.9.6',
       description='A built-package format for Python.',
       long_description=README + '\n\n' +  CHANGES,
       classifiers=[

File wheel/bdist_wheel.py

 import hashlib
 import os
 import subprocess
+import warnings
 
 try:
     import sysconfig
         section in setup.cfg:
         
         [metadata]
-        requires_dist = requirement; qualifier
+        provides-extra = extra1
+            extra2
+        requires-dist = requirement; qualifier
             another; qualifier2
             unqualified
             
         Yields
         
+        ('Provides-Extra', 'extra1'),
+        ('Provides-Extra', 'extra2'),
         ('Requires-Dist', 'requirement; qualifier'),
         ('Requires-Dist', 'another; qualifier2'),
         ('Requires-Dist', 'unqualified')
         """
-        requires = []
-        try:
-            metadata = self.distribution.get_option_dict('metadata')
-            requires = metadata['requires_dist']
-            for req in requires[1].splitlines():
-                req = req.strip()
-                if not req:
+        metadata = self.distribution.get_option_dict('metadata')
+
+        # our .ini parser folds - to _ in key names:
+        for key, title in (('provides_extra', 'Provides-Extra'), 
+                           ('requires_dist', 'Requires-Dist')):
+            if not key in metadata:
+                continue
+            field = metadata[key]
+            for line in field[1].splitlines():
+                line = line.strip()
+                if not line:
                     continue
-                yield ('Requires-Dist', req)                 
-        except KeyError:
-            return
+                yield (title, line) 
     
     def add_requirements(self, metadata_path):
         """Add additional requirements from setup.cfg to file metadata_path"""
         additional = list(self.setupcfg_requirements())
-        if not additional: return
+        if not additional: return        
         pkg_info = read_pkg_info(metadata_path)
+        if 'Provides-Extra' in pkg_info or 'Requires-Dist' in pkg_info:
+            warnings.warn('setup.cfg requirements overwrite values from setup.py')
+            del pkg_info['Provides-Extra']
+            del pkg_info['Requires-Dist'] 
         for k, v in additional:
             pkg_info[k] = v
         write_pkg_info(metadata_path, pkg_info)