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

Dependency-less vpip #11

Open
jayvdb opened this issue Oct 23, 2019 · 4 comments
Open

Dependency-less vpip #11

jayvdb opened this issue Oct 23, 2019 · 4 comments

Comments

@jayvdb
Copy link
Contributor

jayvdb commented Oct 23, 2019

pipx is running into a few issues wrt having dependencies, esp wrt Click. see pypa/pipx#233

It would be nice for vpip to aim to be an alternative that is dependency free, avoiding those problems, even if it comes at the cost of being less pretty/featured/etc.

Also it might want to do vendoring of any libraries it needs, to avoid those problems. Also aiming to be frozen e.g. pypa/pipx#244

@eight04
Copy link
Owner

eight04 commented Oct 23, 2019

If you only install vpip with the global pip and install all other packages with vpip, then there should be no problem. Is there some workflow that requires you to install packages with the global pip instead of vpip?

@eight04
Copy link
Owner

eight04 commented Oct 23, 2019

You can also install vpip as a global CLI using vpip so it stays in a global venv:

pip install vpip
vpip install -g vpip
pip uninstall vpip

@jayvdb
Copy link
Contributor Author

jayvdb commented Oct 23, 2019

then there should be no problem

famous last words. ;-) anything to do with python and dependencies is filled with many corner cases.

A good test case to have is installing another tool which has different version dependencies to the currently running vpip. Possibly a good approach is using vpip to install an older version of vpip which has conflicting versions of dependencies, and check the site-packages has the correct contents to run the older vpip.

@jayvdb
Copy link
Contributor Author

jayvdb commented Oct 23, 2019

Using the system vpip , and after changing execute_pip from python -m pip to python3 -m pip, I see that it is skipping installs which are already present in my system python3.7 (which is /home/python3.7/lib/python3.7)

> vpip install -g story
building venv at /home/jayvdb/.vpip/pkg_venvs/story
Collecting pip
  Using cached https://files.pythonhosted.org/packages/00/b6/9cfa56b4081ad13874b0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 19.0.3
    Uninstalling pip-19.0.3:
      Successfully uninstalled pip-19.0.3
Successfully installed pip-19.3.1
Requirement already satisfied: story in /home/jayvdb/projects/storyscript/cli (0.21.2.dev10+gf770461.d20191015)
Requirement already satisfied: click-completion==0.5.1 in /home/python3.7/lib/python3.7/site-packages (from story) (0.5.1)
Collecting click-help-colors==0.5 (from story)
  Using cached https://files.pythonhosted.org/packages/f8/a2/bbd2b60ba4f82048613b480a373339753539f77e243fae74340ac6410384/click_help_colors-0.5-py3-none-any.whl
Requirement already satisfied: click-spinner==0.1.8 in /home/python3.7/lib/python3.7/site-packages (from story) (0.1.8)
Requirement already satisfied: click==7.0 in /home/python3.7/lib/python3.7/site-packages (from story) (7.0)
Collecting emoji==0.5.0 (from story)
Collecting raven==6.9.0 (from story)
  Using cached https://files.pythonhosted.org/packages/11/3a/b3e46b279b8bdd9eb55857d0e95044cad31732c80f628bb75e1e9e881a32/raven-6.9.0-py2.py3-none-any.whl
Requirement already satisfied: requests~=2.20 in /home/python3.7/lib/python3.7/site-packages (from story) (2.22.0)
Collecting storyscript==0.24.2 (from story)
  Using cached https://files.pythonhosted.org/packages/41/61/7903e09bdb0840cd19764ec5625ecc4a7fcc9d33a88721f9bda75f1bedb1/storyscript-0.24.2-py3-none-any.whl
