summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2015-10-08 13:24:36 +0200
committerAnthon van der Neut <anthon@mnt.org>2015-10-08 13:24:36 +0200
commitd444338e4438323535476461414e1652bdd75cb3 (patch)
tree5d89094b84255ca652966457403fcb50d618ba4e /setup.py
parent5bccee8a4c79f291e54b73f8f2bc0b711994f81f (diff)
downloadruamel.yaml-d444338e4438323535476461414e1652bdd75cb3.tar.gz
Jython compatibility
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/setup.py b/setup.py
index 933e5e6..4e9407b 100644
--- a/setup.py
+++ b/setup.py
@@ -13,6 +13,7 @@ full_package_name = None
# # __init__.py parser
import sys
+import platform
from _ast import * # NOQA
from ast import parse
@@ -30,7 +31,7 @@ if sys.version_info < (3, 4):
class NameConstant:
pass
-if sys.version_info < (2, 7):
+if sys.version_info < (2, 7) or platform.python_implementation() == 'Jython':
class Set():
pass
@@ -160,8 +161,6 @@ exclude_files = [
# # imports
import os
-import sys
-import platform
from setuptools import setup, Extension, Distribution # NOQA
from setuptools.command import install_lib
@@ -231,7 +230,7 @@ class NameSpacePackager(object):
self._pkg = [None, None] # required and pre-installable packages
if sys.argv[0] == 'setup.py' and sys.argv[1] == 'install' and \
'--single-version-externally-managed' not in sys.argv:
- print('error: have to install with "pip install ."')
+ print('error: you have to install with "pip install ."')
sys.exit(1)
# If you only support an extension module on Linux, Windows thinks it
# is pure. That way you would get pure python .whl files that take
@@ -471,6 +470,8 @@ class NameSpacePackager(object):
pyver = 'py{0}{1}'.format(*sys.version_info)
elif implementation == 'PyPy':
pyver = 'pypy' if sys.version_info < (3, ) else 'pypy3'
+ elif implementation == 'Jython':
+ pyver = 'jython'
packages.extend(ir.get(pyver, []))
for p in packages:
# package name starting with * means use local source tree, non-published
@@ -510,8 +511,10 @@ class NameSpacePackager(object):
return self._ext_modules
if '--version' in sys.argv:
return None
- # if sys.platform == "win32":
- # return None
+ if platform.python_implementation() == 'Jython':
+ return None
+ if sys.platform == "win32":
+ return None
import tempfile
import shutil
from textwrap import dedent