So, at the moment I have a python application from which I want to create a package using setup.py. One of the python modules (main.py below) has a hardcoded (relative) path to a configurations file. One of the configurations in this file is also a path to a directory which contains modules that are being started as subprocesses (module_A.py, module_B.py).
So, the initial python module reads the configurations file to get the path to some other python modules which then spins up as subprocesses.
Is it possible to somehow maintain the same structure when packaging the application via setup.py? How do I define the configurations file in the setup.py and how do I reference modules which in the end are stored in the site-packages target directory?
base_dir
|-- main.py
|-- configurations_dir
|-- conf_file
|-- modules_dir
|-- __init__.py
|-- module_A.py
|-- module_B.py
|-- setup.py
setup.py
from setuptools import setup, find_packages
import sys,os
setup(
name = 'telemetry-brain',
version = '1.0.0',
description = 'Send telemetry data to Azure IoT Hub',
license='GPL v3',
author = 'Eltjon Sulaj',
packages = find_packages(),
install_requires=[],
entry_points = {
'console_scripts': [
'telemetry-brain.sendtel=busmodules.monitor:main']
},
classifiers = [
'Programming Language :: Python :: 3.8',
'Operating System :: OS Independent',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)']
)