def test_simple_run(self):
     header_list = self.mkdtemp()
     header1 = os.path.join(header_list, 'header1')
     header2 = os.path.join(header_list, 'header2')
     self.write_file(header1)
     self.write_file(header2)
     headers = [header1, header2]
     pkg_dir, dist = self.create_dist(headers=headers)
     cmd = install_headers(dist)
     self.assertEqual(cmd.get_inputs(), headers)
     cmd.install_dir = os.path.join(pkg_dir, 'inst')
     cmd.ensure_finalized()
     cmd.run()
     self.assertEqual(len(cmd.get_outputs()), 2)
Пример #2
0
 def test_simple_run(self):
     header_list = self.mkdtemp()
     header1 = os.path.join(header_list, 'header1')
     header2 = os.path.join(header_list, 'header2')
     self.write_file(header1)
     self.write_file(header2)
     headers = [header1, header2]
     pkg_dir, dist = self.create_dist(headers=headers)
     cmd = install_headers(dist)
     self.assertEqual(cmd.get_inputs(), headers)
     cmd.install_dir = os.path.join(pkg_dir, 'inst')
     cmd.ensure_finalized()
     cmd.run()
     self.assertEqual(len(cmd.get_outputs()), 2)
Пример #3
0
    def test_simple_run(self):
        # we have two headers
        header_list = self.mkdtemp()
        header1 = os.path.join(header_list, "header1")
        header2 = os.path.join(header_list, "header2")
        self.write_file(header1)
        self.write_file(header2)
        headers = [header1, header2]

        pkg_dir, dist = self.create_dist(headers=headers)
        cmd = install_headers(dist)
        self.assertEqual(cmd.get_inputs(), headers)

        # let's run the command
        cmd.install_dir = os.path.join(pkg_dir, "inst")
        cmd.ensure_finalized()
        cmd.run()

        # let's check the results
        self.assertEqual(len(cmd.get_outputs()), 2)
    def test_simple_run(self):
        # we have two headers
        header_list = self.mkdtemp()
        header1 = os.path.join(header_list, 'header1')
        header2 = os.path.join(header_list, 'header2')
        self.write_file(header1)
        self.write_file(header2)
        headers = [header1, header2]

        pkg_dir, dist = self.create_dist(headers=headers)
        cmd = install_headers(dist)
        self.assertEquals(cmd.get_inputs(), headers)

        # let's run the command
        cmd.install_dir = os.path.join(pkg_dir, 'inst')
        cmd.ensure_finalized()
        cmd.run()

        # let's check the results
        self.assertEquals(len(cmd.get_outputs()), 2)
Пример #5
0
    packages=['treecorr'],
    data_files=[('treecorr/include', headers)],
    ext_modules=[ext],
    install_requires=dependencies,
    cmdclass={
        'build_ext': my_builder,
        'install_scripts': my_install_scripts,
        'easy_install': my_easy_install,
    },
    headers=headers,
    scripts=scripts)

# I don't actually need these installed for TreeCorr, but I wanted to figure out how to do
# it, so I played with it here.  distutils installs these automatically when the headers argument
# is given to setup.  But setuptools doesn't.  cf. http://bugs.python.org/setuptools/issue142
cmd = install_headers(dist)
cmd.finalize_options()
print('Installing headers to ', cmd.install_dir)
cmd.run()

# Check that the path includes the directory where the scripts are installed.
if dist.script_install_dir not in os.environ['PATH'].split(':'):
    print(
        '\nWARNING: The TreeCorr executables were installed in a directory not in your PATH'
    )
    print(
        '         If you want to use the executables, you should add the directory'
    )
    print('\n             ', dist.script_install_dir, '\n')
    print('         to your path.  The current path is')
    print('\n             ', os.environ['PATH'], '\n')
Пример #6
0
      download_url="https://github.com/rmjarvis/TreeCorr/releases/tag/v3.2.0.zip",
      packages=['treecorr'],
      data_files=[('treecorr/include',headers)],
      ext_modules=[ext],
      install_requires=dependencies,
      cmdclass = {'build_ext': my_builder,
                  'install_scripts': my_install_scripts,
                  'easy_install': my_easy_install,
                  },
      headers=headers,
      scripts=scripts)

# I don't actually need these installed for TreeCorr, but I wanted to figure out how to do
# it, so I played with it here.  distutils installs these automatically when the headers argument
# is given to setup.  But setuptools doesn't.  cf. http://bugs.python.org/setuptools/issue142
cmd = install_headers(dist)
cmd.finalize_options()
print('Installing headers to ',cmd.install_dir)
cmd.run()

# Check that the path includes the directory where the scripts are installed.
if dist.script_install_dir not in os.environ['PATH'].split(':'):
    print('\nWARNING: The TreeCorr executables were installed in a directory not in your PATH')
    print('         If you want to use the executables, you should add the directory')
    print('\n             ',dist.script_install_dir,'\n')
    print('         to your path.  The current path is')
    print('\n             ',os.environ['PATH'],'\n')
    print('         Alternatively, you can specify a different prefix with --prefix=PREFIX,')
    print('         in which case the scripts will be installed in PREFIX/bin.')
    print('         If you are installing via pip use --install-option="--prefix=PREFIX"')