Beispiel #1
0
def test_entry_point_exit_code():
    setup_py = dedent("""
    from setuptools import setup

    setup(
      name='my_app',
      version='0.0.0',
      zip_safe=True,
      packages=[''],
      entry_points={'console_scripts': ['my_app = my_app:do_something']},
    )
  """)

    error_msg = 'setuptools expects this to exit non-zero'

    my_app = dedent("""
    def do_something():
      return '%s'
  """ % error_msg)

    with temporary_content({
            'setup.py': setup_py,
            'my_app.py': my_app
    }) as project_dir:
        installer = EggInstaller(project_dir)
        dist = DistributionHelper.distribution_from_path(installer.bdist())
        so, rc = run_simple_pex_test('',
                                     env=make_env(PEX_SCRIPT='my_app'),
                                     dists=[dist])
        assert so.decode('utf-8').strip() == error_msg
        assert rc == 1
Beispiel #2
0
def test_entry_point_exit_code():
  setup_py = dedent("""
    from setuptools import setup

    setup(
      name='my_app',
      version='0.0.0',
      zip_safe=True,
      packages=[''],
      entry_points={'console_scripts': ['my_app = my_app:do_something']},
    )
  """)

  error_msg = 'setuptools expects this to exit non-zero'

  my_app = dedent("""
    def do_something():
      return '%s'
  """ % error_msg)

  with temporary_content({'setup.py': setup_py, 'my_app.py': my_app}) as project_dir:
    installer = EggInstaller(project_dir)
    dist = DistributionHelper.distribution_from_path(installer.bdist())
    so, rc = run_simple_pex_test('', env={'PEX_SCRIPT': 'my_app'}, dists=[dist])
    assert so.decode('utf-8').strip() == error_msg
    assert rc == 1
Beispiel #3
0
 def installer_provider(sdist):
     return EggInstaller(Archiver.unpack(sdist),
                         strict=requirement.key != 'setuptools',
                         interpreter=interpreter)