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

Failing to install dependencies on Windows #233

Open
sch0125 opened this issue Nov 30, 2020 · 2 comments
Open

Failing to install dependencies on Windows #233

sch0125 opened this issue Nov 30, 2020 · 2 comments

Comments

@sch0125
Copy link
Contributor

sch0125 commented Nov 30, 2020

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 <module>
  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

gitman/gitman/git.py

Lines 116 to 117 in b7d5317

gittoplevel = git('rev-parse', '--show-toplevel', _show=False)
currentdir = pwd(_show=False)

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.

sch0125 pushed a commit to sch0125/gitman that referenced this issue Nov 30, 2020
Normalize case and path before comparing paths in git.valid()

Issue:
See issue jacebrowning#233
@sch0125 sch0125 mentioned this issue Nov 30, 2020
@sch0125
Copy link
Contributor Author

sch0125 commented Nov 30, 2020

@jacebrowning
I've submitted a PR #234 to fix this issue.

@Flashmueller
Copy link

Hi.
I have the exact same issue in the latest version of gitman (3.5.2) under windows.
Is there something that could be wrong on my side? The initial installation of the dependencies worked fine.

PS C:\Git_Repos\s7librariesdevproject> gitman update

Updating dependencies...

$ cd /D C:\Git_Repos\s7librariesdevproject\.gitman

  $ cd /D BurDefaultLibraries
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\hirste\AppData\Local\Programs\Python\Python311\Scripts\gitman.exe\__main__.py", line 7, in <module>
  File "C:\Users\hirste\AppData\Local\Programs\Python\Python311\Lib\site-packages\gitman\cli.py", line 253, in main
    _run_command(function, args, kwargs)
  File "C:\Users\hirste\AppData\Local\Programs\Python\Python311\Lib\site-packages\gitman\cli.py", line 341, in _run_command
    success = function(*args, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\hirste\AppData\Local\Programs\Python\Python311\Lib\site-packages\gitman\decorators.py", line 9, in wrapped
    result = function(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\hirste\AppData\Local\Programs\Python\Python311\Lib\site-packages\gitman\commands.py", line 181, in update
    _count = config.install_dependencies(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\hirste\AppData\Local\Programs\Python\Python311\Lib\site-packages\gitman\models\config.py", line 109, in install_dependencies
    source.update_files(
  File "C:\Users\hirste\AppData\Local\Programs\Python\Python311\Lib\site-packages\gitman\models\source.py", line 149, in update_files
    raise self._invalid_repository
gitman.exceptions.InvalidRepository:

            Not a valid repository: C:\Git_Repos\s7librariesdevproject\.gitman\BurDefaultLibraries\BurDefaultLibraries
            During install you can rebuild a repo with a missing .git directory using the --force option

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants