def test_add_from_site_is_ignored(self):
     location = '/test/location/does-not-have-to-exist'
     # PthDistributions expects all locations to be normalized
     location = pkg_resources.normalize_path(location)
     pth = PthDistributions('does-not_exist', [location, ])
     assert not pth.dirty
     pth.add(PRDistribution(location))
     assert not pth.dirty
 def test_add_from_cwd_site_sets_dirty(self):
     '''a pth file manager should set dirty
     if a distribution is in site but also the cwd
     '''
     pth = PthDistributions('does-not_exist', [os.getcwd()])
     self.assertTrue(not pth.dirty)
     pth.add(PRDistribution(os.getcwd()))
     self.assertTrue(pth.dirty)
Exemplo n.º 3
0
 def test_add_from_cwd_site_sets_dirty(self):
     """a pth file manager should set dirty
     if a distribution is in site but also the cwd
     """
     pth = PthDistributions("does-not_exist", [os.getcwd()])
     self.assert_(not pth.dirty)
     pth.add(PRDistribution(os.getcwd()))
     self.assert_(pth.dirty)
Exemplo n.º 4
0
 def test_add_from_cwd_site_sets_dirty(self):
     '''a pth file manager should set dirty
     if a distribution is in site but also the cwd
     '''
     pth = PthDistributions('does-not_exist', [os.getcwd()])
     self.assertTrue(not pth.dirty)
     pth.add(PRDistribution(os.getcwd()))
     self.assertTrue(pth.dirty)
 def test_add_from_site_is_ignored(self):
     location = '/test/location/does-not-have-to-exist'
     # PthDistributions expects all locations to be normalized
     location = pkg_resources.normalize_path(location)
     pth = PthDistributions('does-not_exist', [location, ])
     assert not pth.dirty
     pth.add(PRDistribution(location))
     assert not pth.dirty
 def test_add_from_site_is_ignored(self):
     if os.name != 'nt':
         location = '/test/location/does-not-have-to-exist'
     else:
         location = 'c:\\does_not_exist'
     pth = PthDistributions('does-not_exist', [location, ])
     self.assertTrue(not pth.dirty)
     pth.add(PRDistribution(location))
     self.assertTrue(not pth.dirty)
Exemplo n.º 7
0
 def test_add_from_site_is_ignored(self):
     if os.name != "nt":
         location = "/test/location/does-not-have-to-exist"
     else:
         location = "c:\\does_not_exist"
     pth = PthDistributions("does-not_exist", [location])
     self.assert_(not pth.dirty)
     pth.add(PRDistribution(location))
     self.assert_(not pth.dirty)
Exemplo n.º 8
0
 def test_add_from_site_is_ignored(self):
     if os.name != 'nt':
         location = '/test/location/does-not-have-to-exist'
     else:
         location = 'c:\\does_not_exist'
     pth = PthDistributions('does-not_exist', [location, ])
     self.assert_(not pth.dirty)
     pth.add(PRDistribution(location))
     self.assert_(not pth.dirty)
Exemplo n.º 9
0
#!@PYTHON@

import sys

from setuptools.command.easy_install import PthDistributions
from pkg_resources import find_distributions

usage = "@PYPREFIX@-manage-eggs [ register | unregister ] egg\n"

if len(sys.argv) != 3 or sys.argv[1] not in ("register", "unregister"):
	sys.stderr.write(usage)
	sys.exit(1)

pth = PthDistributions("@PYSITELIB@/easy-install.pth")
distrib = find_distributions(sys.argv[2], True).next()
if sys.argv[1] == "register":
	pth.add(distrib)
elif sys.argv[1] == "unregister":
	pth.remove(distrib)
pth.save()
Exemplo n.º 10
0
 def test_add_from_site_is_ignored(self):
     pth = PthDistributions('does-not_exist',
                            ['/test/location/does-not-have-to-exist'])
     self.assert_(not pth.dirty)
     pth.add(PRDistribution('/test/location/does-not-have-to-exist'))
     self.assert_(not pth.dirty)
Exemplo n.º 11
0
 def test_add_from_site_is_ignored(self):
     pth = PthDistributions('does-not_exist', ['/test/location/does-not-have-to-exist'])
     self.assert_(not pth.dirty)
     pth.add(PRDistribution('/test/location/does-not-have-to-exist'))
     self.assert_(not pth.dirty)
Exemplo n.º 12
0
#!@PYTHON@

import sys

from setuptools.command.easy_install import PthDistributions
from pkg_resources import find_distributions

usage = "@PYPREFIX@-manage-eggs [ register | unregister ] egg\n"

if len(sys.argv) != 3 or sys.argv[1] not in ("register", "unregister"):
    sys.stderr.write(usage)
    sys.exit(1)

pth = PthDistributions("@PYSITELIB@/easy-install.pth")
distrib = find_distributions(sys.argv[2], True).next()
if sys.argv[1] == "register":
    pth.add(distrib)
elif sys.argv[1] == "unregister":
    pth.remove(distrib)
pth.save()