Requirement already satisfied: websockets~=7.0 in /home/python3.7/lib64/python3.7/site-packages (from story) (7.0)
Collecting texttable~=1.4.0 (from story)
Requirement already satisfied: pyyaml>=4.2 in /home/python3.7/lib64/python3.7/site-packages (from story) (5.1.1)
Requirement already satisfied: pytz>=2018.5 in /home/python3.7/lib/python3.7/site-packages (from story) (2019.2)
Requirement already satisfied: blindspin in /home/python3.7/lib/python3.7/site-packages (from story) (2.0.1)
Requirement already satisfied: appdirs in /home/python3.7/lib/python3.7/site-packages (from story) (1.4.3)
Requirement already satisfied: xerox in /home/python3.7/lib/python3.7/site-packages (from story) (0.4.1)
Requirement already satisfied: semver in /home/python3.7/lib/python3.7/site-packages (from story) (2.8.1)
Requirement already satisfied: jinja2 in /home/python3.7/lib/python3.7/site-packages (from click-completion==0.5.1->story) (2.10.1)
Requirement already satisfied: six in /home/python3.7/lib/python3.7/site-packages (from click-completion==0.5.1->story) (1.12.0)
Requirement already satisfied: shellingham in /home/python3.7/lib/python3.7/site-packages (from click-completion==0.5.1->story) (1.3.0)
Requirement already satisfied: chardet>=3.0.2 in /home/python3.7/lib/python3.7/site-packages (from requests~=2.20->story) (3.0.4)
Requirement already satisfied: idna>=2.5 in /home/python3.7/lib/python3.7/site-packages (from requests~=2.20->story) (2.8)
Requirement already satisfied: urllib3>=1.21.1 in /home/jayvdb/.local/lib/python3.7/site-packages (from requests~=2.20->story) (1.24.3)
Requirement already satisfied: certifi>=2017.4.17 in /home/python3.7/lib/python3.7/site-packages (from requests~=2.20->story) (2019.3.9)
Requirement already satisfied: click-aliases==1.0.1 in /home/python3.7/lib/python3.7/site-packages (from storyscript==0.24.2->story) (1.0.1)
Collecting lark-parser==0.7.2 (from storyscript==0.24.2->story)
Requirement already satisfied: bom-open==0.4.0 in /home/python3.7/lib/python3.7/site-packages (from storyscript==0.24.2->story) (0.4)
Collecting story-hub==0.1.6 (from storyscript==0.24.2->story)
Requirement already satisfied: MarkupSafe>=0.23 in /home/python3.7/lib64/python3.7/site-packages (from jinja2->click-completion==0.5.1->story) (1.1.1)
Requirement already satisfied: cachetools==3.1.0 in /home/python3.7/lib/python3.7/site-packages (from story-hub==0.1.6->storyscript==0.24.2->story) (3.1.0)
Collecting peewee==3.9.3 (from story-hub==0.1.6->storyscript==0.24.2->story)
Installing collected packages: click-help-colors, emoji, raven, lark-parser, peewee, story-hub, storyscript, texttable
  Found existing installation: click-help-colors 0.6
    Uninstalling click-help-colors-0.6:
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: 'LICENSE.txt'
Consider using the `--user` option or check the permissions.

Traceback (most recent call last):
  File "/usr/bin/vpip", line 11, in <module>
    load_entry_point('vpip==0.2.3', 'console_scripts', 'vpip')()
  File "/usr/lib/python3.7/site-packages/vpip/cli.py", line 57, in cli
    module.run(ns)
  File "/usr/lib/python3.7/site-packages/vpip/commands/install.py", line 33, in run
    install_global(ns.PACKAGE)
  File "/usr/lib/python3.7/site-packages/vpip/commands/install.py", line 59, in install_global
    pip_api.install(pkg, upgrade=upgrade, latest=latest)
  File "/usr/lib/python3.7/site-packages/vpip/pip_api.py", line 39, in install
    execute_pip("{} {}".format(cmd, package))
  File "/usr/lib/python3.7/site-packages/vpip/pip_api.py", line 119, in execute_pip
    return execute(prefix + cmd, capture)
  File "/usr/lib/python3.7/site-packages/vpip/execute.py", line 30, in execute
    list(do_execute())
  File "/usr/lib/python3.7/site-packages/vpip/execute.py", line 27, in do_execute
    raise subprocess.CalledProcessError(process.returncode, cmd)
