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

pip install ignores --global-option when running egg_info #6560

Closed
ftesser opened this issue May 31, 2019 · 2 comments
Closed

pip install ignores --global-option when running egg_info #6560

ftesser opened this issue May 31, 2019 · 2 comments
Labels
auto-locked Outdated issues that have been locked by automation resolution: duplicate Duplicate of an existing issue/PR

Comments

@ftesser
Copy link

ftesser commented May 31, 2019

Environment

  • pip version: 19.1.1
  • Python version: 3.7.3
  • OS: Ubuntu 19.04

Description

From pip install documentation:
--global-option: Extra global options to be supplied to the setup.py call before the install command.

--global-option is supplied to the install or bdist_wheel commands but not to the egg_info command.

Expected behavior

Before running setup.py install pip install run setup.py egg_info, I expected that --global-option parameter is supplied also to this command.

How to Reproduce

  1. in a empy test_folder create a dummy setup.py like this one, with a line like print(sys.argv) to check the supplied arguments:
from setuptools import setup
import sys
# print arguments for test
print('Supplied arguments:')
print(sys.argv)
setup(
    name='pip_install_global_option',
    version='0.1'
)
  1. run pip install with --global-option="--verbose":
pip3 install -v --global-option="--verbose" ./folder/ --user or 

or if installing from a VCS:

pip3 install -v --global-option="--verbose" git+https://gitlab.com/fabio.tesser/pip_install_global_option#egg=pip_install_global_option --user 
  1. look at the two occurrences of Supplied arguments string:
  • at the first occurrence, when egg_info command was run, the --verbose option is not present in the list of the arguments;
  • at the second occurrence, when install command was run, the --verbose option is correctly supplied.
Output
pip3 install -v --global-option="--verbose" ./pip_install_global_option/ --user 
/home/fabio/.local/lib/python3.7/site-packages/pip/_internal/commands/install.py:244: UserWarning: Disabling all use of wheels due to the use of --build-options / --global-options / --install-options.
  cmdoptions.check_install_build_global(options)
Created temporary directory: /tmp/pip-ephem-wheel-cache-s6rmjh_v
Created temporary directory: /tmp/pip-req-tracker-ivspcvo9
Created requirements tracker '/tmp/pip-req-tracker-ivspcvo9'
Created temporary directory: /tmp/pip-install-v8dqah5u
Processing ./pip_install_global_option
  Created temporary directory: /tmp/pip-req-build-ykxb0ptk
  Added file:///media/disk_1TB/fabio/src/git_repositories/pip_install_global_option to build tracker '/tmp/pip-req-tracker-ivspcvo9'
    Running setup.py (path:/tmp/pip-req-build-ykxb0ptk/setup.py) egg_info for package from file:///media/disk_1TB/fabio/src/git_repositories/pip_install_global_option
    Running command python setup.py egg_info
    Supplied arguments:
    ['-c', 'egg_info', '--egg-base', 'pip-egg-info']
    running egg_info
    creating pip-egg-info/pip_install_global_option.egg-info
    writing pip-egg-info/pip_install_global_option.egg-info/PKG-INFO
    writing dependency_links to pip-egg-info/pip_install_global_option.egg-info/dependency_links.txt
    writing top-level names to pip-egg-info/pip_install_global_option.egg-info/top_level.txt
    writing manifest file 'pip-egg-info/pip_install_global_option.egg-info/SOURCES.txt'
    reading manifest file 'pip-egg-info/pip_install_global_option.egg-info/SOURCES.txt'
    writing manifest file 'pip-egg-info/pip_install_global_option.egg-info/SOURCES.txt'
  Source in /tmp/pip-req-build-ykxb0ptk has version 0.1, which satisfies requirement pip-install-global-option==0.1 from file:///media/disk_1TB/fabio/src/git_repositories/pip_install_global_option
  Removed pip-install-global-option==0.1 from file:///media/disk_1TB/fabio/src/git_repositories/pip_install_global_option from build tracker '/tmp/pip-req-tracker-ivspcvo9'
Skipping bdist_wheel for pip-install-global-option, due to binaries being disabled for it.
Installing collected packages: pip-install-global-option
  Created temporary directory: /tmp/pip-record-4quqd4ik
    Running command /usr/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-req-build-ykxb0ptk/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' --verbose install --record /tmp/pip-record-4quqd4ik/install-record.txt --single-version-externally-managed --compile --user --prefix=
    Supplied arguments:
    ['-c', '--verbose', 'install', '--record', '/tmp/pip-record-4quqd4ik/install-record.txt', '--single-version-externally-managed', '--compile', '--user', '--prefix=']
    running install
    running build
    running install_egg_info
    running egg_info
    writing pip_install_global_option.egg-info/PKG-INFO
    writing dependency_links to pip_install_global_option.egg-info/dependency_links.txt
    writing top-level names to pip_install_global_option.egg-info/top_level.txt
    'license_file' option was not specified
    reading manifest file 'pip_install_global_option.egg-info/SOURCES.txt'
    writing manifest file 'pip_install_global_option.egg-info/SOURCES.txt'
    Copying pip_install_global_option.egg-info to /home/fabio/.local/lib/python3.7/site-packages/pip_install_global_option-0.1.egg-info
    Copying dependency_links.txt to /home/fabio/.local/lib/python3.7/site-packages/pip_install_global_option-0.1.egg-info/dependency_links.txt
    Copying top_level.txt to /home/fabio/.local/lib/python3.7/site-packages/pip_install_global_option-0.1.egg-info/top_level.txt
    Copying PKG-INFO to /home/fabio/.local/lib/python3.7/site-packages/pip_install_global_option-0.1.egg-info/PKG-INFO
    Copying SOURCES.txt to /home/fabio/.local/lib/python3.7/site-packages/pip_install_global_option-0.1.egg-info/SOURCES.txt
    running install_scripts
    writing list of installed files to '/tmp/pip-record-4quqd4ik/install-record.txt'
  Running setup.py install for pip-install-global-option ... done
  Removing source in /tmp/pip-req-build-ykxb0ptk
Successfully installed pip-install-global-option-0.1
Cleaning up...
Removed build tracker '/tmp/pip-req-tracker-ivspcvo9'
@triage-new-issues triage-new-issues bot added the S: needs triage Issues/PRs that need to be triaged label May 31, 2019
@ftesser ftesser changed the title pip install ignores --global-option in running egg_info pip install ignores --global-option when running egg_info May 31, 2019
@deepio
Copy link

deepio commented Jul 5, 2019

History: I think this has to do with any flag that is meant as a bool, because this issue has been talked about before. #6379 #5518 #5576

Command: pip install git+https://github.com/hsnr-gamera/gamera.git --global-option="--nowx"

  • It fails to acknowledge the --nowx flag.
  • The package works fine if I install it with python setup.py install --nowx

Version Info

pip 19.1.1 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)

Python 2.7.13

Distributor ID: Debian
Description:    Debian GNU/Linux 9.9 (stretch)
Release:        9.9
Codename:       stretch

Command Output

DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
/usr/local/lib/python2.7/dist-packages/pip/_internal/commands/install.py:244: UserWarning: Disabling all use of wheels due to the use of --build-options / --global-options / --install-options.
  cmdoptions.check_install_build_global(options)
Created temporary directory: /tmp/pip-ephem-wheel-cache-6Cs_dC
Created temporary directory: /tmp/pip-req-tracker-Vf0MAl
Created requirements tracker '/tmp/pip-req-tracker-Vf0MAl'
Created temporary directory: /tmp/pip-install-JWzlZ0
Collecting git+https://github.com/hsnr-gamera/gamera.git
  Created temporary directory: /tmp/pip-req-build-qossom
  Cloning https://github.com/hsnr-gamera/gamera.git to /tmp/pip-req-build-qossom
  Running command git clone -q https://github.com/hsnr-gamera/gamera.git /tmp/pip-req-build-qossom
  Added git+https://github.com/hsnr-gamera/gamera.git to build tracker '/tmp/pip-req-tracker-Vf0MAl'
    Running setup.py (path:/tmp/pip-req-build-qossom/setup.py) egg_info for package from git+https://github.com/hsnr-gamera/gamera.git
    Running command python setup.py egg_info
    Gamera version: 3.4.3
    Compiling genetic algorithms with parallelization (OpenMP)

    generating wrappers for tiff_support plugin
    generating wrappers for morphology plugin
    generating wrappers for threshold plugin
    generating wrappers for runlength plugin
    generating wrappers for image_utilities plugin
    generating wrappers for geometry plugin
    generating wrappers for projections plugin
    generating wrappers for thinning plugin
    generating wrappers for edgedetect plugin
    generating wrappers for png_support plugin
    generating wrappers for string_io plugin
    generating wrappers for pagesegmentation plugin
    generating wrappers for deformation plugin
    generating wrappers for structural plugin
    generating wrappers for transformation plugin
    generating wrappers for logical plugin
    generating wrappers for color plugin
    generating wrappers for draw plugin
    generating wrappers for misc_free_functions plugin
    generating wrappers for fourier_features plugin
    generating wrappers for features plugin
    generating wrappers for contour plugin
    generating wrappers for binarization plugin
    generating wrappers for listutilities plugin
    generating wrappers for segmentation plugin
    generating wrappers for gui_support plugin
    generating wrappers for image_conversion plugin
    generating wrappers for convolution plugin
    generating wrappers for arithmetic plugin
    generating wrappers for misc_filters plugin
    generating wrappers for corelation plugin
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-qossom/setup.py", line 235, in <module>
        import wx
    ImportError: No module named wx
Cleaning up...
  Removing source in /tmp/pip-req-build-qossom
Removed git+https://github.com/hsnr-gamera/gamera.git from build tracker '/tmp/pip-req-tracker-Vf0MAl'
Removed build tracker '/tmp/pip-req-tracker-Vf0MAl'
ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-req-build-qossom/
Exception information:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/cli/base_command.py", line 178, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/commands/install.py", line 352, in run
    resolver.resolve(requirement_set)
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/resolve.py", line 131, in resolve
    self._resolve_one(requirement_set, req)
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/resolve.py", line 294, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/resolve.py", line 242, in _get_abstract_dist_for
    self.require_hashes
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/operations/prepare.py", line 362, in prepare_linked_requirement
    abstract_dist.prep_for_dist(finder, self.build_isolation)
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/operations/prepare.py", line 171, in prep_for_dist
    self.req.prepare_metadata()
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/req/req_install.py", line 537, in prepare_metadata
    self.run_egg_info()
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/req/req_install.py", line 615, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/utils/misc.py", line 776, in call_subprocess
    % (command_desc, proc.returncode, cwd))
InstallationError: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-req-build-qossom/

@chrahunt chrahunt added the resolution: duplicate Duplicate of an existing issue/PR label Oct 17, 2019
@triage-new-issues triage-new-issues bot removed the S: needs triage Issues/PRs that need to be triaged label Oct 17, 2019
@chrahunt
Copy link
Member

Hi @ftesser, this feature is tracked in #4383. I

@deepio - thanks, that looks like the same issue.

I will close this now, I would encourage anyone interested to 👍 #4383 and contribute if you have time!

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Nov 16, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Nov 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation resolution: duplicate Duplicate of an existing issue/PR
Projects
None yet
Development

No branches or pull requests

3 participants