Skip to content

Conversation

@ppinchuk
Copy link
Collaborator

@ppinchuk ppinchuk commented Jun 2, 2025

Per the documentation of getpass.getuser, the call will throw an OSError on systems without access to the pwd module. This means importing rex can fail completely since we have a getpass.getuser call on import. In this PR, we delay the call to getpass.getuser until an HPC class instance is being created, allowing rex itself to be imported and used on systems missing pwd.

@ppinchuk ppinchuk self-assigned this Jun 2, 2025
@ppinchuk ppinchuk added bugfix Fixes a bug p-medium Priority: medium labels Jun 2, 2025
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 67.85%. Comparing base (f9b0674) to head (471b1e9).

Files with missing lines Patch % Lines
rex/utilities/hpc.py 33.33% 2 Missing ⚠️

❌ Your patch status has failed because the patch coverage (33.33%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #221      +/-   ##
==========================================
+ Coverage   67.83%   67.85%   +0.01%     
==========================================
  Files          40       40              
  Lines        7114     7111       -3     
  Branches     1044     1043       -1     
==========================================
- Hits         4826     4825       -1     
+ Misses       1959     1958       -1     
+ Partials      329      328       -1     
Flag Coverage Δ
unittests 67.85% <33.33%> (+0.01%) ⬆️

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

Files with missing lines Coverage Δ
rex/utilities/hpc.py 48.91% <33.33%> (+0.16%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ppinchuk ppinchuk merged commit 65ca4a9 into main Jun 2, 2025
19 checks passed
@ppinchuk ppinchuk deleted the pp/guard_getpass branch June 2, 2025 01:43
github-actions bot pushed a commit that referenced this pull request Jun 2, 2025
github-actions bot pushed a commit to MRE-Code-Hub/rex that referenced this pull request Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fixes a bug p-medium Priority: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants