Я создал тестовый пакет. Мне нужно прочитать файл, который я добавил в пакет сайта (words.txt
). Я не понимаю, как открыть этот файл ... Я устанавливаю этот пакет с помощью python setup sdist bdist_wheel
, а затем pip install .
* 1005. *
package/
example/
__init__.py
words.txt
setup.py
LICENSE
README.md
MANIFEST.in
Setup.py
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="example",
version="0.0.1",
author="Martin Bouhier",
author_email="martinbouhier@outlook.com",
description="scorecards modules",
long_description=long_description,
long_description_content_type="text/markdown",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3"
],
python_requires='>=3.6',
include_package_data=True,
)
MANIFEST.in
include example/words.txt