Skip to content

Only import future for py2 #343

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions aws_xray_sdk/core/plugins/ec2_plugin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import json
import logging
from future.standard_library import install_aliases
install_aliases()

from aws_xray_sdk.core.utils.compat import PY2

if PY2:
from future.standard_library import install_aliases
install_aliases()

from urllib.request import urlopen, Request

Expand Down
9 changes: 7 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,13 @@

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()

from aws_xray_sdk.core.utils.compat import PY2

if PY2:
from future.standard_library import install_aliases
install_aliases()

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