jacebrowning / jacebrowning/gitman
Failing to install dependencies on Windows
- Dominant language
- Python
- Stars
- 225
- Forks
- 36
- Avg merge
- 15h 47m
- Merged PRs (30d)
- 8
Description
Given the following project structure:
```
z:\github\my_project
z:\github\my_project\gitman.yml
```
With gitman.yml
```
location: .
sources:
...
- name: MyModule
type: git
repo: https://my_repo.dummy/MyModule
sparse_paths:
-
...
```
The following error occurs:
```
z:\github\my_project\gitman install public
Installing dependencies...
$ cd /D z:\github\my_project
$ cd /D MyModule
Traceback (most recent call last):
File "c:\Python38\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\Python38\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "z:\github\my_project\.venv\Scripts\gitman.exe\__main__.py", line 7, in
File "z:\github\my_project\.venv\lib\site-packages\gitman\cli.py", line 226, in main
_run_command(function, args, kwargs)
File "z:\github\my_project\.venv\lib\site-packages\gitman\cli.py", line 297, in _run_command
success = function(*args, **kwargs)
File "z:\github\my_project\.venv\lib\site-packages\gitman\commands.py", line 17, in wrapped
result = func(*args, **kwargs)
File "z:\github\my_project\.venv\lib\site-packages\gitman\commands.py", line 96, in install
count = config.install_dependencies(
File "z:\github\my_project\.venv\lib\site-packages\gitman\models\config.py", line 103, in install_dependencies
source.update_files(
File "z:\github\my_project\.venv\lib\site-packages\gitman\models\source.py", line 85, in update_files
raise self._invalid_repository
gitman.exceptions.InvalidRepository:
Not a valid repository: z:\github\my_project\MyModule\MyModule
During install you can rebuild a repo with a missing .git directory using the --force option
```
I tried to dump `gittoplevel` and `currentdir` in
https://github.com/jacebrowning/gitman/blob/b7d5317d3b4844256e6c8dbc47809d0646c556f6/gitman/git.py#L116-L117
```
gittoplevel = Z:/github/my_project/MyModule
currentdir = z:/github/my_project/MyModule
```
Note that the drive letter is `Z` in `gittoplevel` but it is `z` in `currentdir` somenhow in my windows environment.
it looks like an similar issue to #228 reported by @Erich-McMillan.
Contributor guide
Research direction
Reproduce the Windows install using the project structure and gitman.yml shown, then inspect gitman.py around lines 116-117 while comparing gittoplevel and currentdir. Trace how the differing drive-letter casing reaches repository validation, and verify that dependency installation no longer rejects the valid MyModule repository.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, python
- Domain
- cli, devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100