Browse Source

chore(py38): remove unused dependencies (#24276)

josh 4 years ago
parent
commit
901e552a05
5 changed files with 5 additions and 48 deletions
  1. 1 1
      Makefile
  2. 3 8
      requirements-base.txt
  3. 1 2
      requirements-dev.txt
  4. 0 7
      src/sentry/utils/pytest/selenium.py
  5. 0 30
      src/sentry/utils/sqlparser.py

+ 1 - 1
Makefile

@@ -128,7 +128,7 @@ fetch-release-registry:
 
 run-acceptance:
 	@echo "--> Running acceptance tests"
-	py.test tests/acceptance --cov . --cov-report="xml:.artifacts/acceptance.coverage.xml" --junit-xml=".artifacts/acceptance.junit.xml" --html=".artifacts/acceptance.pytest.html" --self-contained-html
+	py.test tests/acceptance --cov . --cov-report="xml:.artifacts/acceptance.coverage.xml" --junit-xml=".artifacts/acceptance.junit.xml"
 	@echo ""
 
 test-cli:

+ 3 - 8
requirements-base.txt

@@ -31,7 +31,6 @@ Pillow==8.1.0
 progressbar2==3.32.0
 psycopg2-binary==2.7.7
 PyJWT==1.5.3
-pyrsistent==0.17.3
 python-dateutil>=2.0.0,<3.0.0
 python-memcached==1.59
 python-u2flib-server==5.0.0
@@ -49,7 +48,6 @@ rfc3986-validator==0.1.1
 sentry-relay==0.8.4
 sentry-sdk>=0.20.0,<0.21.0
 simplejson==3.11.1
-sqlparse==0.2.4
 statsd==3.1
 structlog==17.1.0
 symbolic==8.0.3
@@ -74,8 +72,6 @@ grpcio==1.35.0
 # not directly used, but provides a speedup for redis
 hiredis==0.3.1
 
-
-
 # not directly used, but pinned for at least semaphore/symbolic
 cffi==1.12.2
 
@@ -83,14 +79,13 @@ cffi==1.12.2
 cssutils==1.0.2
 cssselect==1.0.3
 
-# not directly used, but needed
-setproctitle==1.1.10
-
 # sentry-plugins specific dependencies
 phabricator==0.7.0
 
-# test dependencies, but unable to move to requirements-test until sentry.utils.pytest and similar are moved to tests/
+# test dependencies, but unable to move to requirements-test until
+# sentry.utils.pytest and sentry.testutils are moved to tests/
 selenium==3.141.0
+sqlparse==0.2.4
 # We're still using mock in Python 3.6 because it contains a fix to Python issue37972.
 # We should be able to fully swap it out for stdlib once we're on 3.8.
 mock==4.0.3

+ 1 - 2
requirements-dev.txt

@@ -6,8 +6,7 @@ openapi-core @ https://github.com/getsentry/openapi-core/archive/master.zip#egg=
 pytest==4.6.5
 pytest-cov==2.5.1
 pytest-django==3.5.1
-pytest-html==1.22.0
 pytest-sentry==0.1.6
 pytest-rerunfailures==8.0
 responses>=0.8.1,<0.9.0
-werkzeug==0.15.5
+sqlparse==0.2.4

+ 0 - 7
src/sentry/utils/pytest/selenium.py

@@ -515,13 +515,6 @@ def browser(request, live_server):
     return driver
 
 
-@pytest.fixture(scope="session", autouse=True)
-def _environment(request):
-    config = request.config
-    # add environment details to the pytest-html plugin
-    config._metadata.update({"Driver": config.option.selenium_driver})
-
-
 @pytest.hookimpl(tryfirst=True, hookwrapper=True)
 def pytest_runtest_makereport(item, call):
     outcome = yield

+ 0 - 30
src/sentry/utils/sqlparser.py

@@ -1,30 +0,0 @@
-from sqlparse import engine
-from sqlparse import filters
-from sqlparse import tokens as T
-
-
-class ValueFilter(filters.TokenFilter):
-    include = (T.String, T.Number)
-    exclude = (T.String.Symbol,)
-
-    def process(self, stack, stream):
-        for ttype, value in stream:
-            parent = ttype
-            while parent:
-                if parent in self.exclude:
-                    break
-                if parent in self.include:
-                    value = "?"
-                    break
-                if ttype.parent == parent:
-                    parent = None
-                else:
-                    parent = ttype.parent
-            yield ttype, value
-
-
-def parse(query):
-    stack = engine.FilterStack()
-    stack.preprocess.append(ValueFilter())
-    stack.postprocess.append(filters.SerializerUnicode())
-    return "".join(stack.run(query))