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

allow _module_ to define custom import path #588

Merged
merged 1 commit into from
Apr 12, 2023
Merged

Conversation

PythonFZ
Copy link
Member

Allow

class CustomModule(zntrack.Node):
    _module_ = "zntrack.nodes"

to define the __module__ to import from, altough the Node might be defined somewhere else.
This is useful if:

  • your package has a lot of Nodes in differente modules, to organize them
  • you want to be able to rename the modules
  • you have one import for all nodes package.nodes.<my_node>

@codecov
Copy link

codecov bot commented Apr 12, 2023

Codecov Report

Merging #588 (d6bc474) into main (cd93360) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #588      +/-   ##
==========================================
+ Coverage   89.36%   89.37%   +0.01%     
==========================================
  Files          20       20              
  Lines        1457     1459       +2     
  Branches      565      567       +2     
==========================================
+ Hits         1302     1304       +2     
  Misses        155      155              
Flag Coverage Δ
fulltest 89.37% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
zntrack/utils/__init__.py 81.52% <100.00%> (+0.41%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@PythonFZ PythonFZ merged commit 55ff9cc into main Apr 12, 2023
11 checks passed
@PythonFZ PythonFZ deleted the module_override branch April 12, 2023 16:19
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.

None yet

1 participant