Esempio n. 1
0
 def test_sanity_check_wheel(self):
     # Sanity check that the setUpClass() created the wheel, that it can be
     # pip installed in a temporary directory, and that with only the
     # installed package on sys.path, the package can be imported and run.
     dist_dir = temporary_directory()
     self.addCleanup(dist_dir.cleanup)
     with chdir(self.example_dir):
         call([
             sys.executable,
             'setup.py',
             '--no-user-cfg',
             'bdist_wheel',
             '--universal',
             '--dist-dir',
             dist_dir.name,
         ])
     wheels = glob(os.path.join(dist_dir.name, '*.whl'))
     self.assertEqual(len(wheels), 1)
     wheel = wheels[0]
     with temporary_directory() as tempdir:
         call(['pip', 'install', '--target', tempdir, wheel])
         result = output(
             [sys.executable, '-c', 'import stupid; stupid.yes()'],
             env=dict(PYTHONPATH=tempdir))
     self.assertEqual(result, 'yes\n')
Esempio n. 2
0
 def _install_example(self):
     with chdir(self.example_dir):
         call([
             self.python, 'setup.py', '--no-user-cfg',
             '--command-packages=stdeb.command', 'bdist_deb'
         ])
         # bdist_deb can't be told where to leave its artifacts, so
         # make sure that cruft gets cleaned up after this test.
         dist_dir = os.path.join(self.example_dir, 'deb_dist')
         self.addCleanup(shutil.rmtree, os.path.join(dist_dir))
         tar_gzs = glob(os.path.join(self.example_dir, '*.tar.gz'))
         if len(tar_gzs) > 0:
             assert len(tar_gzs) == 1, tar_gzs
             self.addCleanup(os.remove, tar_gzs[0])
         # Install the .deb and all its dependencies in the schroot.
         debs = glob(os.path.join(dist_dir, '*.deb'))
         self.assertEqual(len(debs), 1)
         deb = debs[0]
         self.session.call(['gdebi', '-n', deb])
Esempio n. 3
0
 def _install_example(self):
     with chdir(self.example_dir):
         call([
             self.python,
             'setup.py', '--no-user-cfg',
             '--command-packages=stdeb.command',
             'bdist_deb'
             ])
         # bdist_deb can't be told where to leave its artifacts, so
         # make sure that cruft gets cleaned up after this test.
         dist_dir = os.path.join(self.example_dir, 'deb_dist')
         self.addCleanup(shutil.rmtree, os.path.join(dist_dir))
         tar_gzs = glob(os.path.join(self.example_dir, '*.tar.gz'))
         if len(tar_gzs) > 0:
             assert len(tar_gzs) == 1, tar_gzs
             self.addCleanup(os.remove, tar_gzs[0])
         # Install the .deb and all its dependencies in the schroot.
         debs = glob(os.path.join(dist_dir, '*.deb'))
         self.assertEqual(len(debs), 1)
         deb = debs[0]
         self.session.call(['gdebi', '-n', deb])
Esempio n. 4
0
 def test_sanity_check_wheel(self):
     # Sanity check that the setUpClass() created the wheel, that it can be
     # pip installed in a temporary directory, and that with only the
     # installed package on sys.path, the package can be imported and run.
     dist_dir = temporary_directory()
     self.addCleanup(dist_dir.cleanup)
     with chdir(self.example_dir):
         call([
             sys.executable,
             'setup.py', '--no-user-cfg',
             'bdist_wheel', '--universal',
             '--dist-dir', dist_dir.name,
             ])
     wheels = glob(os.path.join(dist_dir.name, '*.whl'))
     self.assertEqual(len(wheels), 1)
     wheel = wheels[0]
     with temporary_directory() as tempdir:
         call(['pip', 'install', '--target', tempdir, wheel])
         result = output(
             [sys.executable, '-c', 'import stupid; stupid.yes()'],
             env=dict(PYTHONPATH=tempdir))
     self.assertEqual(result, 'yes\n')