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 on pyperclip should be optional #984

Closed
jwilk opened this issue Feb 27, 2016 · 7 comments
Closed

dependency on pyperclip should be optional #984

jwilk opened this issue Feb 27, 2016 · 7 comments

Comments

@jwilk
Copy link
Contributor

jwilk commented Feb 27, 2016

pyperclip has exuberant requirements, so I'd like to avoid installing it on my system. The mitmproxy code already handles missing pyperclip gracefully. Unfortunately, the setup script declares pyperclip as an absolute dependency, so the generated scripts (such as mitmdump) won't run without pyperclip installed. Please consider moving pyperclip from install_requires to extras_require.

@mhils
Copy link
Member

mhils commented Feb 28, 2016

Thanks for the report. Looking at https://github.com/asweigart/pyperclip/blob/master/setup.py, I don't see any dependencies?

@dufferzafar
Copy link
Contributor

@mhils pyperclip doesn't have any python based dependencies, but depends on some external commands like xsel etc. Check out the Readme.

And I think if mitmproxy really does handle missing pyperclip gracefully, then we should just make it optional.

@mhils
Copy link
Member

mhils commented Feb 28, 2016

I know, I fixed pyperclip's Windows support and added tests for the whole thing a while ago.
Again, pyperclip does not specify any required dependencies and I don't see an issue with installing it. We gracefully handle the case where pyperclip is installed but no clipboard provider is present.

@Dutchy-
Copy link

Dutchy- commented Feb 29, 2016

I feel that I should add my experience with pyperclip on windows in a cygwin/python 2.7 environment here:

$ python --version
Python 2.7.10

$ pip --version
pip 8.0.3 from /usr/lib/python2.7/site-packages (python 2.7)

$ pip install pyperclip
Collecting pyperclip
  Using cached pyperclip-1.5.26.zip
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-jn_4_r/pyperclip/setup.py", line 8, in <module>
        version=__import__('pyperclip').__version__,
      File "pyperclip/__init__.py", line 99, in <module>
        copy, paste = determine_clipboard()
      File "pyperclip/__init__.py", line 53, in determine_clipboard
        return init_windows_clipboard(cygwin=True)
      File "pyperclip/windows.py", line 26, in init_windows_clipboard
        from ctypes.wintypes import (HGLOBAL, LPVOID, DWORD, LPCSTR, INT, HWND,
      File "/usr/lib/python2.7/ctypes/wintypes.py", line 23, in <module>
        class VARIANT_BOOL(_SimpleCData):
    ValueError: _type_ 'v' not supported

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-jn_4_r/pyperclip

Windows is not my main platform so I don't really care, but it would be great if mitmproxy could run without pyperclip

@mhils
Copy link
Member

mhils commented Feb 29, 2016

@Dutchy-: I think this is a duplicate of asweigart/pyperclip#55 - we can fix that, but I think it's not directly related to this discussion.

@mhils
Copy link
Member

mhils commented Feb 29, 2016

pyperclip compatibility with Cygwin is handled in asweigart/pyperclip#59.

@mhils
Copy link
Member

mhils commented Mar 10, 2016

I'm closing this for now. If there are any strong arguments we missed, I'm happy to re-open this discussion.

@mhils mhils closed this as completed Mar 10, 2016
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

4 participants