Lines Matching full:package

36         self.package = None
99 """Generate list of '(package,src_dir,build_dir,filenames)' tuples"""
103 for package in self.packages:
104 # Locate package source directory
105 src_dir = self.get_package_dir(package)
107 # Compute package build directory
108 build_dir = os.path.join(*([self.build_lib] + package.split('.')))
117 file[plen:] for file in self.find_data_files(package, src_dir)
119 data.append((package, src_dir, build_dir, filenames))
122 def find_data_files(self, package, src_dir): argument
123 """Return filenames for package's data files in 'src_dir'"""
125 + self.package_data.get(package, []))
137 for package, src_dir, build_dir, filenames in self.data_files:
144 def get_package_dir(self, package): argument
146 distribution, where package 'package' should be found
149 path = package.split('.')
170 # for the root (nameless) package, then fallback on it;
184 def check_package(self, package, package_dir): argument
192 "package directory '%s' does not exist" % package_dir)
195 "supposed package directory '%s' exists, "
198 # Require __init__.py for all but the "root package"
199 if package:
204 log.warn(("package init file '%s' not found " +
207 # Either not in a package at all (__init__.py not expected), or
218 def find_package_modules(self, package, package_dir): argument
219 self.check_package(package, package_dir)
228 modules.append((package, module, f))
235 module name in 'self.py_modules'. Returns a list of tuples (package,
236 module_base, filename): 'package' is a tuple of the path through
237 package-space to the module; 'module_base' is the bare (no
242 # Map package names to tuples of useful info about the package:
245 # this package
246 # checked - true if we have checked that the package directory
250 # List of (package, module, filename) tuples to return
254 # just the "package" for a toplevel is empty (either an empty
256 # - don't check for __init__.py in directory for empty package
259 package = '.'.join(path[0:-1])
263 (package_dir, checked) = packages[package]
265 package_dir = self.get_package_dir(package)
269 init_py = self.check_package(package, package_dir)
270 packages[package] = (package_dir, 1)
272 modules.append((package, "__init__", init_py))
281 modules.append((package, module_base, module_file))
289 (package, module, module_file), just like 'find_modules()' and
295 for package in self.packages:
296 package_dir = self.get_package_dir(package)
297 m = self.find_package_modules(package, package_dir)
304 def get_module_outfile(self, build_dir, package, module): argument
305 outfile_path = [build_dir] + list(package) + [module + ".py"]
311 for (package, module, module_file) in modules:
312 package = package.split('.')
313 filename = self.get_module_outfile(self.build_lib, package, module)
323 for package, src_dir, build_dir, filenames in self.data_files
329 def build_module(self, module, module_file, package): argument
330 if isinstance(package, str):
331 package = package.split('.')
332 elif not isinstance(package, (list, tuple)):
334 "'package' must be a string (dot-separated), list, or tuple")
339 outfile = self.get_module_outfile(self.build_lib, package, module)
346 for (package, module, module_file) in modules:
350 # (Actually, it gets copied to the directory for this package
352 self.build_module(module, module_file, package)
355 for package in self.packages:
357 # Get list of (package, module, module_file) tuples based on
358 # scanning the package directory. 'package' is only included
362 # the *unqualified* module name (ie. no dots, no package -- we
363 # already know its package!), and 'module_file' is the path to
366 package_dir = self.get_package_dir(package)
367 modules = self.find_package_modules(package, package_dir)
372 assert package == package_
373 self.build_module(module, module_file, package)