Lines Matching refs:site
32 import site
42 if site.ENABLE_USER_SITE and not os.path.isdir(site.USER_SITE):
45 os.makedirs(site.USER_SITE)
47 site.addsitedir(site.USER_SITE)
50 % (site.USER_SITE, exc))
64 self.old_base = site.USER_BASE
65 self.old_site = site.USER_SITE
66 self.old_prefixes = site.PREFIXES
73 site.USER_BASE = self.old_base
74 site.USER_SITE = self.old_site
75 site.PREFIXES = self.old_prefixes
86 abs_dir, norm_dir = site.makepath(*path_parts)
94 dir_set = site._init_pathinfo()
95 for entry in [site.makepath(path)[1] for path in sys.path
105 self.assertIn(site.makepath(pth_file.good_dir_path)[0], sys.path)
118 site.addpackage(pth_file.base_dir, pth_file.filename, set())
138 site.addpackage(pth_dir, pth_fn, set())
153 site.addpackage(pth_dir, pth_fn, set())
165 site.addpackage(pth_dir, pth_fn, set())
181 site.addsitedir(pth_file.base_dir, set())
189 self.assertEqual(site._getuserbase(), sysconfig._getuserbase())
196 self.assertEqual(site._get_path(site._getuserbase()),
199 @unittest.skipUnless(site.ENABLE_USER_SITE, "requires access to PEP 370 "
203 usersite = site.USER_SITE
216 if usersite == site.getsitepackages()[0]:
226 if usersite == site.getsitepackages()[0]:
241 site.USER_BASE = None
242 user_base = site.getuserbase()
245 self.assertEqual(site.USER_BASE, user_base)
248 site.USER_BASE = None
254 self.assertTrue(site.getuserbase().startswith('xoxo'),
255 site.getuserbase())
258 site.USER_SITE = None
259 site.USER_BASE = None
260 user_site = site.getusersitepackages()
263 self.assertEqual(site.USER_SITE, user_site)
264 self.assertTrue(user_site.startswith(site.USER_BASE), user_site)
265 self.assertEqual(site.USER_BASE, site.getuserbase())
268 site.PREFIXES = ['xoxo']
269 dirs = site.getsitepackages()
288 site.USER_SITE = None
289 site.USER_BASE = None
297 user_base = site.getuserbase()
301 user_site = site.getusersitepackages()
305 mock.patch.object(site, 'addsitedir') as mock_addsitedir, \
306 support.swap_attr(site, 'ENABLE_USER_SITE', True):
311 site.addusersitepackages(known_paths)
436 site.removeduppaths()