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 empty-string LEGEND_METADATA env var #80

Merged
merged 1 commit into from
Feb 1, 2025

Conversation

ManuelHu
Copy link
Contributor

it is quite common to use ENV_VAR= command --args ... for this to unset an env var for a command

until now (in stable versions), pylegendmeta did try to use the current directory as a metadata repo.

  • if ${CWD} was a git repo, it probably just failed later on, when something else does not find the right data.
  • if ${CWD} was not a git repo, it fails right away with
    git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
      cmdline: git clone -v --recurse-submodules -- [email protected]:legend-exp/legend-metadata 
      stderr: 'fatal: could not create work tree dir '': No such file or directory
    

with the changes from #75. this might have bad consequences on unrelated git repos, as now legendmeta does try to check out tags in the git repo.

The solution implemented here treats an empty path as if None had been passed. The other option would be to throw an exception if an empty path is provided.

Copy link

codecov bot commented Jan 31, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 57.81%. Comparing base (c248ade) to head (777d344).
Report is 14 commits behind head on main.

Files with missing lines Patch % Lines
src/legendmeta/core.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main      #80       +/-   ##
===========================================
- Coverage   72.02%   57.81%   -14.21%     
===========================================
  Files           8        8               
  Lines         840      486      -354     
===========================================
- Hits          605      281      -324     
+ Misses        235      205       -30     

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

@gipert gipert merged commit e8973ba into legend-exp:main Feb 1, 2025
15 checks passed
@ManuelHu ManuelHu deleted the patch-1 branch February 3, 2025 09:41
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.

2 participants