Esempio n. 1
0
 def setUp(self):
     self.tempdir = utils.Tempdir()
     self.tempdir.setup()
     filenames = [self.tempdir.create_file(f, FILES[f]) for f in FILES]
     self.fs = fs.OSFileSystem(self.tempdir.path)
     env = environment.Environment(fs.Path([self.fs]), (3, 6))
     self.graph = graph.ImportGraph.create(env, filenames)
Esempio n. 2
0
 def setUp(self):
     self.tempdir = utils.Tempdir()
     self.tempdir.setup()
     self.filenames = [
         self.tempdir.create_file(f, FILES[f])
         for f in FILES]
     self.fs = fs.OSFileSystem(self.tempdir.path)
     self.env = environment.Environment(
         fs.Path([self.fs]), sys.version_info[:2])
Esempio n. 3
0
def create_importlab_environment(conf, typeshed):
    """Create an importlab environment from the python version and path."""
    python_version = utils.split_version(conf.python_version)
    path = fs.Path()
    for p in conf.pythonpath:
        path.add_path(p, 'os')
    for p in typeshed.get_pytd_paths(python_version):
        path.add_fs(PytdFileSystem(fs.OSFileSystem(p)))
    for p in typeshed.get_typeshed_paths(python_version):
        path.add_path(p, 'pyi')
    return environment.Environment(path, python_version)