Commits

Jason Simeone committed d2c0db2 Draft

The package limiting file can now be a pip requirements file (version specifications are ignored).

Comments (0)

Files changed (1)

scripts/pep381run

 #!/usr/bin/env python
-import sys, os, shutil, optparse
+import sys, os, shutil, optparse, re
 try:
     import pep381client
 except ImportError:
 )
 options, args = opts.parse_args()
 
+limit_packages = []
 if options.packages:
-    limit_packages = filter(None, [p.strip() for p in open(options.packages)])
-else:
-    limit_packages = []
+    for pkg in filter(None, [p.strip() for p in open(options.packages)]):
+        if pkg.startswith('#') or pkg.startswith('-'):
+            continue
+        else:
+            pkg = re.split('[=!<>]', pkg, 1)[0]
+        limit_packages.append(pkg)
 
 if len(args) != 1:
     opts.error("You have to specify a target directory")