Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make models and family modules to allow importing them into other python projects #46

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lukovdm
Copy link

@lukovdm lukovdm commented Oct 3, 2024

I want to use Paynt as part of some other project, and thus call the Paynt library. In order for this to be possible, the models and family folders should be modules.

@randriu
Copy link
Owner

randriu commented Nov 13, 2024

What does this achieve exactly? We often import Paynt or its modules into other projects without declaring them as packages. Is it even necessary in Python 3?

@linusheck
Copy link

This was also necessary to get PAYNT work as a library for me. For explanation see: https://docs.python.org/3/tutorial/modules.html

The init.py files are required to make Python treat directories containing the file as packages (unless using a namespace package, a relatively advanced feature). This prevents directories with a common name, such as string, from unintentionally hiding valid modules that occur later on the module search path. In the simplest case, init.py can just be an empty file, but it can also execute initialization code for the package or set the all variable, described later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants