mkrphys / ipython-tikzmagic

IPython magics for generating figures with TikZ
BSD 3-Clause "New" or "Revised" License
160 stars 44 forks source link

setup.py: require ipython; remove import #17

Closed hblanks closed 6 years ago

hblanks commented 6 years ago

Fix setup.py so that pip install ipython-tikzmagic works from an empty virtualenv (python2 or python3).

hblanks commented 6 years ago

Thanks for your work, @mkrphys ! This fixes it so that, from a clean virtualenv, instead of:

$ pip install git+git://github.com/mkrphys/ipython-tikzmagic.git@bcbb04553c06a430192ed6e54f7caade779e7dba
Collecting git+git://github.com/mkrphys/ipython-tikzmagic.git@bcbb04553c06a430192ed6e54f7caade779e7dba
  Cloning git://github.com/mkrphys/ipython-tikzmagic.git (to bcbb04553c06a430192ed6e54f7caade779e7dba) to /tmp/pip-YSxxuS-build
  Could not find a tag or branch 'bcbb04553c06a430192ed6e54f7caade779e7dba', assuming commit.
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-YSxxuS-build/setup.py", line 8, in <module>
        import tikzmagic
      File "tikzmagic.py", line 37, in <module>
        from IPython.core.displaypub import publish_display_data
    ImportError: No module named IPython.core.displaypub

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

we get:

$ pip install git+git://github.com/hblanks/ipython-tikzmagic.git
Collecting git+git://github.com/hblanks/ipython-tikzmagic.git
  Cloning git://github.com/hblanks/ipython-tikzmagic.git to /tmp/pip-2axSek-build
Collecting ipython (from ipython-tikzmagic==0.1.0)
  Downloading ipython-5.5.0-py2-none-any.whl (758kB)
    100% |████████████████████████████████| 768kB 793kB/s
Requirement already satisfied: setuptools>=18.5 in /tmp/foo/lib/python2.7/site-packages (from ipython->ipython-tikzmagic==0.1.0)
Collecting backports.shutil-get-terminal-size; python_version == "2.7" (from ipython->ipython-tikzmagic==0.1.0)
  Downloading backports.shutil_get_terminal_size-1.0.0-py2.py3-none-any.whl
Collecting pickleshare (from ipython->ipython-tikzmagic==0.1.0)
  Using cached pickleshare-0.7.4-py2.py3-none-any.whl
Collecting simplegeneric>0.8 (from ipython->ipython-tikzmagic==0.1.0)
  Using cached simplegeneric-0.8.1.zip
Collecting decorator (from ipython->ipython-tikzmagic==0.1.0)
  Using cached decorator-4.1.2-py2.py3-none-any.whl
Collecting prompt-toolkit<2.0.0,>=1.0.4 (from ipython->ipython-tikzmagic==0.1.0)
  Downloading prompt_toolkit-1.0.15-py2-none-any.whl (247kB)
    100% |████████████████████████████████| 256kB 1.1MB/s
Collecting pexpect; sys_platform != "win32" (from ipython->ipython-tikzmagic==0.1.0)
  Using cached pexpect-4.2.1-py2.py3-none-any.whl
Collecting pathlib2; python_version == "2.7" or python_version == "3.3" (from ipython->ipython-tikzmagic==0.1.0)
  Downloading pathlib2-2.3.0-py2.py3-none-any.whl
Collecting pygments (from ipython->ipython-tikzmagic==0.1.0)
  Using cached Pygments-2.2.0-py2.py3-none-any.whl
Collecting traitlets>=4.2 (from ipython->ipython-tikzmagic==0.1.0)
  Using cached traitlets-4.3.2-py2.py3-none-any.whl
Collecting six>=1.9.0 (from prompt-toolkit<2.0.0,>=1.0.4->ipython->ipython-tikzmagic==0.1.0)
  Using cached six-1.11.0-py2.py3-none-any.whl
Collecting wcwidth (from prompt-toolkit<2.0.0,>=1.0.4->ipython->ipython-tikzmagic==0.1.0)
  Using cached wcwidth-0.1.7-py2.py3-none-any.whl
Collecting ptyprocess>=0.5 (from pexpect; sys_platform != "win32"->ipython->ipython-tikzmagic==0.1.0)
  Using cached ptyprocess-0.5.2-py2.py3-none-any.whl
Collecting scandir; python_version < "3.5" (from pathlib2; python_version == "2.7" or python_version == "3.3"->ipython->ipython-tikzmagic==0.1.0)
  Downloading scandir-1.6.tar.gz
Collecting ipython-genutils (from traitlets>=4.2->ipython->ipython-tikzmagic==0.1.0)
  Using cached ipython_genutils-0.2.0-py2.py3-none-any.whl
Collecting enum34; python_version == "2.7" (from traitlets>=4.2->ipython->ipython-tikzmagic==0.1.0)
  Using cached enum34-1.1.6-py2-none-any.whl
Building wheels for collected packages: simplegeneric, scandir
  Running setup.py bdist_wheel for simplegeneric ... done
  Stored in directory: /home/hblanks/.cache/pip/wheels/7b/31/08/c85e74c84188cbec6a6827beec4d640f2bd78ae003dc1ec09d
  Running setup.py bdist_wheel for scandir ... done
  Stored in directory: /home/hblanks/.cache/pip/wheels/6e/33/69/090d9633efb6fe3c8077c40e1676819ed8d5a59b41cc9a5bea
Successfully built simplegeneric scandir
Installing collected packages: backports.shutil-get-terminal-size, scandir, six, pathlib2, pickleshare, simplegeneric, decorator, wcwidth, prompt-toolkit, ptyprocess, pexpect, pygments, ipython-genutils, enum34, traitlets, ipython, ipython-tikzmagic
  Running setup.py install for ipython-tikzmagic ... done
Successfully installed backports.shutil-get-terminal-size-1.0.0 decorator-4.1.2 enum34-1.1.6 ipython-5.5.0 ipython-genutils-0.2.0 ipython-tikzmagic-0.1.0 pathlib2-2.3.0 pexpect-4.2.1 pickleshare-0.7.4 prompt-toolkit-1.0.15 ptyprocess-0.5.2 pygments-2.2.0 scandir-1.6 simplegeneric-0.8.1 six-1.11.0 traitlets-4.3.2 wcwidth-0.1.7
h