install mycfg stub along with the package

This commit is contained in:
Dima Gerasimov 2020-02-05 20:41:37 +00:00 committed by Dmitrii Gerasimov
parent 9cd93e5c05
commit fe0521b6dc
5 changed files with 9 additions and 2 deletions

View file

@ -6,7 +6,7 @@ except ImportError:
import warnings
warnings.warn("mycfg package isn't found! That might result in issues")
from . import fake_mycfg as mycfg # type: ignore[no-redef]
from . import mycfg_stub as mycfg # type: ignore[no-redef]
import sys
sys.modules['mycfg'] = mycfg
del sys

View file

@ -23,7 +23,13 @@ def main():
# package_dir={'': ''},
packages=find_packages(),
package_data={
'my': ['py.typed'],
'my': [
# for mypy
'py.typed',
# empty dir, necessary for proper dynamic imports
'mycfg_stub/repos/.gitkeep',
],
},
python_requires='>=3.5', # depends on the modules though..

View file

@ -12,6 +12,7 @@ commands =
# TODO ??
# python -m pytest {posargs}
python3 -c 'import my; print(my.__path__)'
python3 -c 'import my; import mycfg.repos' # shouldn't fail at least
# TODO run demo.py? just make sure with_my is a bit cleverer?
# TODO e.g. under CI, rely on installing