summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2019-11-24 13:38:02 -0800
committerGeorg Brandl <georg@python.org>2019-11-25 18:12:14 +0100
commited97a09b19cb256c6d0081bfb2f96f9d54e6c404 (patch)
tree222080738f18f85146b01fb21b764e589118bea2
parentd53573705c3354dc8fabbb9fef85ffecc817f356 (diff)
downloadpygments-git-ed97a09b19cb256c6d0081bfb2f96f9d54e6c404.tar.gz
Assume setuptools is available
On modern Python installations, setuptools should always be available and should always be preferred. Can remove the fallback to distutils. Replace the pygmentize script with a __main__.py in the package.
-rw-r--r--[-rwxr-xr-x]pygments/__main__.py (renamed from pygmentize)3
-rwxr-xr-xsetup.py30
2 files changed, 5 insertions, 28 deletions
diff --git a/pygmentize b/pygments/__main__.py
index aea38727..cd80a2d3 100755..100644
--- a/pygmentize
+++ b/pygments/__main__.py
@@ -1,7 +1,6 @@
-#!/usr/bin/env python2
-
import sys
import pygments.cmdline
+
try:
sys.exit(pygments.cmdline.main(sys.argv))
except KeyboardInterrupt:
diff --git a/setup.py b/setup.py
index 62f810d3..904c9de1 100755
--- a/setup.py
+++ b/setup.py
@@ -21,31 +21,7 @@ are:
:license: BSD, see LICENSE for details.
"""
-try:
- from setuptools import setup, find_packages
- have_setuptools = True
-except ImportError:
- from distutils.core import setup
- def find_packages(*args, **kwargs):
- return [
- 'pygments',
- 'pygments.lexers',
- 'pygments.formatters',
- 'pygments.styles',
- 'pygments.filters',
- ]
- have_setuptools = False
-
-if have_setuptools:
- add_keywords = dict(
- entry_points = {
- 'console_scripts': ['pygmentize = pygments.cmdline:main'],
- },
- )
-else:
- add_keywords = dict(
- scripts = ['pygmentize'],
- )
+from setuptools import setup, find_packages
setup(
name = 'Pygments',
@@ -58,6 +34,9 @@ setup(
long_description = __doc__,
keywords = 'syntax highlighting',
packages = find_packages(),
+ entry_points = {
+ 'console_scripts': ['pygmentize = pygments.cmdline:main'],
+ },
platforms = 'any',
zip_safe = False,
include_package_data = True,
@@ -82,5 +61,4 @@ setup(
'Topic :: Text Processing :: Filters',
'Topic :: Utilities',
],
- **add_keywords
)