-
Notifications
You must be signed in to change notification settings - Fork 2
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
FIX: Namespace packaging #42
Conversation
for more information, see https://pre-commit.ci
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #42 +/- ##
==========================================
+ Coverage 84.80% 87.21% +2.41%
==========================================
Files 14 14
Lines 704 704
==========================================
+ Hits 597 614 +17
+ Misses 107 90 -17
☔ View full report in Codecov by Sentry. |
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.4.1 | ||
hooks: | ||
- id: mypy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My guess is this previously worked by accident. Here's what you get now:
$ mypy --explicit-package-bases bids/ext/reports
bids/ext/reports/templates/demos/python/demo.py:5: error: Module "bids" has no attribute "BIDSLayout" [attr-defined]
bids/ext/reports/templates/demos/python/demo.py:10: error: Function is missing a return type annotation [no-untyped-def]
bids/ext/reports/templates/demos/python/demo.py:14: error: Function is missing a type annotation [no-untyped-def]
bids/ext/reports/templates/demos/python/demo.py:21: error: Function is missing a type annotation [no-untyped-def]
bids/ext/reports/templates/demos/python/demo.py:39: error: Function is missing a return type annotation [no-untyped-def]
bids/ext/reports/templates/demos/python/demo.py:39: note: Use "-> None" if function does not return a value
bids/ext/reports/utils.py:11: error: Cannot find implementation or library stub for module named "bids.layout" [import]
bids/ext/reports/parameters.py:9: error: Cannot find implementation or library stub for module named "num2words" [import]
bids/ext/reports/parameters.py:15: error: Cannot find implementation or library stub for module named "bids.layout" [import]
bids/ext/reports/parameters.py:56: error: Argument 1 to "append" of "list" has incompatible type "None"; expected "int" [arg-type]
bids/ext/reports/parameters.py:71: error: Argument 1 to "get_nb_vols" has incompatible type "List[Nifti1Image]"; expected "List[Optional[Nifti1Image]]" [arg-type]
bids/ext/reports/parameters.py:71: note: "List" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance
bids/ext/reports/parameters.py:71: note: Consider using "Sequence" instead, which is covariant
bids/ext/reports/parameters.py:80: error: Argument 1 to "get_nb_vols" has incompatible type "List[Nifti1Image]"; expected "List[Optional[Nifti1Image]]" [arg-type]
bids/ext/reports/parameters.py:80: note: "List" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance
bids/ext/reports/parameters.py:80: note: Consider using "Sequence" instead, which is covariant
bids/ext/reports/parsing.py:14: error: Cannot find implementation or library stub for module named "bids.layout" [import]
bids/ext/reports/parsing.py:107: error: Module has no attribute "func_info" [attr-defined]
bids/ext/reports/parsing.py:143: error: Module has no attribute "anat_info" [attr-defined]
bids/ext/reports/parsing.py:174: error: Incompatible types in assignment (expression has type "int", variable has type "str") [assignment]
bids/ext/reports/parsing.py:185: error: Module has no attribute "dwi_info" [attr-defined]
bids/ext/reports/parsing.py:228: error: Module has no attribute "fmap_info" [attr-defined]
bids/ext/reports/parsing.py:253: error: Module has no attribute "meg_info" [attr-defined]
bids/ext/reports/parsing.py:362: error: Incompatible return value type (got "Optional[FileBasedImage]", expected "Optional[Nifti1Image]") [return-value]
bids/ext/reports/report.py:14: error: Cannot find implementation or library stub for module named "bids.layout" [import]
bids/ext/reports/cli.py:15: error: Cannot find implementation or library stub for module named "bids.layout" [import]
bids/ext/reports/cli.py:15: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
Found 21 errors in 6 files (checked 10 source files)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be re-added later, but fixing these issues feels out-of-scope for this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
totally outside of the scope indeed
@effigies will look more in detail so that I better understand what I messed up. |
packages = ["bids"] | ||
only-include = ["bids/ext/reports"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For your reference, this was the main issue: https://hatch.pypa.io/latest/config/build/#explicit-selection
Everything else just followed from fixing tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks again
Fixes #40.