[BUG] pip install ./path/to/package requires the network
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.9k
- Forks
- 1.4k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
setuptools version
setuptools-65.6.3
Python version
Python 3.10
OS
Ubuntu
Additional environment information
No network connectivity, e.g.
- Developer on a long flight
- Developer located in the middle of the Amazon forest
- Developer located in a deep cave
- Developer located in a nuclear submarine
Description
Running python ./path/to/package/setup.py install raises a warning:
SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
however, pip install ./path/to/package requires access to the network in order to work, even if all the dependencies are available locally. This means that it's impossible to hack on your favourite C extension if the network is not available.
Expected behavior
See above.
How to Reproduce
With the network available. Note that all the build dependencies are available:
$ git clone git@github.com:psycopg/psycopg.git
$ cd psycopg
$ pip install -v ./psycopg_c/
Using pip 22.3.1 from /home/piro/dev/psycopg3/.venv/lib/python3.10/site-packages/pip (python 3.10)
Processing ./psycopg_c
Running command pip subprocess to install build dependencies
Collecting setuptools>=49.2.0
Using cached setuptools-65.6.3-py3-none-any.whl (1.2 MB)
Collecting wheel>=0.37
Using cached wheel-0.38.4-py3-none-any.whl (36 kB)
Collecting Cython>=3.0.0a11
Using cached Cython-3.0.0a11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl (2.6 MB)
Installing collected packages: wheel, setuptools, Cython
Successfully installed Cython-3.0.0a11 setuptools-65.6.3 wheel-0.38.4
Installing build dependencies ... done
Running command Getting requirements to build wheel
Getting requirements to build wheel ... done
Running command Preparing metadata (pyproject.toml)
running dist_info
...
Successfully built psycopg-c
Installing collected packages: psycopg-c
Successfully installed psycopg-c-3.1.8.dev1
Taking down the network:
$ pip install -v ./psycopg_c/
Using pip 22.3.1 from /home/piro/dev/psycopg3/.venv/lib/python3.10/site-packages/pip (python 3.10)
Processing ./psycopg_c
Running command pip subprocess to install build dependencies
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f45501461d0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/setuptools/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f45501464d0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/setuptools/
^C Installing build dependencies ... canceled
setup.py install works instead:
$ python ./psycopg_c/setup.py install
/home/piro/dev/psycopg3/.venv/lib/python3.10/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
warnings.warn(
running install
/home/piro/dev/psycopg3/.venv/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
/home/piro/dev/psycopg3/.venv/lib/python3.10/site-packages/setuptools/command/easy_install.py:158: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running bdist_egg
running egg_info
writing psycopg_c.egg-info/PKG-INFO
writing dependency_links to psycopg_c.egg-info/dependency_links.txt
writing top-level names to psycopg_c.egg-info/top_level.txt
reading manifest file 'psycopg_c.egg-info/SOURCES.txt'
adding license file 'LICENSE.txt'
writing manifest file 'psycopg_c.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
building 'psycopg_c._psycopg' extension
...
Installed /home/piro/dev/psycopg3/.venv/lib/python3.10/site-packages/psycopg_c-3.1.8.dev1-py3.10-linux-x86_64.egg
Processing dependencies for psycopg-c==3.1.8.dev1
Finished processing dependencies for psycopg-c==3.1.8.dev1
Output
See above.
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.
Research direction
Start by reproducing pip install -v ./psycopg_c/ with the network unavailable and compare it with python ./psycopg_c/setup.py install. Read the build-dependency handling around the pyproject.toml build step; done means a local package installs successfully offline when its dependencies are already available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100