Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.19.0-rc1 fails to build (ModuleNotFoundError: No module named 'cartopy._version) #1746

Closed
sebastic opened this issue Mar 13, 2021 · 3 comments

Comments

@sebastic
Copy link

Description

The Debian package build for 0.19.0-rc1 fails to build due to test failures:

==================================== ERRORS ====================================
________________________ ERROR collecting test session _________________________
/usr/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1030: in _gcd_import
    ???
<frozen importlib._bootstrap>:1007: in _find_and_load
    ???
<frozen importlib._bootstrap>:972: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:228: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1030: in _gcd_import
    ???
<frozen importlib._bootstrap>:1007: in _find_and_load
    ???
<frozen importlib._bootstrap>:972: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:228: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1030: in _gcd_import
    ???
<frozen importlib._bootstrap>:1007: in _find_and_load
    ???
<frozen importlib._bootstrap>:986: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:680: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:790: in exec_module
    ???
<frozen importlib._bootstrap>:228: in _call_with_frames_removed
    ???
cartopy/__init__.py:7: in <module>
    from ._version import version as __version__  # noqa: F401
E   ModuleNotFoundError: No module named 'cartopy._version'
=========================== short test summary info ============================
ERROR ../../.. - ModuleNotFoundError: No module named 'cartopy._version'
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.10s ===============================

This is caused by lib/cartopy/_version.py being excluded in .gitignore and not being generated during the build:

I: pybuild base:232: python3.9 setup.py config 
/usr/lib/python3.9/distutils/dist.py:274: UserWarning: Unknown distribution option: 'use_scm_version'
  warnings.warn(msg)
running config
   dh_auto_build -O--buildsystem=pybuild
I: pybuild base:232: /usr/bin/python3 setup.py build 
/usr/lib/python3.9/distutils/dist.py:274: UserWarning: Unknown distribution option: 'use_scm_version'
  warnings.warn(msg)

Please don't generate the file during the build, but include it in the source tree.

@QuLogic
Copy link
Member

QuLogic commented Mar 13, 2021

It is in the sdist. If you are building from GitHub, then it appears you missed the change to setuptools-scm.

@sebastic
Copy link
Author

The sdist tarballs are generally inferior to full source because maintaining MANIFEST.in is hard as experience with many projects has shown.

setuptools-scm is alright for upstream development, but it's not usable for downstreams like Debian. We also maintain the package in a VCS, but the tags are not usable for setuptools-scm.

I've added a script to generate _version.py based on the version in debian/changelog to workaround this issue for the time being.

@QuLogic
Copy link
Member

QuLogic commented Mar 13, 2021

The sdist tarballs are generally inferior to full source because maintaining MANIFEST.in is hard as experience with many projects has shown.

The point of setuptools-scm is to not manage MANIFEST.in. There is nothing missing from the sdist now (in fact, it's got extra stuff).

setuptools-scm is alright for upstream development, but it's not usable for downstreams like Debian. We also maintain the package in a VCS, but the tags are not usable for setuptools-scm.

Then don't pull from git? If you want to use the development sources, you need to use the development tools. The same as if it were an autotools project, you would not insist they put generated configure in VCS either.

There's nothing to fix here in upstream. If you want to use sdists, then the version is there. If you don't want to use sdists, then you have to provide the version manually.

@QuLogic QuLogic closed this as completed Mar 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants