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

add __init__.py file #240

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

add __init__.py file #240

wants to merge 2 commits into from

Conversation

Avery2
Copy link
Collaborator

@Avery2 Avery2 commented Oct 12, 2021

This just adds an empty __init__.py file in the mastml directory. This is because python needs it to treat the mastml directory as a package.

From the python docs1:

The __init__.py files are required to make Python treat directories containing the file as packages. This prevents directories with a common name, such as string, 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.

Without it you get the following linting error when running things locally:

from mastml.mastml import Mastml
# Import "mastml.mastml" could not be resolved Pylancereport(MissingImports)

Footnotes

  1. https://docs.python.org/3/tutorial/modules.html#packages

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.

1 participant