[381] ICreate highly-automated setup.sh to bootstrap local dev environment#468
Open
ToryMic wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a root-level script that bootstraps the local development environment by creating from the example, generating a secure , and starting the Docker Compose stack.
Changes
Testing
INFO: Updated SECRET_KEY in /tmp/tmp.465p5PwqvC/django-backend/.env.
INFO: Bootstrap completed.
INFO: Run './setup.sh' again to launch Docker Compose services.
PASS: .env created and SECRET_KEY generated.
INFO: /tmp/tmp.465p5PwqvC/django-backend/.env already exists. Leaving existing configuration in place.
INFO: SECRET_KEY already set in /tmp/tmp.465p5PwqvC/django-backend/.env.
INFO: Bootstrap completed.
INFO: Run './setup.sh' again to launch Docker Compose services.
PASS: Existing SECRET_KEY is preserved.
All setup script tests passed. passes
==================================== ERRORS ====================================
____________ ERROR collecting django-backend/soroscan/ingest/tests _____________
/usr/lib/python3.13/importlib/init.py:88: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
:1387: in _gcd_import
???
:1360: in _find_and_load
???
:1331: in _find_and_load_unlocked
???
:935: in _load_unlocked
???
django-backend/.venv/lib/python3.13/site-packages/_pytest/assertion/rewrite.py:186: in exec_module
exec(co, module.dict)
django-backend/soroscan/ingest/tests/conftest.py:2: in
from .factories import UserFactory, TrackedContractFactory
django-backend/soroscan/ingest/tests/factories.py:5: in
from soroscan.ingest.models import (
django-backend/soroscan/ingest/models.py:13: in
User = get_user_model()
^^^^^^^^^^^^^^^^
django-backend/.venv/lib/python3.13/site-packages/django/contrib/auth/init.py:283: in get_user_model
return django_apps.get_model(settings.AUTH_USER_MODEL, require_ready=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
django-backend/.venv/lib/python3.13/site-packages/django/apps/registry.py:203: in get_model
self.check_apps_ready()
django-backend/.venv/lib/python3.13/site-packages/django/apps/registry.py:138: in check_apps_ready
raise AppRegistryNotReady("Apps aren't loaded yet.")
E django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
____________ ERROR collecting django-backend/soroscan/urls_test.py _____________
django-backend/soroscan/urls_test.py:14: in
from soroscan.ingest.views import contract_status, rate_limit_analytics_view
django-backend/soroscan/ingest/views.py:30: in
from .models import (
django-backend/soroscan/ingest/models.py:13: in
User = get_user_model()
^^^^^^^^^^^^^^^^
django-backend/.venv/lib/python3.13/site-packages/django/contrib/auth/init.py:283: in get_user_model
return django_apps.get_model(settings.AUTH_USER_MODEL, require_ready=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
django-backend/.venv/lib/python3.13/site-packages/django/apps/registry.py:203: in get_model
self.check_apps_ready()
django-backend/.venv/lib/python3.13/site-packages/django/apps/registry.py:138: in check_apps_ready
raise AppRegistryNotReady("Apps aren't loaded yet.")
E django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
_______________ ERROR collecting django-backend/test_results.txt _______________
/usr/lib/python3.13/pathlib/_local.py:548: in read_text
return PathBase.read_text(self, encoding, errors, newline)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3.13/pathlib/_abc.py:633: in read_text
return f.read()
^^^^^^^^
:325: in decode
???
E UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
____________ ERROR collecting sdk/python/tests/test_async_client.py ____________
ImportError while importing test module '/tmp/soroscan/sdk/python/tests/test_async_client.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.13/importlib/init.py:88: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sdk/python/tests/test_async_client.py:4: in
from pytest_httpx import HTTPXMock
E ModuleNotFoundError: No module named 'pytest_httpx'
_______________ ERROR collecting sdk/python/tests/test_client.py _______________
ImportError while importing test module '/tmp/soroscan/sdk/python/tests/test_client.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.13/importlib/init.py:88: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sdk/python/tests/test_client.py:4: in
from pytest_httpx import HTTPXMock
E ModuleNotFoundError: No module named 'pytest_httpx'
____________ ERROR collecting sdk/python/tests/test_integration.py _____________
ImportError while importing test module '/tmp/soroscan/sdk/python/tests/test_integration.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.13/importlib/init.py:88: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sdk/python/tests/test_integration.py:8: in
from pytest_httpx import HTTPXMock
E ModuleNotFoundError: No module named 'pytest_httpx'
_______________ ERROR collecting sdk/python/tests/test_models.py _______________
ImportError while importing test module '/tmp/soroscan/sdk/python/tests/test_models.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.13/importlib/init.py:88: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sdk/python/tests/test_models.py:8: in
from soroscan.models import (
E ModuleNotFoundError: No module named 'soroscan.models'
=========================== short test summary info ============================
ERROR django-backend/soroscan/ingest/tests - django.core.exceptions.AppRegist...
ERROR django-backend/soroscan/urls_test.py - django.core.exceptions.AppRegist...
ERROR django-backend/test_results.txt - UnicodeDecodeError: 'utf-8' codec can...
ERROR sdk/python/tests/test_async_client.py
ERROR sdk/python/tests/test_client.py
ERROR sdk/python/tests/test_integration.py
ERROR sdk/python/tests/test_models.py
!!!!!!!!!!!!!!!!!!! Interrupted: 7 errors during collection !!!!!!!!!!!!!!!!!!!!
7 errors in 2.94s in and observed existing backend tests pass
Closes 381