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
[MAINT] using tox to test in different environments #4029
Conversation
👋 @Remi-Gau Thanks for creating a PR! Until this PR is ready for review, you can include the [WIP] tag in its title, or leave it as a github draft. Please make sure it is compliant with our contributing guidelines. In particular, be sure it checks the boxes listed below.
For new features:
For bug fixes:
We will review it as quick as possible, feel free to ping us with questions if needed. |
I would start by adding something in the maintenance docs and we can see if something would fit for the contributing or at least reference the new section for people who might be interested. Also document in the workflow readme |
Interesting. We are getting 3 tests to fail only on windows that never showed up before: https://github.com/nilearn/nilearn/actions/runs/6410072517/job/17402608737#step:5:15020
Error2023-10-04T19:08:23.8704389Z _____________________ test_load_surf_mesh_file_freesurfer _____________________ 2023-10-04T19:08:23.8704753Z 2023-10-04T19:08:23.8707805Z tmp_path = WindowsPath('C:/Users/runneradmin/AppData/Local/Temp/pytest-of-unknown/pytest-0/test_load_surf_mesh_file_frees0') 2023-10-04T19:08:23.8708545Z 2023-10-04T19:08:23.8708942Z def test_load_surf_mesh_file_freesurfer(tmp_path): 2023-10-04T19:08:23.8709428Z mesh = generate_surf() 2023-10-04T19:08:23.8710163Z for suff in ['.pial', '.inflated', '.white', '.orig', 'sphere']: 2023-10-04T19:08:23.8710794Z fd, filename_fs_mesh = tempfile.mkstemp(suffix=suff, 2023-10-04T19:08:23.8711294Z dir=str(tmp_path)) 2023-10-04T19:08:23.8711613Z os.close(fd) 2023-10-04T19:08:23.8712058Z > nb.freesurfer.write_geometry(filename_fs_mesh, mesh[0], mesh[1]) 2023-10-04T19:08:23.8712687Z 2023-10-04T19:08:23.8712814Z fd = 13 2023-10-04T19:08:23.8716108Z filename_fs_mesh = 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pytest-of-unknown\\pytest-0\\test_load_surf_mesh_file_frees0\\tmp04pd8un9.pial' 2023-10-04T19:08:23.8716969Z mesh = [array([[0.37454012, 0.95071431, 0.73199394], 2023-10-04T19:08:23.8717468Z [0.59865848, 0.15601864, 0.15599452], 2023-10-04T19:08:23.8717957Z [0.05808361, 0.86617615, 0.60111501], 2023-10-04T19:08:23.8718384Z [0.70807258, 0.02058449, 0.96990985], 2023-10-04T19:08:23.8718884Z [0.83244264, 0.21233911, 0.18182497], 2023-10-04T19:08:23.8719331Z [0.18340451, 0.30424224, 0.52475643], 2023-10-04T19:08:23.8719777Z [0.43194502, 0.29122914, 0.61185289], 2023-10-04T19:08:23.8720168Z [0.13949386, 0.29214465, 0.36636184], 2023-10-04T19:08:23.8720605Z [0.45606998, 0.78517596, 0.19967378], 2023-10-04T19:08:23.8721051Z [0.51423444, 0.59241457, 0.04645041], 2023-10-04T19:08:23.8721515Z [0.60754485, 0.17052412, 0.06505159], 2023-10-04T19:08:23.8721922Z [0.94888554, 0.96563203, 0.80839735], 2023-10-04T19:08:23.8722371Z [0.30461377, 0.09767211, 0.68423303], 2023-10-04T19:08:23.8722817Z [0.44015249, 0.12203823, 0.49517691], 2023-10-04T19:08:23.8723210Z [0.03438852, 0.9093204 , 0.25877998], 2023-10-04T19:08:23.8723662Z [0.66252228, 0.31171108, 0.52006802], 2023-10-04T19:08:23.8724109Z [0.54671028, 0.18485446, 0.96958463], 2023-10-04T19:08:23.8724556Z [0.77513282, 0.93949894, 0.89482735], 2023-10-04T19:08:23.8724946Z [0.59789998, 0.92187424, 0.0884925 ], 2023-10-04T19:08:23.8725421Z [0.19598286, 0.04522729, 0.32533033]]), 2023-10-04T19:08:23.8725883Z array([[15, 12, 17], 2023-10-04T19:08:23.8726316Z [14, 12, 8], 2023-10-04T19:08:23.8726685Z [14, 12, 0], 2023-10-04T19:08:23.8727093Z [ 6, 8, 0], 2023-10-04T19:08:23.8727503Z [11, 7, 10], 2023-10-04T19:08:23.8727861Z [18, 16, 7], 2023-10-04T19:08:23.8728280Z [ 2, 2, 0], 2023-10-04T19:08:23.8728684Z [ 4, 9, 6], 2023-10-04T19:08:23.8729081Z [ 8, 6, 8], 2023-10-04T19:08:23.8729460Z [ 7, 11, 1], 2023-10-04T19:08:23.8730136Z [ 0, 15, 4], 2023-10-04T19:08:23.8730603Z [ 2, 11, 7], 2023-10-04T19:08:23.8731012Z [ 2, 0, 2], 2023-10-04T19:08:23.8731413Z [ 4, 14, 13], 2023-10-04T19:08:23.8731773Z [ 2, 0, 4], 2023-10-04T19:08:23.8732172Z [13, 6, 8], 2023-10-04T19:08:23.8732567Z [14, 14, 9], 2023-10-04T19:08:23.8732917Z [12, 18, 6], 2023-10-04T19:08:23.8733330Z [16, 19, 3], 2023-10-04T19:08:23.8733745Z [ 4, 6, 12], 2023-10-04T19:08:23.8734146Z [14, 10, 3], 2023-10-04T19:08:23.8734504Z [12, 6, 18], 2023-10-04T19:08:23.8734913Z [ 1, 9, 12], 2023-10-04T19:08:23.8735323Z [ 5, 11, 11], 2023-10-04T19:08:23.8735677Z [19, 10, 6], 2023-10-04T19:08:23.8736077Z [ 0, 0, 19], 2023-10-04T19:08:23.8736486Z [12, 8, 2], 2023-10-04T19:08:23.8737152Z [ 6, 5, 7], 2023-10-04T19:08:23.8737502Z [ 8, 4, 0], 2023-10-04T19:08:23.8737912Z [18, 9, 11]])] 2023-10-04T19:08:23.8738535Z suff = '.pial' 2023-10-04T19:08:23.8739305Z tmp_path = WindowsPath('C:/Users/runneradmin/AppData/Local/Temp/pytest-of-unknown/pytest-0/test_load_surf_mesh_file_frees0') 2023-10-04T19:08:23.8739751Z 2023-10-04T19:08:23.8740015Z nilearn\surface\tests\test_surface.py:379: 2023-10-04T19:08:23.8740505Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 2023-10-04T19:08:23.8741179Z .tox\test_plotting\lib\site-packages\nibabel\freesurfer\io.py:228: in write_geometry 2023-10-04T19:08:23.8741810Z create_stamp = f'created by {getpass.getuser()} on {time.ctime()}' 2023-10-04T19:08:23.8742326Z coords = array([[0.37454012, 0.95071431, 0.73199394], 2023-10-04T19:08:23.8742744Z [0.59865848, 0.15601864, 0.15599452], 2023-10-04T19:08:23.8743328Z [0.05808361, 0.86617615, 0.60111501], 2023-10-04T19:08:23.8743710Z [0.70807258, 0.02058449, 0.96990985], 2023-10-04T19:08:23.8744133Z [0.83244264, 0.21233911, 0.18182497], 2023-10-04T19:08:23.8744482Z [0.18340451, 0.30424224, 0.52475643], 2023-10-04T19:08:23.8744869Z [0.43194502, 0.29122914, 0.61185289], 2023-10-04T19:08:23.8745261Z [0.13949386, 0.29214465, 0.36636184], 2023-10-04T19:08:23.8745605Z [0.45606998, 0.78517596, 0.19967378], 2023-10-04T19:08:23.8746247Z [0.51423444, 0.59241457, 0.04645041], 2023-10-04T19:08:23.8746755Z [0.60754485, 0.17052412, 0.06505159], 2023-10-04T19:08:23.8747172Z [0.94888554, 0.96563203, 0.80839735], 2023-10-04T19:08:23.8747536Z [0.30461377, 0.09767211, 0.68423303], 2023-10-04T19:08:23.8747952Z [0.44015249, 0.12203823, 0.49517691], 2023-10-04T19:08:23.8748357Z [0.03438852, 0.9093204 , 0.25877998], 2023-10-04T19:08:23.8748754Z [0.66252228, 0.31171108, 0.52006802], 2023-10-04T19:08:23.8749147Z [0.54671028, 0.18485446, 0.96958463], 2023-10-04T19:08:23.8749536Z [0.77513282, 0.93949894, 0.89482735], 2023-10-04T19:08:23.8749924Z [0.59789998, 0.92187424, 0.0884925 ], 2023-10-04T19:08:23.8750270Z [0.19598286, 0.04522729, 0.32533033]]) 2023-10-04T19:08:23.8750669Z create_stamp = None 2023-10-04T19:08:23.8751083Z faces = array([[15, 12, 17], 2023-10-04T19:08:23.8751525Z [14, 12, 8], 2023-10-04T19:08:23.8751843Z [14, 12, 0], 2023-10-04T19:08:23.8752197Z [ 6, 8, 0], 2023-10-04T19:08:23.8752559Z [11, 7, 10], 2023-10-04T19:08:23.8752864Z [18, 16, 7], 2023-10-04T19:08:23.8753216Z [ 2, 2, 0], 2023-10-04T19:08:23.8753578Z [ 4, 9, 6], 2023-10-04T19:08:23.8753921Z [ 8, 6, 8], 2023-10-04T19:08:23.8754188Z [ 7, 11, 1], 2023-10-04T19:08:23.8754495Z [ 0, 15, 4], 2023-10-04T19:08:23.8754747Z [ 2, 11, 7], 2023-10-04T19:08:23.8755017Z [ 2, 0, 2], 2023-10-04T19:08:23.8755277Z [ 4, 14, 13], 2023-10-04T19:08:23.8755495Z [ 2, 0, 4], 2023-10-04T19:08:23.8755748Z [13, 6, 8], 2023-10-04T19:08:23.8756005Z [14, 14, 9], 2023-10-04T19:08:23.8756227Z [12, 18, 6], 2023-10-04T19:08:23.8756507Z [16, 19, 3], 2023-10-04T19:08:23.8756815Z [ 4, 6, 12], 2023-10-04T19:08:23.8757038Z [14, 10, 3], 2023-10-04T19:08:23.8757293Z [12, 6, 18], 2023-10-04T19:08:23.8757545Z [ 1, 9, 12], 2023-10-04T19:08:23.8757764Z [ 5, 11, 11], 2023-10-04T19:08:23.8758090Z [19, 10, 6], 2023-10-04T19:08:23.8758356Z [ 0, 0, 19], 2023-10-04T19:08:23.8758567Z [12, 8, 2], 2023-10-04T19:08:23.8758826Z [ 6, 5, 7], 2023-10-04T19:08:23.8763319Z [ 8, 4, 0], 2023-10-04T19:08:23.8763622Z [18, 9, 11]]) 2023-10-04T19:08:23.8764382Z filepath = 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pytest-of-unknown\\pytest-0\\test_load_surf_mesh_file_frees0\\tmp04pd8un9.pial' 2023-10-04T19:08:23.8765226Z magic_bytes = array([255, 255, 254], dtype=uint8) 2023-10-04T19:08:23.8765565Z volume_info = None 2023-10-04T19:08:23.8765879Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 2023-10-04T19:08:23.8766116Z 2023-10-04T19:08:23.8766232Z def getuser(): 2023-10-04T19:08:23.8766613Z """Get the username from the environment or password database. 2023-10-04T19:08:23.8766912Z 2023-10-04T19:08:23.8767262Z First try various environment variables, then the password 2023-10-04T19:08:23.8767713Z database. This works on Windows as long as USERNAME is set. 2023-10-04T19:08:23.8768052Z 2023-10-04T19:08:23.8768248Z """ 2023-10-04T19:08:23.8768488Z 2023-10-04T19:08:23.8768903Z for name in ('LOGNAME', 'USER', 'LNAME', 'USERNAME'): 2023-10-04T19:08:23.8769233Z user = os.environ.get(name) 2023-10-04T19:08:23.8769703Z if user: 2023-10-04T19:08:23.8769992Z return user 2023-10-04T19:08:23.8770209Z 2023-10-04T19:08:23.8770532Z # If this fails, the exception will "explain" why 2023-10-04T19:08:23.8770869Z > import pwd 2023-10-04T19:08:23.8771251Z E ModuleNotFoundError: No module named 'pwd' 2023-10-04T19:08:23.8771486Z 2023-10-04T19:08:23.8771655Z name = 'USERNAME' 2023-10-04T19:08:23.8771935Z user = None 2023-10-04T19:08:23.8772332Z 2023-10-04T19:08:23.8772593Z C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\getpass.py:168: ModuleNotFoundError 2023-10-04T19:08:23.8773031Z _______________________ test_load_surf_mesh_file_error ________________________ 2023-10-04T19:08:23.8773257Z 2023-10-04T19:08:23.8773673Z tmp_path = WindowsPath('C:/Users/runneradmin/AppData/Local/Temp/pytest-of-unknown/pytest-0/test_load_surf_mesh_file_error0') 2023-10-04T19:08:23.8774009Z 2023-10-04T19:08:23.8774176Z def test_load_surf_mesh_file_error(tmp_path): 2023-10-04T19:08:23.8774541Z # test if files with unexpected suffixes raise errors 2023-10-04T19:08:23.8774909Z mesh = generate_surf() 2023-10-04T19:08:23.8775320Z wrong_suff = ['.vtk', '.obj', '.mnc', '.txt'] 2023-10-04T19:08:23.8775650Z for suff in wrong_suff: 2023-10-04T19:08:23.8775977Z fd, filename_wrong = tempfile.mkstemp(suffix=suff, 2023-10-04T19:08:23.8777678Z dir=str(tmp_path)) 2023-10-04T19:08:23.8778160Z os.close(fd) 2023-10-04T19:08:23.8778503Z > nb.freesurfer.write_geometry(filename_wrong, mesh[0], mesh[1]) 2023-10-04T19:08:23.8778764Z 2023-10-04T19:08:23.8778876Z fd = 13 2023-10-04T19:08:23.8779633Z filename_wrong = 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pytest-of-unknown\\pytest-0\\test_load_surf_mesh_file_error0\\tmpp3w9ksg8.vtk' 2023-10-04T19:08:23.8780191Z mesh = [array([[0.37454012, 0.95071431, 0.73199394], 2023-10-04T19:08:23.8780496Z [0.59865848, 0.15601864, 0.15599452], 2023-10-04T19:08:23.8780808Z [0.05808361, 0.86617615, 0.60111501], 2023-10-04T19:08:23.8781107Z [0.70807258, 0.02058449, 0.96990985], 2023-10-04T19:08:23.8781356Z [0.83244264, 0.21233911, 0.18182497], 2023-10-04T19:08:23.8781648Z [0.18340451, 0.30424224, 0.52475643], 2023-10-04T19:08:23.8782167Z [0.43194502, 0.29122914, 0.61185289], 2023-10-04T19:08:23.8782458Z [0.13949386, 0.29214465, 0.36636184], 2023-10-04T19:08:23.8782793Z [0.45606998, 0.78517596, 0.19967378], 2023-10-04T19:08:23.8783117Z [0.51423444, 0.59241457, 0.04645041], 2023-10-04T19:08:23.8783367Z [0.60754485, 0.17052412, 0.06505159], 2023-10-04T19:08:23.8783657Z [0.94888554, 0.96563203, 0.80839735], 2023-10-04T19:08:23.8783955Z [0.30461377, 0.09767211, 0.68423303], 2023-10-04T19:08:23.8788610Z [0.44015249, 0.12203823, 0.49517691], 2023-10-04T19:08:23.8788953Z [0.03438852, 0.9093204 , 0.25877998], 2023-10-04T19:08:23.8789269Z [0.66252228, 0.31171108, 0.52006802], 2023-10-04T19:08:23.8792600Z [0.54671028, 0.18485446, 0.96958463], 2023-10-04T19:08:23.8792963Z [0.77513282, 0.93949894, 0.89482735], 2023-10-04T19:08:23.8793261Z [0.59789998, 0.92187424, 0.0884925 ], 2023-10-04T19:08:23.8793559Z [0.19598286, 0.04522729, 0.32533033]]), 2023-10-04T19:08:23.8793814Z array([[15, 12, 17], 2023-10-04T19:08:23.8794085Z [14, 12, 8], 2023-10-04T19:08:23.8794348Z [14, 12, 0], 2023-10-04T19:08:23.8794646Z [ 6, 8, 0], 2023-10-04T19:08:23.8797572Z [11, 7, 10], 2023-10-04T19:08:23.8797869Z [18, 16, 7], 2023-10-04T19:08:23.8798093Z [ 2, 2, 0], 2023-10-04T19:08:23.8798350Z [ 4, 9, 6], 2023-10-04T19:08:23.8798608Z [ 8, 6, 8], 2023-10-04T19:08:23.8798831Z [ 7, 11, 1], 2023-10-04T19:08:23.8799090Z [ 0, 15, 4], 2023-10-04T19:08:23.8799353Z [ 2, 11, 7], 2023-10-04T19:08:23.8799572Z [ 2, 0, 2], 2023-10-04T19:08:23.8800037Z [ 4, 14, 13], 2023-10-04T19:08:23.8800316Z [ 2, 0, 4], 2023-10-04T19:08:23.8800533Z [13, 6, 8], 2023-10-04T19:08:23.8800786Z [14, 14, 9], 2023-10-04T19:08:23.8801131Z [12, 18, 6], 2023-10-04T19:08:23.8804208Z [16, 19, 3], 2023-10-04T19:08:23.8804553Z [ 4, 6, 12], 2023-10-04T19:08:23.8804813Z [14, 10, 3], 2023-10-04T19:08:23.8805079Z [12, 6, 18], 2023-10-04T19:08:23.8805290Z [ 1, 9, 12], 2023-10-04T19:08:23.8805555Z [ 5, 11, 11], 2023-10-04T19:08:23.8805823Z [19, 10, 6], 2023-10-04T19:08:23.8806036Z [ 0, 0, 19], 2023-10-04T19:08:23.8806285Z [12, 8, 2], 2023-10-04T19:08:23.8806538Z [ 6, 5, 7], 2023-10-04T19:08:23.8806952Z [ 8, 4, 0], 2023-10-04T19:08:23.8809835Z [18, 9, 11]])] 2023-10-04T19:08:23.8810255Z suff = '.vtk' 2023-10-04T19:08:23.8810816Z tmp_path = WindowsPath('C:/Users/runneradmin/AppData/Local/Temp/pytest-of-unknown/pytest-0/test_load_surf_mesh_file_error0') 2023-10-04T19:08:23.8811404Z wrong_suff = ['.vtk', '.obj', '.mnc', '.txt'] 2023-10-04T19:08:23.8811611Z 2023-10-04T19:08:23.8811784Z nilearn\surface\tests\test_surface.py:396: 2023-10-04T19:08:23.8812136Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 2023-10-04T19:08:23.8815456Z .tox\test_plotting\lib\site-packages\nibabel\freesurfer\io.py:228: in write_geometry 2023-10-04T19:08:23.8816113Z create_stamp = f'created by {getpass.getuser()} on {time.ctime()}' 2023-10-04T19:08:23.8816534Z coords = array([[0.37454012, 0.95071431, 0.73199394], 2023-10-04T19:08:23.8818484Z [0.59865848, 0.15601864, 0.15599452], 2023-10-04T19:08:23.8818845Z [0.05808361, 0.86617615, 0.60111501], 2023-10-04T19:08:23.8819146Z [0.70807258, 0.02058449, 0.96990985], 2023-10-04T19:08:23.8819397Z [0.83244264, 0.21233911, 0.18182497], 2023-10-04T19:08:23.8819693Z [0.18340451, 0.30424224, 0.52475643], 2023-10-04T19:08:23.8820006Z [0.43194502, 0.29122914, 0.61185289], 2023-10-04T19:08:23.8820255Z [0.13949386, 0.29214465, 0.36636184], 2023-10-04T19:08:23.8820772Z [0.45606998, 0.78517596, 0.19967378], 2023-10-04T19:08:23.8821075Z [0.51423444, 0.59241457, 0.04645041], 2023-10-04T19:08:23.8821369Z [0.60754485, 0.17052412, 0.06505159], 2023-10-04T19:08:23.8821615Z [0.94888554, 0.96563203, 0.80839735], 2023-10-04T19:08:23.8824569Z [0.30461377, 0.09767211, 0.68423303], 2023-10-04T19:08:23.8824953Z [0.44015249, 0.12203823, 0.49517691], 2023-10-04T19:08:23.8825209Z [0.03438852, 0.9093204 , 0.25877998], 2023-10-04T19:08:23.8825508Z [0.66252228, 0.31171108, 0.52006802], 2023-10-04T19:08:23.8825802Z [0.54671028, 0.18485446, 0.96958463], 2023-10-04T19:08:23.8826058Z [0.77513282, 0.93949894, 0.89482735], 2023-10-04T19:08:23.8826351Z [0.59789998, 0.92187424, 0.0884925 ], 2023-10-04T19:08:23.8826743Z [0.19598286, 0.04522729, 0.32533033]]) 2023-10-04T19:08:23.8828176Z create_stamp = None 2023-10-04T19:08:23.8829354Z faces = array([[15, 12, 17], 2023-10-04T19:08:23.8829671Z [14, 12, 8], 2023-10-04T19:08:23.8829901Z [14, 12, 0], 2023-10-04T19:08:23.8830163Z [ 6, 8, 0], 2023-10-04T19:08:23.8830425Z [11, 7, 10], 2023-10-04T19:08:23.8830683Z [18, 16, 7], 2023-10-04T19:08:23.8831816Z [ 2, 2, 0], 2023-10-04T19:08:23.8832221Z [ 4, 9, 6], 2023-10-04T19:08:23.8832694Z [ 8, 6, 8], 2023-10-04T19:08:23.8832928Z [ 7, 11, 1], 2023-10-04T19:08:23.8833191Z [ 0, 15, 4], 2023-10-04T19:08:23.8833467Z [ 2, 11, 7], 2023-10-04T19:08:23.8833837Z [ 2, 0, 2], 2023-10-04T19:08:23.8834461Z [ 4, 14, 13], 2023-10-04T19:08:23.8835703Z [ 2, 0, 4], 2023-10-04T19:08:23.8835993Z [13, 6, 8], 2023-10-04T19:08:23.8836254Z [14, 14, 9], 2023-10-04T19:08:23.8839362Z [12, 18, 6], 2023-10-04T19:08:23.8839606Z [16, 19, 3], 2023-10-04T19:08:23.8839867Z [ 4, 6, 12], 2023-10-04T19:08:23.8840115Z [14, 10, 3], 2023-10-04T19:08:23.8840328Z [12, 6, 18], 2023-10-04T19:08:23.8840592Z [ 1, 9, 12], 2023-10-04T19:08:23.8840916Z [ 5, 11, 11], 2023-10-04T19:08:23.8841133Z [19, 10, 6], 2023-10-04T19:08:23.8841386Z [ 0, 0, 19], 2023-10-04T19:08:23.8841640Z [12, 8, 2], 2023-10-04T19:08:23.8841847Z [ 6, 5, 7], 2023-10-04T19:08:23.8842099Z [ 8, 4, 0], 2023-10-04T19:08:23.8842357Z [18, 9, 11]]) 2023-10-04T19:08:23.8843053Z filepath = 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pytest-of-unknown\\pytest-0\\test_load_surf_mesh_file_error0\\tmpp3w9ksg8.vtk' 2023-10-04T19:08:23.8843619Z magic_bytes = array([255, 255, 254], dtype=uint8) 2023-10-04T19:08:23.8843956Z volume_info = None 2023-10-04T19:08:23.8844311Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 2023-10-04T19:08:23.8844513Z 2023-10-04T19:08:23.8844629Z def getuser(): 2023-10-04T19:08:23.8844999Z """Get the username from the environment or password database. 2023-10-04T19:08:23.8845340Z 2023-10-04T19:08:23.8845645Z First try various environment variables, then the password 2023-10-04T19:08:23.8846085Z database. This works on Windows as long as USERNAME is set. 2023-10-04T19:08:23.8846414Z 2023-10-04T19:08:23.8846606Z """ 2023-10-04T19:08:23.8846842Z 2023-10-04T19:08:23.8847235Z for name in ('LOGNAME', 'USER', 'LNAME', 'USERNAME'): 2023-10-04T19:08:23.8847556Z user = os.environ.get(name) 2023-10-04T19:08:23.8847856Z if user: 2023-10-04T19:08:23.8848126Z return user 2023-10-04T19:08:23.8848346Z 2023-10-04T19:08:23.8848669Z # If this fails, the exception will "explain" why 2023-10-04T19:08:23.8849017Z > import pwd 2023-10-04T19:08:23.8849396Z E ModuleNotFoundError: No module named 'pwd' 2023-10-04T19:08:23.8849635Z 2023-10-04T19:08:23.8849799Z name = 'USERNAME' 2023-10-04T19:08:23.8850065Z user = None 2023-10-04T19:08:23.8850227Z 2023-10-04T19:08:23.8850485Z C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\getpass.py:168: ModuleNotFoundError 2023-10-04T19:08:23.8850905Z ________________________ test_load_surf_mesh_file_glob ________________________ 2023-10-04T19:08:23.8851132Z 2023-10-04T19:08:23.8851570Z tmp_path = WindowsPath('C:/Users/runneradmin/AppData/Local/Temp/pytest-of-unknown/pytest-0/test_load_surf_mesh_file_glob0') 2023-10-04T19:08:23.8852371Z 2023-10-04T19:08:23.8852551Z def test_load_surf_mesh_file_glob(tmp_path): 2023-10-04T19:08:23.8852889Z mesh = generate_surf() 2023-10-04T19:08:23.8853297Z fd1, fname1 = tempfile.mkstemp(suffix='.pial', 2023-10-04T19:08:23.8853667Z dir=str(tmp_path)) 2023-10-04T19:08:23.8853959Z os.close(fd1) 2023-10-04T19:08:23.8854285Z > nb.freesurfer.write_geometry(fname1, mesh[0], mesh[1]) 2023-10-04T19:08:23.8854733Z 2023-10-04T19:08:23.8854834Z fd1 = 13 2023-10-04T19:08:23.8855471Z fname1 = 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pytest-of-unknown\\pytest-0\\test_load_surf_mesh_file_glob0\\tmphd2zvwad.pial' 2023-10-04T19:08:23.8856011Z mesh = [array([[0.37454012, 0.95071431, 0.73199394], 2023-10-04T19:08:23.8856287Z [0.59865848, 0.15601864, 0.15599452], 2023-10-04T19:08:23.8856582Z [0.05808361, 0.86617615, 0.60111501], 2023-10-04T19:08:23.8856879Z [0.70807258, 0.02058449, 0.96990985], 2023-10-04T19:08:23.8857124Z [0.83244264, 0.21233911, 0.18182497], 2023-10-04T19:08:23.8857413Z [0.18340451, 0.30424224, 0.52475643], 2023-10-04T19:08:23.8857692Z [0.43194502, 0.29122914, 0.61185289], 2023-10-04T19:08:23.8857935Z [0.13949386, 0.29214465, 0.36636184], 2023-10-04T19:08:23.8858221Z [0.45606998, 0.78517596, 0.19967378], 2023-10-04T19:08:23.8858627Z [0.51423444, 0.59241457, 0.04645041], 2023-10-04T19:08:23.8858873Z [0.60754485, 0.17052412, 0.06505159], 2023-10-04T19:08:23.8859155Z [0.94888554, 0.96563203, 0.80839735], 2023-10-04T19:08:23.8859439Z [0.30461377, 0.09767211, 0.68423303], 2023-10-04T19:08:23.8859725Z [0.44015249, 0.12203823, 0.49517691], 2023-10-04T19:08:23.8859964Z [0.03438852, 0.9093204 , 0.25877998], 2023-10-04T19:08:23.8860249Z [0.66252228, 0.31171108, 0.52006802], 2023-10-04T19:08:23.8860526Z [0.54671028, 0.18485446, 0.96958463], 2023-10-04T19:08:23.8860767Z [0.77513282, 0.93949894, 0.89482735], 2023-10-04T19:08:23.8861055Z [0.59789998, 0.92187424, 0.0884925 ], 2023-10-04T19:08:23.8861343Z [0.19598286, 0.04522729, 0.32533033]]), 2023-10-04T19:08:23.8861596Z array([[15, 12, 17], 2023-10-04T19:08:23.8861870Z [14, 12, 8], 2023-10-04T19:08:23.8862130Z [14, 12, 0], 2023-10-04T19:08:23.8862354Z [ 6, 8, 0], 2023-10-04T19:08:23.8862614Z [11, 7, 10], 2023-10-04T19:08:23.8862868Z [18, 16, 7], 2023-10-04T19:08:23.8863078Z [ 2, 2, 0], 2023-10-04T19:08:23.8863326Z [ 4, 9, 6], 2023-10-04T19:08:23.8863574Z [ 8, 6, 8], 2023-10-04T19:08:23.8863786Z [ 7, 11, 1], 2023-10-04T19:08:23.8864037Z [ 0, 15, 4], 2023-10-04T19:08:23.8864289Z [ 2, 11, 7], 2023-10-04T19:08:23.8864497Z [ 2, 0, 2], 2023-10-04T19:08:23.8864744Z [ 4, 14, 13], 2023-10-04T19:08:23.8865000Z [ 2, 0, 4], 2023-10-04T19:08:23.8865210Z [13, 6, 8], 2023-10-04T19:08:23.8865461Z [14, 14, 9], 2023-10-04T19:08:23.8865706Z [12, 18, 6], 2023-10-04T19:08:23.8865913Z [16, 19, 3], 2023-10-04T19:08:23.8866170Z [ 4, 6, 12], 2023-10-04T19:08:23.8866421Z [14, 10, 3], 2023-10-04T19:08:23.8866668Z [12, 6, 18], 2023-10-04T19:08:23.8866878Z [ 1, 9, 12], 2023-10-04T19:08:23.8867133Z [ 5, 11, 11], 2023-10-04T19:08:23.8867398Z [19, 10, 6], 2023-10-04T19:08:23.8867617Z [ 0, 0, 19], 2023-10-04T19:08:23.8867870Z [12, 8, 2], 2023-10-04T19:08:23.8868119Z [ 6, 5, 7], 2023-10-04T19:08:23.8868331Z [ 8, 4, 0], 2023-10-04T19:08:23.8868584Z [18, 9, 11]])] 2023-10-04T19:08:23.8869171Z tmp_path = WindowsPath('C:/Users/runneradmin/AppData/Local/Temp/pytest-of-unknown/pytest-0/test_load_surf_mesh_file_glob0') 2023-10-04T19:08:23.8869506Z 2023-10-04T19:08:23.8869634Z nilearn\surface\tests\test_surface.py:409: 2023-10-04T19:08:23.8870022Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 2023-10-04T19:08:23.8870590Z .tox\test_plotting\lib\site-packages\nibabel\freesurfer\io.py:228: in write_geometry 2023-10-04T19:08:23.8871113Z create_stamp = f'created by {getpass.getuser()} on {time.ctime()}' 2023-10-04T19:08:23.8871522Z coords = array([[0.37454012, 0.95071431, 0.73199394], 2023-10-04T19:08:23.8871854Z [0.59865848, 0.15601864, 0.15599452], 2023-10-04T19:08:23.8872267Z [0.05808361, 0.86617615, 0.60111501], 2023-10-04T19:08:23.8872524Z [0.70807258, 0.02058449, 0.96990985], 2023-10-04T19:08:23.8872816Z [0.83244264, 0.21233911, 0.18182497], 2023-10-04T19:08:23.8873104Z [0.18340451, 0.30424224, 0.52475643], 2023-10-04T19:08:23.8873348Z [0.43194502, 0.29122914, 0.61185289], 2023-10-04T19:08:23.8873634Z [0.13949386, 0.29214465, 0.36636184], 2023-10-04T19:08:23.8873919Z [0.45606998, 0.78517596, 0.19967378], 2023-10-04T19:08:23.8874170Z [0.51423444, 0.59241457, 0.04645041], 2023-10-04T19:08:23.8874455Z [0.60754485, 0.17052412, 0.06505159], 2023-10-04T19:08:23.8874750Z [0.94888554, 0.96563203, 0.80839735], 2023-10-04T19:08:23.8875050Z [0.30461377, 0.09767211, 0.68423303], 2023-10-04T19:08:23.8875293Z [0.44015249, 0.12203823, 0.49517691], 2023-10-04T19:08:23.8875581Z [0.03438852, 0.9093204 , 0.25877998], 2023-10-04T19:08:23.8875973Z [0.66252228, 0.31171108, 0.52006802], 2023-10-04T19:08:23.8876224Z [0.54671028, 0.18485446, 0.96958463], 2023-10-04T19:08:23.8876511Z [0.77513282, 0.93949894, 0.89482735], 2023-10-04T19:08:23.8876811Z [0.59789998, 0.92187424, 0.0884925 ], 2023-10-04T19:08:23.8877059Z [0.19598286, 0.04522729, 0.32533033]]) 2023-10-04T19:08:23.8877361Z create_stamp = None 2023-10-04T19:08:23.8877674Z faces = array([[15, 12, 17], 2023-10-04T19:08:23.8877919Z [14, 12, 8], 2023-10-04T19:08:23.8878183Z [14, 12, 0], 2023-10-04T19:08:23.8878440Z [ 6, 8, 0], 2023-10-04T19:08:23.8878651Z [11, 7, 10], 2023-10-04T19:08:23.8878901Z [18, 16, 7], 2023-10-04T19:08:23.8879160Z [ 2, 2, 0], 2023-10-04T19:08:23.8879377Z [ 4, 9, 6], 2023-10-04T19:08:23.8879630Z [ 8, 6, 8], 2023-10-04T19:08:23.8879889Z [ 7, 11, 1], 2023-10-04T19:08:23.8880107Z [ 0, 15, 4], 2023-10-04T19:08:23.8880365Z [ 2, 11, 7], 2023-10-04T19:08:23.8880630Z [ 2, 0, 2], 2023-10-04T19:08:23.8880845Z [ 4, 14, 13], 2023-10-04T19:08:23.8881097Z [ 2, 0, 4], 2023-10-04T19:08:23.8881358Z [13, 6, 8], 2023-10-04T19:08:23.8881569Z [14, 14, 9], 2023-10-04T19:08:23.8881831Z [12, 18, 6], 2023-10-04T19:08:23.8882086Z [16, 19, 3], 2023-10-04T19:08:23.8882349Z [ 4, 6, 12], 2023-10-04T19:08:23.8882565Z [14, 10, 3], 2023-10-04T19:08:23.8882820Z [12, 6, 18], 2023-10-04T19:08:23.8883083Z [ 1, 9, 12], 2023-10-04T19:08:23.8883292Z [ 5, 11, 11], 2023-10-04T19:08:23.8883550Z [19, 10, 6], 2023-10-04T19:08:23.8883803Z [ 0, 0, 19], 2023-10-04T19:08:23.8884011Z [12, 8, 2], 2023-10-04T19:08:23.8884267Z [ 6, 5, 7], 2023-10-04T19:08:23.8884515Z [ 8, 4, 0], 2023-10-04T19:08:23.8884728Z [18, 9, 11]]) 2023-10-04T19:08:23.8885407Z filepath = 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pytest-of-unknown\\pytest-0\\test_load_surf_mesh_file_glob0\\tmphd2zvwad.pial' 2023-10-04T19:08:23.8885978Z magic_bytes = array([255, 255, 254], dtype=uint8) 2023-10-04T19:08:23.8886269Z volume_info = None 2023-10-04T19:08:23.8886622Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 2023-10-04T19:08:23.8886848Z 2023-10-04T19:08:23.8886962Z def getuser(): 2023-10-04T19:08:23.8887290Z """Get the username from the environment or password database. 2023-10-04T19:08:23.8887624Z 2023-10-04T19:08:23.8887972Z First try various environment variables, then the password 2023-10-04T19:08:23.8888419Z database. This works on Windows as long as USERNAME is set. 2023-10-04T19:08:23.8888709Z 2023-10-04T19:08:23.8888947Z """ 2023-10-04T19:08:23.8889189Z 2023-10-04T19:08:23.8889548Z for name in ('LOGNAME', 'USER', 'LNAME', 'USERNAME'): 2023-10-04T19:08:23.8889913Z user = os.environ.get(name) 2023-10-04T19:08:23.8890356Z if user: 2023-10-04T19:08:23.8890596Z return user 2023-10-04T19:08:23.8890856Z 2023-10-04T19:08:23.8891178Z # If this fails, the exception will "explain" why 2023-10-04T19:08:23.8891470Z > import pwd 2023-10-04T19:08:23.8891881Z E ModuleNotFoundError: No module named 'pwd' 2023-10-04T19:08:23.8892110Z 2023-10-04T19:08:23.8892271Z name = 'USERNAME' 2023-10-04T19:08:23.8892496Z user = None 2023-10-04T19:08:23.8892656Z 2023-10-04T19:08:23.8892916Z C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\getpass.py:168: ModuleNotFoundError |
Co-authored-by: Yasmin <63292494+ymzayek@users.noreply.github.com>
TODOmake sure coverage is uploaded current status:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4029 +/- ##
==========================================
+ Coverage 91.69% 91.80% +0.11%
==========================================
Files 144 144
Lines 16150 16152 +2
Branches 3359 3359
==========================================
+ Hits 14809 14829 +20
+ Misses 796 781 -15
+ Partials 545 542 -3 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Progress but not success
|
Now there are 2 checks results for codecov/patch and 2 for codecov/project. I see that the Details link for each respectively bring you either to github checks or directly to codecov but why not just link to one? I personally prefer the github checks for the quick summary and then from there you can easily open up codecov. |
this is new I have never seen this before |
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.
LGTM, thx !
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.
Other than the codecov comment this PR looks good to me!
Perhaps we should merge this and check this #4029 (comment) separately? |
Will fix the merge conflict. I have not had the time to figure out where this double coverage report is coming from. But definitely OK delegating that to a follow up PR. |
So far am seeing only one codecov report but the windows testing are hanging again. Need to check that I did not mess up which kaleido version is installed. |
Since this set up is not using pyproject.toml we'd need to add the new specification per os to tox. Seems like syntax is pretty luch the same: https://tox.wiki/en/3.24.5/config.html#conf-deps |
Ok will update the changelog and I think this should rlbe ready to go in. |
@@ -30,4 +30,5 @@ Changes | |||
------- | |||
|
|||
- :bdg-success:`API` Expose scipy CubicSpline ``extrapolate`` parameter in :func:`~signal.clean` to control the interpolation of censored volumes in both ends of the BOLD signal data (:gh:`4028` by `Jordi Huguet`_). | |||
- :bdg-success:`API` Switch to using tox to manage environments during development and testing. All plotting python dependencies (matplotlib AND plotly) are now installed when running ``pip install nilearn[plotting]`` (:gh:`4029` by `Rémi Gau`_). |
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.
filing this under API... but not sure this is the best
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.
why not :bdg-secondary:`Maint` ?
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.
oh dear...
because I had forgotten we had it: fixed now
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.
Did you push the fix?
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.
I thought I had...
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.
I guess this way we can test the whole tox thing on a PR...
#4114
ok merging then |
Changes proposed in this pull request:
TODO