Potential improvement for editable installs

Open
#6 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
tooling

Research direction

Start with pip-api's pip_api/_parse_requirements.py around line 248 and inspect how pip-requirements-parser represents EditableRequirement when no egg fragment is present. Define done as directory-based editable installs deriving the package name and version from setup.py instead of leaving req as None, with tests covering that case.

Written by the indexing model from the issue text.

Description

I noticed another small difference between pip-api and pip-requirements-parser which I'd like to bring up.
At the moment, pip-requirements-parser relies on an egg fragment being at the end of an editable install in order to infer its name/specifier. Otherwise, the EditableRequirement's req member is set to None.

pip-api has some special logic that checks whether the editable installation points to a directory. If so, it checks that directory for a setup.py and attempts to parse the package name and version out of the file. You can find the relevant logic here.

How do you feel about having this logic in pip-requirements-parser? I appreciate that this logic perhaps goes a bit beyond "parsing" but it'd be useful since not all editable requirements have an egg fragment.

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.