Python package_data files not installed in Travis virtual environment?

I have a Python package that contains some data files (.pyi stub files). They are listed in package_data and the MANIFEST.in file. When I pip install the package on a Linux server, the files are included in the package under .../site-packages/my-package/path/to/file.pyi, as expected.

However, when Travis installs the package as a dependency (pip install [.develop] in a dependent package), these files are not installed; that is, .../site-packages/my-package does not contain the .pyi files. This means running mypy on the dependent package fails, which breaks the build.

Is there something special about the pip install in the virtual environment created by Travis, and what do I need to do to get it to include the package_data files?

There’s nothing special about Travis’ virtualenv except the fact that it’s not recreated each time but restored from a prebuilt tarball.

I suspect either an old version of pip or setuptools that don’t understand the metadata, or something different in the installation process (e.g. setup.py develop is very different under the hood from pip install).

Without seeing the build, can’t say any more so please include a link to it in any further inquiries.

Here’s a link to a failing build with debug prints in the dependent crate setup.py, which shows the poor_stubs files are do not exist in the tgutils package. These stubs are installed properly when I pip install tgutils on my servers…

Thanks!

Edit: The actual link.

Running pip install tgutils in a Bionic VM, I don’t see anything named “poor_stubs”, either:

venv/lib/python3.6/site-packages/tgutils:
total 84
-rw-r--r-- 1 vmuser vmuser  8023 окт  6 18:53 application.py
-rw-r--r-- 1 vmuser vmuser  1168 окт  6 18:53 cache.py
-rw-r--r-- 1 vmuser vmuser    63 окт  6 18:53 __init__.py
-rw-r--r-- 1 vmuser vmuser  3903 окт  6 18:53 load_yaml.py
-rw-r--r-- 1 vmuser vmuser  3955 окт  6 18:53 make.py
-rw-r--r-- 1 vmuser vmuser  9287 окт  6 18:53 numpy.py
-rw-r--r-- 1 vmuser vmuser 12520 окт  6 18:53 pandas.py
drwxr-xr-x 2 vmuser vmuser  4096 окт  6 18:53 __pycache__
-rw-r--r-- 1 vmuser vmuser     0 окт  6 18:53 py.typed
-rw-r--r-- 1 vmuser vmuser   345 окт  6 18:53 setup_mypy.py
-rw-r--r-- 1 vmuser vmuser  1603 окт  6 18:53 tests.py
-rw-r--r-- 1 vmuser vmuser 13468 окт  6 18:53 tg_qsub.py
-rw-r--r-- 1 vmuser vmuser    64 окт  6 18:53 version.py

Perhaps these files already exist at your server, or you run some additional commands to generate them.

Hmmm, tried on another server - you are right. Strange…
So it is nothing to do with Travis - I’ll figure it out.

Thanks!