Skip to content

Conversation

@gordonwatts
Copy link
Collaborator

@gordonwatts gordonwatts commented Nov 1, 2025

Summary

  • annotate expand_cache_path to clarify the return type and rely solely on getpass.getuser() when expanding ${USER}
  • update configuration tests to patch getpass.getuser and verify environment variables no longer override the cache directory

Testing

  • black --check .
  • flake8
  • pytest

Fixes #612


https://chatgpt.com/codex/tasks/task_e_690617acf3108320a0c84e51616bff26

@codecov
Copy link

codecov bot commented Nov 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.17%. Comparing base (fcc1909) to head (5faa2cd).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #679   +/-   ##
=======================================
  Coverage   98.17%   98.17%           
=======================================
  Files          29       29           
  Lines        2081     2082    +1     
=======================================
+ Hits         2043     2044    +1     
  Misses         38       38           
Flag Coverage Δ
unittests 98.17% <100.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gordonwatts gordonwatts requested a review from ponyisi November 1, 2025 17:46
try:
username = getuser()
except Exception: # pragma: no cover - getpass failures are unexpected
username = ""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still, possibly dangerous depending on how the path is being specified (e.g. if this is a /${USER}/ specification the directory level will be one too high). Could the default be UnknownUser or something?

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.

Google Colab & docker do not have the env variable User defined

3 participants