Мой setup.cfg:
[metadata]
name = dummy_job
description = Dummy Job library
long_description = file: README.md
url = https://github.com/mememe/jobs/dummy_job
classifiers =
Programming Language :: Python :: 3.6
[options]
zip_safe = False
packages = find:
python_requires = >=3.6
scripts =
app/entry_point/dummy_job.py
../../utils/spark_utils.py
[options.packages.find]
exclude =
tests*
[tool:pytest]
addopts =
-rA --verbose --color=yes --showlocals --durations=10 --doctest-modules
--cov=predictive_services_vectorization --cov-report=term
[tool:pylint]
disable = C1801,too-few-public-methods,too-many-arguments
max-line-length = 120
good-names = i,j,k,f,df,_,X,X_out,X_list,x,y
output-format = colorized
И моя структура проекта:
- проект
- работа
- dummy_job
- app
- entry_point
- __ init __. Py
- dummy_job.py
- include
- __ init __. Py
- dummy_class.py
- тесты
- entry_point
- __ init __. Py
- test_dummy_job.py
- include
- __ init __. Py
- test_dummy_class.py
- __ init __. Py
- __ init __. Py
- setup.cfg
- Pipfile
- Pipfile.lock
- setup.py
- utils
- __ init __. Py
- spark_utils.py
Проблема заключается в том, что при создании колеса с помощью команды:
VERSION = тестовый запуск pipenv python setup.py bdist_wheel * 10 85 *
Создает следующее колесо со структурой папок:
- app
- entry_point
- __ init __. Py
- dummy_job.py
- include
- __ init __. Py
- dummy_class.py
- tests
- entry_point
- __ init __. Py
- test_dummy_job.py
- include
- __ init __. py
- test_dummy_class.py
- __ init __. py
- __ init __. py
- dummy_job-test.data
- сценарии
- dummy_jobs.py
- spark_utils.py
- dummy_job-test.dist-info
- METADATA
- RECORD
- top_level.txt
- КОЛЕСО
Но проблема в том, что в моем классе у меня есть код:
from utils.spark_utils import get_spark_logger, get_spark_session, get_glue_context
from include.dummy_class import DummyClass
spark = get_spark_session()
rdd = get_glue_context().parrallelize([1, 2, 3, 4])
data = rdd.collect()
logger = get_spark_logger()
dummy_class = DummyClass(1)
logger.info("The list from the rdd is : {}".format(data))
Но проблема в том, что, глядя на колесо, оно не будет работать, потому что го Это не модуль с именем include. Правильный импорт будет:
form app.include.dummy_class import DummyClass
Для меня важно сохранить папку проекта как есть. Можно изменить файл setup.cfg, чтобы он генерировал колесо, пригодное для моего проекта? Как бы я это сделал?