pypa / pypa/setuptools

[BUG] egg_info run stage writes files to local directory as of verison 60.0.0

Open
#3,159 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Needs Triage
Dominant language
Python
Stars
2.9k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

setuptools version

setuptools>=60.0.0

Python version

3.8.12

OS

Linux (unknown dist)

Additional environment information

Conda: 4.9.2

pip list output:

Package    Version
---------- -------
pip        22.0.4
setuptools 60.0.0
wheel      0.37.1
Description

I am trying to run:

python setup.py build --build-base=$HOME/tmp install --prefix=$CONDA_PREFIX

to install a package from a directory to which I do not have any write permissions (it is not an option to change the permissions). As of version 60.0.0 the installation fails with the message that it cannot write dist/pkgname.egg_info.

Expected behavior

A successful installation

How to Reproduce
  1. Create a custom package with an setup.py (unfortunately I cannot share the package to you)
  2. Remove writing permissions from the package
  3. Run python setup.py build --build-base=$HOME/tmp install --prefix=$PREFIX where you replace $PREFIX with a directory of your python installation
  4. Observe the Permission Denied error

The bug is reproduced in version 60.0.0, 60.9.3. the last version in which the bug does not occur is 59.8.0.

Output
running egg_info
creating dist/pkgname.egg-info
error: could not create 'dist/pkgname.egg-info': Permission denied

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start by reproducing the reported setup.py build and install command with a non-writable package directory, comparing setuptools 59.8.0 with 60.0.0 or later. Trace the egg_info run stage and how it chooses the dist/pkgname.egg-info location; done means the installation succeeds without requiring writes to the source directory.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.