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

Function get_tags() fails when run from a clone without that git history present #492

Open
andrewphilipsmith opened this issue Aug 31, 2022 · 0 comments

Comments

@andrewphilipsmith
Copy link

andrewphilipsmith commented Aug 31, 2022

(Note: This issue was initially opened here urbangrammarai#19)

How to reproduce

1). Make a shallow clone of the git repo:

$ mkdir gee_temp_clone
$ cd gee_temp_clone
$ git init .
$ git remote add origin https://github.com/urbangrammarai/gee_pipeline
$ git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin

2). Run a unit test which

$ pytest pyveg/tests/test_combiner_modules.py::test_combine

Expect behaviour

The function pyveg/src/file_utils.py::get_tags() should produce a meaningful version string, when operating without a full git clone.

Actual behaviour

The function pyveg/src/file_utils.py::get_tags(), calls the subprocess git describe --tags.
This generates the error message (sterr):
fatal: No names found, cannot describe anything.

The function pyveg/src/file_utils.py::get_tags() returns an empty string.

Note:

The scenario occurs when running testing in GitHub Actions, where shallow clones are the default.

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

No branches or pull requests

1 participant