Can just use
And importlib.resources sa shown here
[options.package_data]
this will add .dat
and .rst
files,work for me when i test[options.package_data] * = *.dat, *.rstSo same setup as this,but added
somefile.dat
And importlib.resources sa shown here
packaging_tutorial/ └── src/ └── example_package/ ├── __init__.py └── example.py └── somefile.dat
# Build (pack_tut) G:\div_code\pack_tut\packaging_tutorial λ python -m build * Creating venv isolated environment.. ..... ect Successfully installed example-pkg-YOUR-USERNAME-HERE-0.0.1 # install (pack_tut) G:\div_code\pack_tut\packaging_tutorial\dist λ pip install example_pkg_YOUR_USERNAME_HERE-0.0.1-py3-none-any.whl --force-reinstall ..... Successfully installed example-pkg-YOUR-USERNAME-HERE-0.0.1 # Test that it work (pack_tut) G:\div_code\pack_tut\packaging_tutorial λ python Python 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from example_package import example >>> >>> example.add_one(2) 3 # Can now use somefile.dat here >>> example.add_one(int(example.number)) 43