ionelmc / cookiecutter-pylibrary

Enhanced cookiecutter template for Python libraries.
BSD 2-Clause "Simplified" License
1.25k stars 207 forks source link

CHANGELOG.rst is not found by setup.py when testing on Travis #147

Closed dHannasch closed 5 years ago

dHannasch commented 5 years ago
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-dzixo6zi/setup.py", line 45, in <module>
        re.sub(':[a-z]+:`~?(.*?)`', r'``\1``', read('CHANGELOG.rst'))
      File "/tmp/pip-req-build-dzixo6zi/setup.py", line 23, in read
        encoding=kwargs.get('encoding', 'utf8')
    FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-req-build-dzixo6zi/CHANGELOG.rst'

Despite CHANGELOG.rst being in MANIFEST.in and include_package_data=True in setup.py, it appears that CHANGELOG.rst is not being included.

This appears to be the same problem I ran into on a different CI runner https://github.com/ionelmc/cookiecutter-pylibrary/issues/25#issuecomment-527262806, now manifesting on Travis.

Interestingly, two out of three SCM builds fail, but the third (cython) build passes. Maybe having 'cython' in setup_requires somehow makes include_package_data actually work? I really don't know what's going on there.

Aha: I think it's because the setup_requires in setup.cfg is ignored when we also have setup_requires in setup.py. This happens with the Cython build too, but (I think?) setuptools_scm is a dependency of Cython, so in the Cython case it ends up transitively included anyway.

I'm sort of scratching my head as to why Cython is in setup_requires, actually. https://cython.readthedocs.io/en/latest/src/userguide/source_files_and_compilation.html?highlight=setup_requires#distributing-cython-modules It looks like you only need Cython in setup_requires if you use cmdclass={'build_ext': Cython.Build.build_ext}, whereas you seem to use setuptools.command.build_ext.