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

Open
#24 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

  • #33 by @Anurag-S1ngh — closed without merging

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
tooling

Research direction

Start by locating the _looks_like_path entry point and reproduce the Linux case with the VCS URL shown in the issue. Trace how that URL is classified, then verify that it is no longer treated as a filesystem path while ordinary paths remain recognized.

Written by the indexing model from the issue text.

Description

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:

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
    # ...
Dominant language
Python
Stars
20
Forks
17
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aboutcode-org/pip-requirements-parser

All issues in aboutcode-org/pip-requirements-parser

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.