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

Fix testing suite #4

Merged
merged 22 commits into from
Jan 10, 2023
Merged

Fix testing suite #4

merged 22 commits into from
Jan 10, 2023

Conversation

tsalo
Copy link
Member

@tsalo tsalo commented Feb 11, 2022

Closes #2.

Changes proposed in this pull request:

  • Add GitHub workflow that runs tests and linter.
  • Fix up tests.

To do

  • Add CI Action
  • Linting
  • Coverage

@tsalo
Copy link
Member Author

tsalo commented Feb 12, 2022

I'm getting the following error:

Run python -m pytest --pyargs bids/reports --cov=bids/reports
[2](https://github.com/bids-standard/pybids-reports/runs/5169084359?check_suite_focus=true#step:6:2)
  python -m pytest --pyargs bids/reports --cov=bids/reports
[3](https://github.com/bids-standard/pybids-reports/runs/5169084359?check_suite_focus=true#step:6:3)
  shell: /usr/bin/bash {0}
[4](https://github.com/bids-standard/pybids-reports/runs/5169084359?check_suite_focus=true#step:6:4)
  env:
[5](https://github.com/bids-standard/pybids-reports/runs/5169084359?check_suite_focus=true#step:6:5)
    pythonLocation: /opt/hostedtoolcache/Python/3.7.12/x[6](https://github.com/bids-standard/pybids-reports/runs/5169084359?check_suite_focus=true#step:6:6)4
6
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.7.12/x64/lib
[8](https://github.com/bids-standard/pybids-reports/runs/5169084359?check_suite_focus=true#step:6:8)
ImportError while loading conftest '/home/runner/work/pybids-reports/pybids-reports/bids/reports/tests/conftest.py'.
[9](https://github.com/bids-standard/pybids-reports/runs/5169084359?check_suite_focus=true#step:6:9)
bids/reports/__init__.py:2: in <module>
[10](https://github.com/bids-standard/pybids-reports/runs/5169084359?check_suite_focus=true#step:6:10)
    from . import _version, parameters, parsing, report
[11](https://github.com/bids-standard/pybids-reports/runs/5169084359?check_suite_focus=true#step:6:11)
bids/reports/parameters.py:10: in <module>
[12](https://github.com/bids-standard/pybids-reports/runs/5169084359?check_suite_focus=true#step:6:12)
    from bids.reports.utils import list_to_str, num_to_str, remove_duplicates
[13](https://github.com/bids-standard/pybids-reports/runs/5169084359?check_suite_focus=true#step:6:13)
E   ModuleNotFoundError: No module named 'bids.reports'
[14](https://github.com/bids-standard/pybids-reports/runs/5169084359?check_suite_focus=true#step:6:14)
Error: Process completed with exit code 4.

I installed my fork's pybids that doesn't include the reports module, so it shouldn't conflict with pybids-reports, and yet bids.reports doesn't exist. 😕

@tsalo
Copy link
Member Author

tsalo commented Feb 15, 2022

@effigies do you have any idea why the parent package wouldn't retain the namespace package when both are installed?

setup.cfg Outdated Show resolved Hide resolved
@effigies
Copy link
Contributor

So what I did above makes things work in full installations, but not in editable mode (pip install -e). To do that, we would need to add __path__ = __import__('pkgutil').extend_path(__path__, __name__) to bids/__init__.py in this package, which would override it in pybids, making things like bids.BIDSLayout cease to work.

We could move it to bids.ext.reports and bids.ext could be set aside so that we could make -e work. PyBIDS could have bids.reports from pybids.ext.reports import * (while warning) to provide an on-ramp.

@Remi-Gau Remi-Gau marked this pull request as ready for review January 10, 2023 20:59
@Remi-Gau Remi-Gau merged commit 7f18180 into main Jan 10, 2023
@codecov
Copy link

codecov bot commented Jan 10, 2023

Codecov Report

❗ No coverage uploaded for pull request base (main@a209b6c). Click here to learn what that means.
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##             main       #4   +/-   ##
=======================================
  Coverage        ?   74.49%           
=======================================
  Files           ?       11           
  Lines           ?      945           
  Branches        ?        0           
=======================================
  Hits            ?      704           
  Misses          ?      241           
  Partials        ?        0           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@sappelhoff sappelhoff deleted the more-work branch January 11, 2023 08:48
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.

Get CI working
3 participants