Skip to content

Commit

Permalink
Only import for py2
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanielRN committed Jun 23, 2022
1 parent 816ab26 commit c45c8e6
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
7 changes: 5 additions & 2 deletions aws_xray_sdk/core/plugins/ec2_plugin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import json
import logging
from future.standard_library import install_aliases
install_aliases()
try:
from future.standard_library import install_aliases
install_aliases()
except ImportError:
pass

from urllib.request import urlopen, Request

Expand Down
10 changes: 8 additions & 2 deletions aws_xray_sdk/ext/sqlalchemy/util/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@

from aws_xray_sdk.core import xray_recorder
from aws_xray_sdk.ext.util import strip_url
from future.standard_library import install_aliases
install_aliases()

try:
from future.standard_library import install_aliases

install_aliases()
except ImportError:
pass

from urllib.parse import urlparse, uses_netloc
from sqlalchemy.engine.base import Connection

Expand Down
18 changes: 12 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import sys

from setuptools import setup, find_packages
from os import path
from aws_xray_sdk.version import VERSION
Expand All @@ -12,6 +14,15 @@

long_description = read_md(path.join(CURRENT_DIR, 'README.md'))

INSTALL_REQUIRED_DEPS = [
'enum34;python_version<"3.4"',
'wrapt',
'botocore>=1.11.3',
]

if sys.version_info[0] == 2:
INSTALL_REQUIRED_DEPS.append("future")

setup(
name='aws-xray-sdk',
version=VERSION,
Expand Down Expand Up @@ -44,12 +55,7 @@
'Programming Language :: Python :: 3.9',
],

install_requires=[
'enum34;python_version<"3.4"',
'wrapt',
'future',
'botocore>=1.11.3',
],
install_requires=INSTALL_REQUIRED_DEPS,

keywords='aws xray sdk',

Expand Down

0 comments on commit c45c8e6

Please sign in to comment.