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 import error in metadata: fails on systems without pwd #2152

Merged
merged 1 commit into from
Dec 6, 2022

Conversation

kosack
Copy link
Contributor

@kosack kosack commented Dec 5, 2022

The standard library module pwd (password database access) doesn't exist on all systems (e.g. Windows or WASM), so don't rely on it. This just replaces the call to it with a default value if it is not there.

This feature was only used in ctapipe.core.metadata.Contact to get the user's name if they forgot to explicitly include it, so it should not break things if it fails (which it currently does).

@kosack kosack added the fix label Dec 5, 2022
@kosack kosack changed the title fix bug: metadata fails on systems without pwd fix import error in metadata: fails on systems without pwd Dec 5, 2022
@codecov
Copy link

codecov bot commented Dec 5, 2022

Codecov Report

Base: 92.77% // Head: 92.75% // Decreases project coverage by -0.02% ⚠️

Coverage data is based on head (33fe0ca) compared to base (4476511).
Patch coverage: 71.42% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2152      +/-   ##
==========================================
- Coverage   92.77%   92.75%   -0.03%     
==========================================
  Files         216      216              
  Lines       18045    18050       +5     
==========================================
+ Hits        16741    16742       +1     
- Misses       1304     1308       +4     
Impacted Files Coverage Δ
ctapipe/io/metadata.py 95.08% <71.42%> (-1.50%) ⬇️
ctapipe/instrument/camera/geometry.py 89.91% <0.00%> (-0.57%) ⬇️

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.

StFroese
StFroese previously approved these changes Dec 5, 2022
@maxnoe
Copy link
Member

maxnoe commented Dec 5, 2022

We need to merge #2150 first to fix the docs build

The standard library module `pwd` doesn't exist on all systems (e.g.
Windows or WASM), so don't rely on it. This just replaces the call to it
with a default value if it is not there.

This feature was only used to get the user's name if they forgot to
explicitly include it, so it should not break things if it fails (which
it currently does).
@maxnoe maxnoe merged commit a78b563 into master Dec 6, 2022
@maxnoe maxnoe deleted the fix/make_pwd_optional branch December 6, 2022 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants