Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File "setup.py" not found for legacy project #10107

Closed
1 task done
kzidane opened this issue Jun 27, 2021 · 2 comments
Closed
1 task done

File "setup.py" not found for legacy project #10107

kzidane opened this issue Jun 27, 2021 · 2 comments
Labels
type: bug A confirmed bug or unintended behavior

Comments

@kzidane
Copy link

kzidane commented Jun 27, 2021

Description

pip fails to install when setup.py is missing, even though setup.py is not required.

$ pip --version
pip 21.1.3 from /home/kzidane/.virtualenvs/temp/lib/python3.9/site-packages/pip (python 3.9)

$ tree
.
├── setup.cfg
└── src
    └── project
        └── __init__.py

2 directories, 2 files

$ cat setup.cfg
cat setup.cfg
[metadata]
name = project
version = 1.0.0
[options]
package_dir =
    = src
packages = find:
python_requires = >=3.6
[options.packages.find]
where = src

$ pip install -e .
Obtaining file:///tmp/project
ERROR: File "setup.py" not found for legacy project file:///tmp/project.

If I downgrade to pip 21.1.2, installation succeds:

$ pip install 'pip<21.1.3'
Collecting pip<21.1.3
  Using cached pip-21.1.2-py3-none-any.whl (1.5 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 21.1.3
    Uninstalling pip-21.1.3:
      Successfully uninstalled pip-21.1.3
Successfully installed pip-21.1.2

$ pip --version
pip 21.1.2 from /home/kzidane/.virtualenvs/temp/lib/python3.9/site-packages/pip (python 3.9)

$ pip install -e .
Obtaining file:///tmp/project
Installing collected packages: project
  Running setup.py develop for project
Successfully installed project-1.0.0
WARNING: You are using pip version 21.1.2; however, version 21.1.3 is available.
You should consider upgrading via the '/home/kzidane/.virtualenvs/temp/bin/python -m pip install --upgrade pip' command.

$ pip show project
Name: project
Version: 1.0.0
Summary: UNKNOWN
Home-page: UNKNOWN
Author: None
Author-email: None
License: UNKNOWN
Location: /tmp/project/src
Requires:
Required-by:

Expected behavior

Installation succeeds.

pip version

21.1.3

Python version

3.9.5

OS

Ubuntu 21.04

How to Reproduce

  1. Create a package without setup.py
  2. Try installing this package
  3. Installation fails with File "setup.py" not found for legacy project

Output

Obtaining file:///tmp/project
ERROR: File "setup.py" not found for legacy project file:///tmp/project.

Code of Conduct

@kzidane kzidane added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Jun 27, 2021
@pfmoore
Copy link
Member

pfmoore commented Jun 27, 2021

Just add a pyproject.toml file. See #9945 for the discussion, but basically standard-conforming projects should either contain setup.py (legacy setuptools projects) or pyproject.toml (modern PEP 517 conforming projects).

@kzidane
Copy link
Author

kzidane commented Jun 27, 2021

Thank you.

@kzidane kzidane closed this as completed Jun 27, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 26, 2021
@pradyunsg pradyunsg removed the S: needs triage Issues/PRs that need to be triaged label Mar 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants