Skip to content

Commit

Permalink
Black format and docker changes
Browse files Browse the repository at this point in the history
  • Loading branch information
fbanados committed Oct 18, 2024
1 parent d6ee8c9 commit 8af20d3
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 24 deletions.
6 changes: 3 additions & 3 deletions docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ production: db.sqlite3 .env
docker-compose up --build

.PHONY: staging
staging: .env ../src/CreeDictionary/test_db.sqlite3
ln -f ../src/CreeDictionary/test_db.sqlite3 ./db.sqlite3
staging: .env ../src/crkeng/db/test_db.sqlite3
ln -f ../src/crkeng/db/test_db.sqlite3 ./db.sqlite3
docker-compose up --build

.PHONY: unit-file
Expand Down Expand Up @@ -58,6 +58,6 @@ db.sqlite3:
-echo '#' Creating an empty .env file
touch $@

../src/CreeDictionary/test_db.sqlite3:
../src/crkeng/db/test_db.sqlite3:
@echo '# Creating the test database by running the unit tests'
cd .. && pipenv run pytest
2 changes: 1 addition & 1 deletion docker/docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ services:

- "/data_local/application-data/crkeng-dev/vector_models:/app/src/crkeng/resources/vector_models/"
- "/data_local/application-data/crkeng-dev/db:/app/src/crkeng/db/"
- "/data_local/application-data/crkeng-dev/search_quality:/app/src/crkeng/CreeDictionary/search_quality/"
- "/data_local/application-data/crkeng-dev/search_quality:/app/src/crkeng/morphodict/search_quality/"
14 changes: 7 additions & 7 deletions docker/docker-compose.staging-override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ services:
- "./.env:/app/.env"
- "../src/crkeng/resources/vector_models/:/app/src/crkeng/resources/vector_models/"
- "../src/crkeng/db/:/app/src/crkeng/db/"
- "../src/crkeng/CreeDictionary/search_quality/:/app/src/crkeng/CreeDictionary/search_quality/"
- "../src/crkeng/morphodict/search_quality/:/app/src/crkeng/morphodict/search_quality/"

cwdeng:
# In prod, we *always* want the apps running, including on boot; that’s
Expand All @@ -44,7 +44,7 @@ services:
- "./.env:/app/.env"
- "../src/cwdeng/resources/vector_models/:/app/src/cwdeng/resources/vector_models/"
- "../src/cwdeng/db/:/app/src/cwdeng/db/"
- "../src/cwdeng/CreeDictionary/search_quality/:/app/src/cwdeng/CreeDictionary/search_quality/"
- "../src/cwdeng/morphodict/search_quality/:/app/src/cwdeng/morphodict/search_quality/"

srseng:
# In prod, we *always* want the apps running, including on boot; that’s
Expand All @@ -60,7 +60,7 @@ services:
- "./.env:/app/.env"
- "../src/srseng/resources/vector_models/:/app/src/srseng/resources/vector_models/"
- "../src/srseng/db/:/app/src/srseng/db/"
- "../src/srseng/CreeDictionary/search_quality/:/app/src/srseng/CreeDictionary/search_quality/"
- "../src/srseng/morphodict/search_quality/:/app/src/srseng/morphodict/search_quality/"

arpeng:
# In prod, we *always* want the apps running, including on boot; that’s
Expand All @@ -76,7 +76,7 @@ services:
- "./.env:/app/.env"
- "../src/arpeng/resources/vector_models/:/app/src/arpeng/resources/vector_models/"
- "../src/arpeng/db/:/app/src/arpeng/db/"
- "../src/arpeng/CreeDictionary/search_quality/:/app/src/arpeng/CreeDictionary/search_quality/"
- "../src/arpeng/morphodict/search_quality/:/app/src/arpeng/morphodict/search_quality/"

hdneng:
# In prod, we *always* want the apps running, including on boot; that’s
Expand All @@ -92,7 +92,7 @@ services:
- "./.env:/app/.env"
- "../src/hdneng/resources/vector_models/:/app/src/hdneng/resources/vector_models/"
- "../src/hdneng/db/:/app/src/hdneng/db/"
- "../src/hdneng/CreeDictionary/search_quality/:/app/src/hdneng/CreeDictionary/search_quality/"
- "../src/hdneng/morphodict/search_quality/:/app/src/hdneng/morphodict/search_quality/"

crkLacombeeng:
# In prod, we *always* want the apps running, including on boot; that’s
Expand All @@ -108,7 +108,7 @@ services:
- "./.env:/app/.env"
- "../src/crkLacombeeng/resources/vector_models/:/app/src/crkLacombeeng/resources/vector_models/"
- "../src/crkLacombeeng/db/:/app/src/crkLacombeeng/db/"
- "../src/crkLacombeeng/CreeDictionary/search_quality/:/app/src/crkLacombeeng/CreeDictionary/search_quality/"
- "../src/crkLacombeeng/morphodict/search_quality/:/app/src/crkLacombeeng/morphodict/search_quality/"

blaeng:
# In prod, we *always* want the apps running, including on boot; that’s
Expand All @@ -124,5 +124,5 @@ services:
- "./.env:/app/.env"
- "../src/blaeng/resources/vector_models/:/app/src/blaeng/resources/vector_models/"
- "../src/blaeng/db/:/app/src/blaeng/db/"
- "../src/blaeng/CreeDictionary/search_quality/:/app/src/blaeng/CreeDictionary/search_quality/"
- "../src/blaeng/morphodict/search_quality/:/app/src/blaeng/morphodict/search_quality/"

14 changes: 7 additions & 7 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ services:

