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

Remove legacy __init__.py code #64

Closed
mgkwill opened this issue Nov 16, 2021 · 1 comment · Fixed by #98
Closed

Remove legacy __init__.py code #64

mgkwill opened this issue Nov 16, 2021 · 1 comment · Fixed by #98
Assignees
Labels
0-needs-review For all new issues

Comments

@mgkwill
Copy link
Contributor

mgkwill commented Nov 16, 2021

There are multiple places across lava and lava libs codebase that include explicate Namespace packages.

Such as:

__import__("pkg_resources").declare_namespace(__name__)

and:
__import__("pkg_resources").declare_namespace(__name__)

and:
https://github.com/lava-nc/lava-optimization/blob/f7fce219b2b2978d210d9b5ffb5a8168967bf511/src/lava/__init__.py#L4-L8

However since python 3.3 Namespaces are defined implicitly:
PEP 420 -- Implicit Namespace Packages

This issue involves

  • Remove all legacy init.py code as defined in PEP 420
  • Test the resulting Namespace and Package function
  • If Namespace and Packages still function, open pull requests to remove legacy code
@mgkwill mgkwill added good first issue Good issue for newcomers to solve reviewed-approved labels Nov 16, 2021
@awintel
Copy link
Contributor

awintel commented Nov 16, 2021

Yes, I think this was initially done intentionally by @srrisbud because removing all legacy init.py files is a bad thing. Removing the init.py gives you implicit names spaces but you also have no more chance to write a custom init.py to e.g. simplify imports.
Perhaps there is another way that I'm not aware of.

@mgkwill mgkwill added 0-needs-review For all new issues question and removed good first issue Good issue for newcomers to solve reviewed-approved labels Nov 17, 2021
@awintel awintel added this to the Release v0.2.0 milestone Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0-needs-review For all new issues
Projects
None yet
3 participants