aboutcode-org / aboutcode-org/pip-requirements-parser

[BUG] VCS URLs are detected as path on linux systems

Aperta
#24 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
20
Fork
13
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

# issue
`'git+https://github.com/path/to/package-one@41b95ec#egg=package-one'`
is detected as a path, but actually it is just a VCS url

# expected:

`'git+https://github.com/path/to/package-one@41b95ec#egg=package-one'`
is NOT detected as a path

# reason:
```py
def _looks_like_path(name: str) -> bool:
"""Checks whether the string ``name`` "looks like" a path on the filesystem.

This does not check whether the target actually exists, only judge from the
appearance.

Returns true if any of the following conditions is true:
* a path separator is found (either os.path.sep or os.path.altsep);
* a dot is found (which represents the current directory).
"""
if not name:
return False
if os.path.sep in name:
return True
# exists here, on linux/unix, as there is a '/' in the name
# ...
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.