- "/data_local/application-data/crkeng/vector_models:/app/src/crkeng/resources/vector_models/"
- "/data_local/application-data/crkeng/db:/app/src/crkeng/db/"
- "/data_local/application-data/crkeng/search_quality:/app/src/crkeng/CreeDictionary/search_quality/"
- "/data_local/application-data/crkeng/search_quality:/app/src/crkeng/morphodict/search_quality/"
cwdeng:
restart: always
# Specify hostname to make it clearer which container is active when
Expand All @@ -50,7 +50,7 @@ services:

- "/data_local/application-data/cwdeng/vector_models:/app/src/cwdeng/resources/vector_models/"
- "/data_local/application-data/cwdeng/db:/app/src/cwdeng/db/"
- "/data_local/application-data/cwdeng/search_quality:/app/src/cwdeng/CreeDictionary/search_quality/"
- "/data_local/application-data/cwdeng/search_quality:/app/src/cwdeng/morphodict/search_quality/"
srseng:
restart: always
# Specify hostname to make it clearer which container is active when
Expand All @@ -73,7 +73,7 @@ services:

- "/data_local/application-data/srseng/vector_models:/app/src/srseng/resources/vector_models/"
- "/data_local/application-data/srseng/db:/app/src/srseng/db/"
- "/data_local/application-data/srseng/search_quality:/app/src/srseng/CreeDictionary/search_quality/"
- "/data_local/application-data/srseng/search_quality:/app/src/srseng/morphodict/search_quality/"
arpeng:
restart: always
# Specify hostname to make it clearer which container is active when
Expand All @@ -96,7 +96,7 @@ services:

- "/data_local/application-data/arpeng/vector_models:/app/src/arpeng/resources/vector_models/"
- "/data_local/application-data/arpeng/db:/app/src/arpeng/db/"
- "/data_local/application-data/arpeng/search_quality:/app/src/arpeng/CreeDictionary/search_quality/"
- "/data_local/application-data/arpeng/search_quality:/app/src/arpeng/morphodict/search_quality/"
hdneng:
restart: always
# Specify hostname to make it clearer which container is active when
Expand All @@ -119,7 +119,7 @@ services:

- "/data_local/application-data/hdneng/vector_models:/app/src/hdneng/resources/vector_models/"
- "/data_local/application-data/hdneng/db:/app/src/hdneng/db/"
- "/data_local/application-data/hdneng/search_quality:/app/src/hdneng/CreeDictionary/search_quality/"
- "/data_local/application-data/hdneng/search_quality:/app/src/hdneng/morphodict/search_quality/"
crkLacombeeng:
restart: always
# Specify hostname to make it clearer which container is active when
Expand All @@ -142,7 +142,7 @@ services:

- "/data_local/application-data/crkLacombeeng/vector_models:/app/src/crkLacombeeng/resources/vector_models/"
- "/data_local/application-data/crkLacombeeng/db:/app/src/crkLacombeeng/db/"
- "/data_local/application-data/crkLacombeeng/search_quality:/app/src/crkLacombeeng/CreeDictionary/search_quality/"
- "/data_local/application-data/crkLacombeeng/search_quality:/app/src/crkLacombeeng/morphodict/search_quality/"
blaeng:
restart: always
# Specify hostname to make it clearer which container is active when
Expand All @@ -165,4 +165,4 @@ services:

- "/data_local/application-data/blaeng/vector_models:/app/src/blaeng/resources/vector_models/"
- "/data_local/application-data/blaeng/db:/app/src/blaeng/db/"
- "/data_local/application-data/blaeng/search_quality:/app/src/blaeng/CreeDictionary/search_quality/"
- "/data_local/application-data/blaeng/search_quality:/app/src/blaeng/morphodict/search_quality/"
2 changes: 1 addition & 1 deletion docker/helpers/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def data_mounts(self):
return [
DataMount(self, "resources/vector_models/"),
DataMount(self, "db/"),
DataMount(self, "CreeDictionary/search_quality/"),
DataMount(self, "morphodict/search_quality/"),
]


Expand Down
1 change: 0 additions & 1 deletion src/CreeDictionary/CreeDictionary/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
################################# Special URLS #################################
# Reverse URLs in JavaScript: https://github.com/ierror/django-js-reverse
path("jsreverse", urls_js, name="js_reverse"),

]

if hasattr(settings, "GOOGLE_SITE_VERIFICATION"):
Expand Down
4 changes: 2 additions & 2 deletions src/morphodict/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
################################ Click in text #################################
# cree word translation for click-in-text
urlpatterns = [
path(
path(
"click-in-text/",
api_views.click_in_text,
name="cree-dictionary-word-click-in-text-api",
Expand All @@ -14,4 +14,4 @@
api_views.click_in_text_embedded_test,
name="cree-dictionary-click-in-text-embedded-test",
),
]
]
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import django.db.models.deletion
from django.conf import settings


def change_example_to_production_site(apps, schema_editor):
"""
Changes the example.com site to the current site domain.
Expand All @@ -14,7 +15,9 @@ def change_example_to_production_site(apps, schema_editor):

if not created:
# See: https://github.com/django/django/blob/876dc0c1a7dbf569782eb64f62f339c1daeb75e0/django/contrib/sites/management.py#L11-L38
print(f"overwriting the site {site.domain} (displayed {site.name}) with new site {settings.PRODUCTION_HOST}")
print(
f"overwriting the site {site.domain} (displayed {site.name}) with new site {settings.PRODUCTION_HOST}"
)

site.name = site.domain = settings.PRODUCTION_HOST
site.save()
Expand All @@ -26,7 +29,7 @@ class Migration(migrations.Migration):

dependencies = [
("sites", "0002_alter_domain_unique"),
('lexicon', '0008_add_semantic_fields'),
("lexicon", "0008_add_semantic_fields"),
]

operations = [
Expand Down

0 comments on commit 8af20d3

Please sign in to comment.