`RequirementsFile.from_string()` results in `NameError: name 'Path' is not defined`

Open
#16 2 comments 3 reactions 0 assignees View on GitHub

@vreuter is already working on this.

Since Mar 14, 2023.

  • #17 by @vreuter — open
  • #19 by @jack-joindeed — open

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
42/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
python
Domain
tooling

Research direction

Open pip_requirements_parser.py and inspect RequirementsFile.from_string(), starting at the failing Path call. Verify how pathlib imports are handled, then exercise from_string() with the reported case or the project's relevant tests; done means the call no longer raises NameError.

Written by the indexing model from the issue text.

Description

I get this error when calling RequirementsFile.from_string():

  File "/..../venv/lib/python3.9/site-packages/pip_requirements_parser.py", line 269, in from_string
    tmpdir = Path(str(tempfile.mkdtemp()))
NameError: name 'Path' is not defined

I think the code needs from pathlib import Path.

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.