astropy / astropy-helpers

Helpers for Astropy and Affiliated packages
BSD 3-Clause "New" or "Revised" License
28 stars 42 forks source link

Fix inclusion of compiler.c in tar file #485

Closed astrofrog closed 5 years ago

astrofrog commented 5 years ago

The include_package_data option is confusing and results in data files defined in setup.cfg being ignored, and instead it uses the MANIFEST. So I've removed the include_package_data option since I think defining the data in setup.cfg is preferable. With this change, compiler.c gets included.

This is an alternative to https://github.com/astropy/astropy-helpers/pull/484

astrofrog commented 5 years ago

I'm working on a regression test

codecov[bot] commented 5 years ago

Codecov Report

Merging #485 into master will decrease coverage by 29.64%. The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           master     #485       +/-   ##
===========================================
- Coverage    77.1%   47.45%   -29.65%     
===========================================
  Files          11       19        +8     
  Lines        1031     1673      +642     
===========================================
- Hits          795      794        -1     
- Misses        236      879      +643
Impacted Files Coverage Δ
astropy_helpers/openmp_helpers.py 67.47% <0%> (-18.7%) :arrow_down:
astropy_helpers/utils.py 62.4% <0%> (-3.71%) :arrow_down:
astropy_helpers/commands/build_ext.py 90.32% <0%> (-1.99%) :arrow_down:
astropy_helpers/setup_helpers.py 67.6% <0%> (-1.46%) :arrow_down:
astropy_helpers/commands/build_sphinx.py 76.92% <0%> (-1.34%) :arrow_down:
astropy_helpers/version_helpers.py 86.33% <0%> (-0.7%) :arrow_down:
astropy_helpers/tests/test_openmp_helpers.py 0% <0%> (ø)
astropy_helpers/tests/__init__.py 0% <0%> (ø)
astropy_helpers/conftest.py 0% <0%> (ø)
astropy_helpers/tests/test_setup_helpers.py 0% <0%> (ø)
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 125dd40...9a07c83. Read the comment docs.

astrofrog commented 5 years ago

The regression test fails with:

_________________________ test_missing_cython_c_files __________________________
capsys = <_pytest.capture.CaptureFixture object at 0x1173515c0>
pyx_extension_test_package = local('/private/var/folders/nz/vv4_9tw56nv9k3tkvyszvwg80000gn/T/pytest-of-travis/pytest-1/test_missing_cython_c_files0/test_pkg')
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x117318fd0>
    def test_missing_cython_c_files(capsys, pyx_extension_test_package,
                                    monkeypatch):
        """
        Regression test for https://github.com/astropy/astropy-helpers/pull/181

        Test failure mode when building a package that has Cython modules, but
        where Cython is not installed and the generated C files are missing.
        """

        test_pkg = pyx_extension_test_package

        with test_pkg.as_cwd():

            with pytest.raises(SystemExit):
                run_setup('setup.py', ['build_ext', '--inplace', '--no-cython'])

            stdout, stderr = capsys.readouterr()
            assert "No git repository present at" in stderr

            msg = ('Could not find C/C++ file {0}'
                   '.(c/cpp)'.format('apyhtest_eva/unit02'.replace('/', os.sep)))

>           assert msg in stderr
E           assert 'Could not find C/C++ file apyhtest_eva/unit02.(c/cpp)' in "/Users/travis/build/astropy/astropy-helpers/dist/astropy-helpers-4.0.dev189/astropy_helpers/setup_helpers.py:165: Ast.../Users/travis/build/astropy/astropy-helpers/dist/astropy-helpers-4.0.dev189/astropy_helpers/commands/src/compiler.c'\n"
astropy_helpers/tests/test_setup_helpers.py:246: AssertionError
=============================== warnings summary ===============================

without this fix (as tested on Travis)