I have the following files:
setup.py
problems/
__init__.py
sometimes_included/
file.txt
__init__.py
simply contains:
import os
with open(os.path.join(os.path.join(os.path.dirname(__file__), "sometimes_included"), "file.txt")) as f:
print(f.read())
And file.txt
is just some dummy text.
The file is in a repo at https://github.com/ysangkok/packaging-problems
When I pip3 install https://github.com/ysangkok/packaging-problems/archive/master.zip
and then python3 -c 'import problems'
it doesn't work, (the txt file was not installed).
But if I clone the git repo and python3 setup.py install --user
, it works.
How can I achieve consistent behaviour without listing problems/sometimes_included
as a package in setup.py
. This directory is not a package, it shouldn't need a __init__.py
. And given that it works when not using wheels, I am wondering if there is a way.