pygmentize requires eggy install

Issue #381 resolved
Anonymous created an issue

We currently have a python setup that is egg-free (This due to the fact that eggs are inefficient and uncontrollable for a tightly controlled python environment). We are attempting to use another python tool (Sphinx) that requires the use of Pygments. Unfortunately we are currently unable to use Pygments because the pygmentize script has explicit dependencies on being an egg.

Since not everyone uses eggs is there any way that this dependency can be made optional?

Reported by guest

Comments (5)

  1. gbrandl

    It's not the pygmentize script that depends on being installed as an egg. Rather, the setup.py depends on setuptools and installs a "pygmentize" script via setuptools' console_scripts facility.

    Do you need not to use setuptools at all?

  2. Anonymous

    I realize that the installation requires setuptools and in our setup we can deal with that for installing packages (although a more standard mechanism would be preferred :) ). When dealing with other packages that have dependencies on setuptools the end packages can be extracted from the egg and used in a correct and standard python manner compliant with our run-time setup.

    In the case of the pygmentize executable the first thing it does is import pkg_resources from setuptools, this creates a dependency on setuptools beyond actual installation of the product. Additionally the 'load_entry_point' function, originally intended to be used for "plugin hooks" of add-on modules, performs a dictionary look-up of data contained in the egg-specific metadata that is lost when turning pygmentize into a real, stand-alone python module.

    Is it possible to make pygmentize not depend on setuptools for anything other than installation?

  3. thatch

    If you extract the Pygments tarball, add it to your `PYTHONPATH`, and use the pygmentize script that it comes with you should be fine. This way does not use setuptools, and does not use load_entry_point either.

  4. Log in to comment