Fixing / documenting how editable installs with --install-dir=$path work
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- python
- Domain
- build-system
Research direction
The issue names pip install --target ... --editable, python setup.py develop --install-dir, and site.addsitedir with pkg_resources, but no repository files or tests. First establish current setuptools behavior and compatibility constraints; done requires a decided, reproducible behavior with either documentation scope or an implementation plan.
Written by the indexing model from the issue text.
Description
Hi there,
since https://github.com/pypa/pip/pull/9636 got merged, setuptools is now next in line. :-)
I'd like some input on how to proceed here, as I am still quite new to setuptools.
Some immediate thoughts, I think it would be safe to document that right now (i.e. with the next version of pip) it will work to use pip install --target $target --editable path/to/package which is then equivalent to… I'm actually not quite sure yet, python setup.py develop --install-dir=$targetI think? And to activate the packages in that directory code like this can be used:
def add_site(path):
"""This adds a path to as proper site packages to all associated import
systems. Primarily it invokes `site.addsitedir` and also configures
pkg_resources' metadata accordingly.
"""
site.addsitedir(path)
ws = pkg_resources.working_set
ws.entry_keys.setdefault(path, [])
ws.entries.append(path)
for dist in pkg_resources.find_distributions(path, False):
ws.add(dist, path, insert=True)
Then, second would be the question how to best proceed with this in setuptools? A simple thing could be to add code like this in setuptools to ensure .egg-link's in directories on the python path are recognised? I have actually not yet started looking into how setuptools can actually do something there.
I'm not sure yet how backwards compatibility concerns play a role here, but flit allows to just symlink the installed package or allows using .pth files to achieve the same effect.
It is my understanding that even Windows supports symlinks nowadays, so maybe that is a really attractive option to change the install and simplify all the code in question?
Well, some code reading is probably next, but I wanted to open a space for discussion on how to proceed here, so: feedback welcome.
- Dominant language
- Python
- Stars
- 2.9k
- Forks
- 1.4k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pypa/setuptools
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
pypa/setuptools#5272 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
pypa/setuptools#5235 · 1 comment · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
pypa/setuptools#5234 · 1 comment ·
-
bug Needs Triage
Difficulty 1/5 Under an hour Newbie friendliness 78/100
pypa/setuptools#4135 · 1 comment · 1 reaction ·
-
documentation Needs Triage
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
pypa/setuptools#2753 ·
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100