Skip to content

Commit

Permalink
Removing support for python 2.7 (#2)
Browse files Browse the repository at this point in the history
OpenTelemetry doesn't support Python 2.7. Removing it from the tests and removing contrib packages that don't support Python 3. In this change:

- removing pylons contrib
- removing mysqldb contrib
- updating minimum versions of flask (>=1.0), gevent (>=1.1)

Signed-off-by: Alex Boten <aboten@lightstep.com>
  • Loading branch information
codeboten committed Mar 23, 2020
1 parent f13c716 commit ed6dd7f
Show file tree
Hide file tree
Showing 33 changed files with 63 additions and 1,062 deletions.
20 changes: 2 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,17 +202,6 @@ jobs:
- *persist_to_workspace_step
- *save_cache_step

pylons:
docker:
- *test_runner
resource_class: *resource_class
steps:
- checkout
- *restore_cache_step
- run: scripts/run-tox-scenario '^pylons_contrib-'
- *persist_to_workspace_step
- *save_cache_step

aiohttp:
docker:
- *test_runner
Expand Down Expand Up @@ -318,7 +307,7 @@ jobs:
steps:
- checkout
- *restore_cache_step
- run: tox -e 'falcon_contrib{,_autopatch}-{py27,py34,py35,py36}-falcon{10,11,12,13,14}' --result-json /tmp/falcon.results
- run: tox -e 'falcon_contrib{,_autopatch}-{py34,py35,py36}-falcon{10,11,12,13,14}' --result-json /tmp/falcon.results
- *persist_to_workspace_step
- *save_cache_step

Expand Down Expand Up @@ -720,7 +709,7 @@ jobs:
- run:
command: |
mkdir -p /tmp/test-reports
tox -e 'benchmarks-{py27,py34,py35,py36,py37}' --result-json /tmp/benchmarks.results -- --benchmark-storage=file:///tmp/test-reports/ --benchmark-autosave
tox -e 'benchmarks-{py34,py35,py36,py37}' --result-json /tmp/benchmarks.results -- --benchmark-storage=file:///tmp/test-reports/ --benchmark-autosave
- store_test_results:
path: /tmp/test-reports
- store_artifacts:
Expand Down Expand Up @@ -985,10 +974,6 @@ workflows:
requires:
- flake8
- black
- pylons:
requires:
- flake8
- black
- pymemcache:
requires:
- flake8
Expand Down Expand Up @@ -1097,7 +1082,6 @@ workflows:
- opentracer
- psycopg
- pylibmc
- pylons
- pymemcache
- pymongo
- pymysql
Expand Down
3 changes: 1 addition & 2 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import pytest

PY_DIR_PATTERN = re.compile(r"^py[23][0-9]$")
PY_DIR_PATTERN = re.compile(r"^py3[0-9]$")


# Determine if the folder should be ignored
Expand All @@ -27,7 +27,6 @@ def pytest_ignore_collect(path, config):
Example::
File: tests/contrib/vertica/py35/test.py
Python 2.7: Skip
Python 3.4: Skip
Python 3.5: Collect
Python 3.6: Collect
Expand Down
1 change: 0 additions & 1 deletion ddtrace/bootstrap/sitecustomize.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"django": True,
"falcon": True,
"flask": True,
"pylons": True,
"pyramid": True,
}

Expand Down
2 changes: 1 addition & 1 deletion ddtrace/commands/ddtrace_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
DATADOG_TRACE_AGENT_PORT=8126: override the port that the default tracer will submit to (default: 8126)
DATADOG_SERVICE_NAME : override the service name to be used for this program (no default)
This value is passed through when setting up middleware for web framework integrations.
(e.g. pylons, flask, django)
(e.g. flask, django)
For tracing without a web integration, prefer setting the service name in code.
DATADOG_PRIORITY_SAMPLING=true|false : (default: false): enables Priority Sampling.
""" # noqa: E501
Expand Down
14 changes: 0 additions & 14 deletions ddtrace/contrib/flask/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,6 @@ def patch():
for signal in signals:
module = 'flask'

# v0.9 missed importing `appcontext_tearing_down` in `flask/__init__.py`
# https://github.com/pallets/flask/blob/0.9/flask/__init__.py#L35-L37
# https://github.com/pallets/flask/blob/0.9/flask/signals.py#L52
# DEV: Version 0.9 doesn't have a patch version
if flask_version <= (0, 9) and signal == 'appcontext_tearing_down':
module = 'flask.signals'

# DEV: Patch `receivers_for` instead of `connect` to ensure we don't mess with `disconnect`
_w(module, '{}.receivers_for'.format(signal), traced_signal_receivers_for(signal))

Expand Down Expand Up @@ -241,13 +234,6 @@ def unpatch():
# Handle 'flask.request_started.receivers_for'
obj = flask

# v0.9.0 missed importing `appcontext_tearing_down` in `flask/__init__.py`
# https://github.com/pallets/flask/blob/0.9/flask/__init__.py#L35-L37
# https://github.com/pallets/flask/blob/0.9/flask/signals.py#L52
# DEV: Version 0.9 doesn't have a patch version
if flask_version <= (0, 9) and prop == 'appcontext_tearing_down.receivers_for':
obj = flask.signals

if '.' in prop:
attr, _, prop = prop.partition('.')
obj = getattr(obj, attr, object())
Expand Down
32 changes: 0 additions & 32 deletions ddtrace/contrib/pylons/__init__.py

This file was deleted.

8 changes: 0 additions & 8 deletions ddtrace/contrib/pylons/compat.py

This file was deleted.

1 change: 0 additions & 1 deletion ddtrace/contrib/pylons/constants.py

This file was deleted.

110 changes: 0 additions & 110 deletions ddtrace/contrib/pylons/middleware.py

This file was deleted.

41 changes: 0 additions & 41 deletions ddtrace/contrib/pylons/patch.py

This file was deleted.

36 changes: 0 additions & 36 deletions ddtrace/contrib/pylons/renderer.py

This file was deleted.

1 change: 0 additions & 1 deletion ddtrace/monkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
# Ignore some web framework integrations that might be configured explicitly in code
'django': False,
'falcon': False,
'pylons': False,
'pyramid': False,

# Standard library modules off by default
Expand Down
7 changes: 1 addition & 6 deletions docs/advanced_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ Supported web frameworks:
+-------------------+---------+
| :ref:`flask` | True |
+-------------------+---------+
| :ref:`pylons` | True |
+-------------------+---------+
| :ref:`pyramid` | True |
+-------------------+---------+
| :ref:`requests` | True |
Expand Down Expand Up @@ -197,7 +195,6 @@ Enabling APM events for all web frameworks can be accomplished by setting the en
* :ref:`falcon`
* :ref:`flask`
* :ref:`molten`
* :ref:`pylons`
* :ref:`pyramid`
* :ref:`requests`
* :ref:`tornado`
Expand Down Expand Up @@ -238,8 +235,6 @@ For most libraries, APM events can be enabled with the environment variable ``DD
+----------------------+----------------------------------------+
| :ref:`pylibmc` | ``DD_PYLIBMC_ANALYTICS_ENABLED`` |
+----------------------+----------------------------------------+
| :ref:`pylons` | ``DD_PYLONS_ANALYTICS_ENABLED`` |
+----------------------+----------------------------------------+
| :ref:`pymemcache` | ``DD_PYMEMCACHE_ANALYTICS_ENABLED`` |
+----------------------+----------------------------------------+
| :ref:`pymongo` | ``DD_PYMONGO_ANALYTICS_ENABLED`` |
Expand Down Expand Up @@ -564,7 +559,7 @@ The available environment variables for ``ddtrace-run`` are:
the tracer
* ``DATADOG_SERVICE_NAME`` (no default): override the service name to be used
for this program. This value is passed through when setting up middleware for
web framework integrations (e.g. pylons, flask, django). For tracing without a
web framework integrations (e.g. flask, django). For tracing without a
web integration, prefer setting the service name in code.
* ``DATADOG_PATCH_MODULES=module:patch,module:patch...`` e.g.
``boto:true,redis:false``: override the modules patched for this execution of
Expand Down
Loading

0 comments on commit ed6dd7f

Please sign in to comment.