[Zope-CVS] CVS: Packages/zpkgtools/zpkgtools - app.py:1.54

Fred L. Drake, Jr. fred at zope.com
Tue May 4 19:59:20 EDT 2004


Update of /cvs-repository/Packages/zpkgtools/zpkgtools
In directory cvs.zope.org:/tmp/cvs-serv19892/zpkgtools

Modified Files:
	app.py 
Log Message:
Distributable components must be either Python packages or contain
some metadata for how to deal with the package.  This is now checked
for when a component is loaded.


=== Packages/zpkgtools/zpkgtools/app.py 1.53 => 1.54 ===
--- Packages/zpkgtools/zpkgtools/app.py:1.53	Tue May  4 18:55:01 2004
+++ Packages/zpkgtools/zpkgtools/app.py	Tue May  4 19:58:49 2004
@@ -291,6 +291,16 @@
         specs.distribution.cook()
         self.collection = specs.collection
         self.distribution = specs.distribution
+        #
+        # Check that this package is valid:
+        #
+        setup_cfg = os.path.join(self.source, package.PACKAGE_CONF)
+        if self.is_python_package() or os.path.isfile(setup_cfg):
+            return
+        raise zpkgtools.Error(
+            "%r is an invalid distribution component: all components must"
+            " either be a Python package or provide a %s file"
+            % (name, package.PACKAGE_CONF))
 
     def get_dependencies(self):
         """Get the direct dependencies of this component.




More information about the Zope-CVS mailing list