subprocess.CalledProcessError: Command 'python3 -m pip install story' returned non-zero exit status 1.

Likewise globally installing vpip

> vpip install -g vpip
building venv at /home/jayvdb/.vpip/pkg_venvs/vpip
Collecting pip
  Using cached https://files.pythonhosted.org/packages/00/b6/9cfa56b4081ad13874b0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 19.0.3
    Uninstalling pip-19.0.3:
      Successfully uninstalled pip-19.0.3
Successfully installed pip-19.3.1
Requirement already satisfied: vpip in /home/python3.7/lib/python3.7/site-packages (0.2.3)
Requirement already satisfied: case-conversion>=2.1 in /home/python3.7/lib/python3.7/site-packages (from vpip) (2.1.0)
Requirement already satisfied: configupdater>=1.0 in /home/python3.7/lib/python3.7/site-packages (from vpip) (1.0.1)
Requirement already satisfied: packaging>=19.0 in /home/python3.7/lib/python3.7/site-packages (from vpip) (19.0)
Requirement already satisfied: requests>=2.21 in /home/python3.7/lib/python3.7/site-packages (from vpip) (2.22.0)
Requirement already satisfied: setuptools>=40.7 in /home/python3.7/lib/python3.7/site-packages (from vpip) (41.0.1)
Requirement already satisfied: regex>=2016.2.25 in /home/python3.7/lib64/python3.7/site-packages (from case-conversion>=2.1->vpip) (2019.6.5)
Requirement already satisfied: pyparsing>=2.0.2 in /home/python3.7/lib/python3.7/site-packages (from packaging>=19.0->vpip) (2.4.0)
Requirement already satisfied: six in /home/python3.7/lib/python3.7/site-packages (from packaging>=19.0->vpip) (1.12.0)
Requirement already satisfied: chardet>=3.0.2 in /home/python3.7/lib/python3.7/site-packages (from requests>=2.21->vpip) (3.0.4)
Requirement already satisfied: idna>=2.5 in /home/python3.7/lib/python3.7/site-packages (from requests>=2.21->vpip) (2.8)
Requirement already satisfied: urllib3>=1.21.1 in /home/jayvdb/.local/lib/python3.7/site-packages (from requests>=2.21->vpip) (1.24.3)
Requirement already satisfied: certifi>=2017.4.17 in /home/python3.7/lib/python3.7/site-packages (from requests>=2.21->vpip) (2019.3.9)
link console script 'vpip'
Traceback (most recent call last):
  File "/usr/bin/vpip", line 11, in <module>
    load_entry_point('vpip==0.2.3', 'console_scripts', 'vpip')()
  File "/usr/lib/python3.7/site-packages/vpip/cli.py", line 57, in cli
    module.run(ns)
  File "/usr/lib/python3.7/site-packages/vpip/commands/install.py", line 33, in run
    install_global(ns.PACKAGE)
  File "/usr/lib/python3.7/site-packages/vpip/commands/install.py", line 60, in install_global
    link_console_script(pkg, overwrite=True)
  File "/usr/lib/python3.7/site-packages/vpip/commands/link.py", line 43, in link_console_script
    linker.dest.unlink()
  File "/usr/lib64/python3.7/pathlib.py", line 1287, in unlink
    self._accessor.unlink(self)
PermissionError: [Errno 13] Permission denied: '/usr/bin/vpip'

The same happens if I avoid my rpms, etc.

python3 -m pip install --user --force vpip
~/.local/bin/vpip install -g vpip
# also non-global fails
~/.local/bin/vpip install vpip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants