Browse Source

ref: enable the django-stubs plugin part (#50573)

<!-- Describe your PR here. -->
anthony sottile 1 year ago
parent
commit
8847e35f27
4 changed files with 73 additions and 164 deletions
  1. 5 0
      .github/workflows/backend.yml
  2. 61 162
      pyproject.toml
  3. 5 0
      src/sentry/conf/server_mypy.py
  4. 2 2
      src/sentry/runner/__init__.py

+ 5 - 0
.github/workflows/backend.yml

@@ -461,6 +461,11 @@ jobs:
           cache-dependency-path: requirements-dev-frozen.txt
           install-cmd: pip install -r requirements-dev-frozen.txt
 
+      - name: setup sentry (lite)
+        run: |
+          SENTRY_LIGHT_BUILD=1 pip install --no-deps -e .
+          sentry init
+
       - run: make backend-typing
         id: run
 

File diff suppressed because it is too large
+ 61 - 162
pyproject.toml


+ 5 - 0
src/sentry/conf/server_mypy.py

@@ -0,0 +1,5 @@
+from sentry.runner import configure
+
+configure(skip_service_validation=True)
+
+from sentry.conf.server import *  # noqa: F401, F403

+ 2 - 2
src/sentry/runner/__init__.py

@@ -105,7 +105,7 @@ def make_django_command(name, django_command=None, help=None):
 cli.add_command(make_django_command("shell", help="Run a Python interactive interpreter."))
 
 
-def configure():
+def configure(*, skip_service_validation: bool = False):
     """
     Kick things off and configure all the things.
 
@@ -122,7 +122,7 @@ def configure():
     _, py, yaml = discover_configs()
 
     # TODO(mattrobenolt): Surface this also as a CLI option?
-    skip_service_validation = (
+    skip_service_validation = skip_service_validation or (
         "SENTRY_SKIP_BACKEND_VALIDATION" in os.environ
         or "SENTRY_SKIP_SERVICE_VALIDATION" in os.environ
     )

Some files were not shown because too many files changed in this diff