Package installed from test.pypi.org is not the same folder structure as was uploaded to the repository

I created a package and uploaded it to test.pypi.org: https://test.pypi.org/project/name-generator-nicomp/0.0.2/

The logic reads a text file that I want to include in the package. In my initial design I put the text file in its’ own folder and my logic ran just fine on my local machine.

I installed the package from test.pypi.org onto a different computer using pip:

python3 -m pip install --index-url https://test.pypi.org/simple/ name-generator-nicomp --upgrade

Then, I run this script:

if __name__ == "__main__":
    from name_generator_nicomp.NameGenerator import NameGenerator
    nameGenerator = NameGenerator()

and it fails inside the package code on this line:

    with importlib.resources.open_text("src.data", self.noun_file) as my_file:

The error is:

ModuleNotFoundError: No module named 'src'

Looking in the .gz file created by the build script, the src folder is there and the data folder is inside it. The repo on test.pypi.org also has the folder structure in it. It can be downloaded and verified here: https://test.pypi.org/project/name-generator-nicomp/0.0.2/#files

However, when I look at the installation of the package on my local machine, all the files (code and data) are in one folder and there are no other folders at all.

My .toml file is

[project]
name = "name_generator_nicomp"
version = "0.0.2"
authors = [
  { name="xxx xxxxxx", email="xxx.com" },
]
description = "Some description."
readme = "README.md"
requires-python = ">=3.8"
classifiers = [
    "Programming Language :: Python :: 3",
    "License :: OSI Approved :: MIT License",
    "Operating System :: OS Independent",
]

[project.urls]
Homepage = "https://github.com/nicomp42/name_generator"
Issues = "https://github.com/nicomp42/name_generator/issues"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

The entire traceback is:

Traceback (most recent call last):
  File "C:Usersnicholdweclipse-workspacemyNameGeneratormainPackagemain.py", line 3, in <module>
    nameGenerator = NameGenerator()
  File "C:UsersnicholdwAppDataLocalPackagesPythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0LocalCachelocal-packagesPython310site-packagesname_generator_nicompNameGenerator.py", line 36, in __init__
    self.prepare()
  File "C:UsersnicholdwAppDataLocalPackagesPythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0LocalCachelocal-packagesPython310site-packagesname_generator_nicompNameGenerator.py", line 47, in prepare
    with importlib.resources.open_text("src.data", self.noun_file) as my_file:
  File "C:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0libimportlibresources.py", line 82, in open_text
    open_binary(package, resource), encoding=encoding, errors=errors
  File "C:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0libimportlibresources.py", line 43, in open_binary
    package = _common.get_package(package)
  File "C:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0libimportlib_common.py", line 66, in get_package
    resolved = resolve(package)
  File "C:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0libimportlib_common.py", line 57, in resolve
    return cand if isinstance(cand, types.ModuleType) else importlib.import_module(cand)
  File "C:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0libimportlib__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'src'

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật