[py-svn] r57370 - py/build

hpk at codespeak.net hpk at codespeak.net
Sun Aug 17 22:07:52 CEST 2008


Author: hpk
Date: Sun Aug 17 22:07:50 2008
New Revision: 57370

Added:
   py/build/_fixpythonpath.py
Modified:
   py/build/_update_website.py
   py/build/docgen.py
   py/build/gensetup.py
   py/build/makepyrelease.py
Log:
various updates to the build helpers, trying to work against setuptools/eggs hiding PYTHONPATHs


Added: py/build/_fixpythonpath.py
==============================================================================
--- (empty file)
+++ py/build/_fixpythonpath.py	Sun Aug 17 22:07:50 2008
@@ -0,0 +1,11 @@
+import os, sys
+
+l = []
+for p in os.environ['PYTHONPATH'].split(':'):
+    if os.path.exists(os.path.join(p, 'py')):
+        l.append(p)
+
+index = 0
+while not sys.path[index]:
+    index += 1
+sys.path[index:index] = l

Modified: py/build/_update_website.py
==============================================================================
--- py/build/_update_website.py	(original)
+++ py/build/_update_website.py	Sun Aug 17 22:07:50 2008
@@ -5,7 +5,7 @@
     rsyncs the whole package (with all the ReST docs converted to HTML) as well
     as the apigen docs to a given remote host and path
 """
-from _findpy import py
+import _fixpythonpath
 import py
 import sys
 

Modified: py/build/docgen.py
==============================================================================
--- py/build/docgen.py	(original)
+++ py/build/docgen.py	Sun Aug 17 22:07:50 2008
@@ -8,9 +8,11 @@
     the navigation bar will be adjusted
 """
 
-from _findpy import py
+import _fixpythonpath
+
 import py
 pypath = py.__pkg__.getpath()
+print "using pypath", pypath
 
 def run_tests(path, envvars='', args=''):
     pytestpath = pypath.join('bin/py.test')
@@ -42,6 +44,7 @@
     if api:
         print 'building api'
         build_apigen_docs(targetpath, testargs)
+
         
 if __name__ == '__main__':
     import sys

Modified: py/build/gensetup.py
==============================================================================
--- py/build/gensetup.py	(original)
+++ py/build/gensetup.py	Sun Aug 17 22:07:50 2008
@@ -106,8 +106,9 @@
                         ["py/c-extension/greenlet/greenlet.c"]),],
         ''' % params)
         indent = " " * 8
-        self.append_pprint(indent, scripts=self.getscripts())
         self.append_pprint(indent, long_description=params['long_description'])
+        self.append_pprint(indent, classifiers=self.meta.classifiers)
+        self.append_pprint(indent, scripts=self.getscripts())
         self.append_pprint(indent, packages=self.getpackages())
         #self.append_pprint(indent, data_files=self.getdatafiles())
         self.append_pprint(indent, package_data=self.getpackagedata())

Modified: py/build/makepyrelease.py
==============================================================================
--- py/build/makepyrelease.py	(original)
+++ py/build/makepyrelease.py	Sun Aug 17 22:07:50 2008
@@ -1,33 +1,10 @@
 #!/usr/bin/env python 
 
-from _findpy import py
 import sys
 
 pydir = py.path.local(py.__file__).dirpath()
 rootdir = pydir.dirpath()
 
-def gen_manifest(): 
-    pywc = py.path.svnwc(pydir)
-    status = pywc.status(rec=True)
-    #assert not status.modified 
-    #assert not status.deleted  
-    #assert not status.added  
-    versioned = dict([(x.localpath,1) for x in status.allpath()])
-
-    l = []
-    for x in rootdir.visit(None, lambda x: x.basename != '.svn'): 
-        if x.check(file=1): 
-            names = [y.basename for y in x.parts()]
-            if '.svn' in names: 
-                l.append(x) 
-            elif x in versioned: 
-                l.append(x) 
-    l.append(rootdir / "setup.py")
-    l = [x.relto(rootdir) for x in l]
-    l.append("")
-    s = "\n".join(l) 
-    return s 
-
 def trace(arg): 
     lines = str(arg).split('\n') 
     prefix = "[trace] "
@@ -40,7 +17,12 @@
     for line in lines: 
         print >>py.std.sys.stdout, line 
 
-def make_distfiles(tmpdir): 
+class PyRelease:
+    def __init__(self, wcpath, pkg):
+        assert self.wcpath.join(pkg.__name__)__name__
+        
+         
+def make_sdist(tmpdir): 
     """ return distdir with tar.gz and zipfile. """ 
     manifest = tmpdir.join('MANIFEST')
     trace("generating %s" %(manifest,))



More information about the pytest-commit mailing list