From ba22d5a8cb382b7f2cfb0c7896d8e7766ee48711 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Sun, 19 Dec 2021 21:41:20 +0100 Subject: [PATCH] Reorganize repo --- Dockerfile | 6 +-- README.md | 3 +- docker/nginx.conf | 42 ------------------ docker/run.sh | 1 - docker/runtests.sh | 5 --- pyproject.toml | 36 +++++++-------- {articles => src/articles}/__init__.py | 0 {articles => src/articles}/admin.py | 0 {articles => src/articles}/apps.py | 0 .../articles}/context_processors.py | 0 {articles => src/articles}/markdown.py | 0 .../articles}/migrations/0001_initial.py | 0 .../articles}/migrations/0002_article.py | 0 .../migrations/0003_auto_20200814_1522.py | 0 .../migrations/0004_article_views_count.py | 0 .../articles}/migrations/0005_article_slug.py | 0 .../articles}/migrations/0006_page.py | 0 .../migrations/0007_auto_20200817_0941.py | 0 .../migrations/0008_auto_20200817_1748.py | 0 .../articles}/migrations/0009_comment.py | 0 .../migrations/0010_auto_20200818_1825.py | 0 .../migrations/0011_auto_20200818_1829.py | 0 .../migrations/0012_auto_20200818_1845.py | 0 .../migrations/0013_auto_20200818_1912.py | 0 .../migrations/0014_auto_20200818_1952.py | 0 .../migrations/0015_auto_20200818_2138.py | 0 .../migrations/0016_comment_user_notified.py | 0 .../migrations/0017_auto_20200820_1606.py | 0 .../migrations/0018_auto_20200821_1232.py | 0 .../0019_article_comments_allowed.py | 0 .../migrations/0020_auto_20200903_2157.py | 0 .../migrations/0021_auto_20201110_1623.py | 0 .../migrations/0022_article_keywords.py | 0 .../migrations/0023_article_has_code.py | 0 .../migrations/0024_auto_20201224_1746.py | 0 .../migrations/0025_article_custom_css.py | 0 .../migrations/0026_article_draft_key.py | 0 .../migrations/0027_auto_20210303_1633.py | 0 .../0028_remove_article_keywords.py | 0 .../migrations/0029_auto_20210303_1711.py | 0 .../articles}/migrations/0030_tag_slug.py | 0 .../migrations/0031_auto_20210306_1449.py | 0 .../migrations/0032_auto_20210306_1449.py | 0 .../articles}/migrations/__init__.py | 0 {articles => src/articles}/models.py | 0 .../articles}/static/admin_articles.css | 0 .../articles}/static/admonitions.css | 0 .../articles}/static/authenticated.css | 0 .../articles}/static/copy-code.js | 0 .../articles}/static/edit-keymap.js | 0 .../static/icons/android-chrome-96x96.png | Bin .../static/icons/apple-touch-icon.png | Bin .../articles}/static/icons/browserconfig.xml | 0 .../articles}/static/icons/favicon-16x16.png | Bin .../articles}/static/icons/favicon-32x32.png | Bin .../articles}/static/icons/favicon.ico | Bin .../articles}/static/icons/mstile-150x150.png | Bin .../static/icons/safari-pinned-tab.svg | 0 .../articles}/static/icons/site.webmanifest | 0 .../articles}/static/live-preview.js | 0 {articles => src/articles}/static/public.css | 0 .../articles}/static/vendor/codehilite.css | 0 .../articles}/static/vendor/goatcounter.js | 0 .../articles}/static/vendor/newcss.css | 0 .../admin/articles/article/submit_line.html | 0 .../articles/article_change_form.html | 0 .../templates/articles/article_detail.html | 0 .../templates/articles/article_list.html | 0 .../templates/articles/article_search.html | 0 .../articles}/templates/articles/base.html | 0 .../articles/snippets/admin_link.html | 0 .../articles/snippets/analytics.html | 0 .../articles/snippets/analytics_head.html | 0 .../templates/articles/snippets/datetime.html | 0 .../templates/articles/snippets/favicon.html | 0 .../templates/articles/snippets/metadata.html | 0 .../articles/snippets/navigation.html | 0 .../articles/snippets/page_metadata.html | 0 {articles => src/articles}/tests/__init__.py | 0 {articles => src/articles}/tests/conftest.py | 0 .../articles}/tests/test_admin.py | 0 .../articles}/tests/test_api_views.py | 0 .../articles}/tests/test_feed_views.py | 0 .../articles}/tests/test_html_views.py | 0 .../articles}/tests/test_migrations.py | 0 .../articles}/tests/test_models.py | 0 {articles => src/articles}/urls.py | 0 {articles => src/articles}/utils.py | 0 {articles => src/articles}/views/__init__.py | 0 {articles => src/articles}/views/api.py | 0 {articles => src/articles}/views/feeds.py | 0 {articles => src/articles}/views/html.py | 0 {attachments => src/attachments}/__init__.py | 0 {attachments => src/attachments}/admin.py | 0 {attachments => src/attachments}/apps.py | 0 .../commands/reprocess_all_attachments.py | 0 .../attachments}/migrations/0001_initial.py | 0 .../migrations/0002_auto_20200826_1814.py | 0 .../migrations/0003_auto_20200826_1843.py | 0 .../migrations/0004_auto_20200903_2116.py | 0 .../0005_attachment_open_graph_image.py | 0 .../migrations/0006_auto_20201128_2022.py | 0 .../migrations/0007_auto_20201201_1917.py | 0 .../attachments}/migrations/__init__.py | 0 {attachments => src/attachments}/models.py | 0 .../static/attachments/js/copy_url.js | 0 .../attachments}/tests/__init__.py | 0 ...attachment_is_processed_by_shortpixel.yaml | 0 .../attachments}/tests/conftest.py | 0 .../attachments}/tests/resources/image.png | Bin .../attachments}/tests/test_models.py | 0 {blog => src/blog}/__init__.py | 0 {blog => src/blog}/asgi.py | 0 {blog => src/blog}/settings.py | 0 .../blog}/templates/admin/base_site.html | 0 {blog => src/blog}/templates/blog/robots.txt | 0 {blog => src/blog}/tests/__init__.py | 0 {blog => src/blog}/tests/test_robots.py | 0 {blog => src/blog}/urls.py | 0 {blog => src/blog}/wsgi.py | 0 manage.py => src/manage.py | 0 tasks.py | 12 +++-- 122 files changed, 29 insertions(+), 76 deletions(-) delete mode 100644 docker/nginx.conf delete mode 100755 docker/runtests.sh rename {articles => src/articles}/__init__.py (100%) rename {articles => src/articles}/admin.py (100%) rename {articles => src/articles}/apps.py (100%) rename {articles => src/articles}/context_processors.py (100%) rename {articles => src/articles}/markdown.py (100%) rename {articles => src/articles}/migrations/0001_initial.py (100%) rename {articles => src/articles}/migrations/0002_article.py (100%) rename {articles => src/articles}/migrations/0003_auto_20200814_1522.py (100%) rename {articles => src/articles}/migrations/0004_article_views_count.py (100%) rename {articles => src/articles}/migrations/0005_article_slug.py (100%) rename {articles => src/articles}/migrations/0006_page.py (100%) rename {articles => src/articles}/migrations/0007_auto_20200817_0941.py (100%) rename {articles => src/articles}/migrations/0008_auto_20200817_1748.py (100%) rename {articles => src/articles}/migrations/0009_comment.py (100%) rename {articles => src/articles}/migrations/0010_auto_20200818_1825.py (100%) rename {articles => src/articles}/migrations/0011_auto_20200818_1829.py (100%) rename {articles => src/articles}/migrations/0012_auto_20200818_1845.py (100%) rename {articles => src/articles}/migrations/0013_auto_20200818_1912.py (100%) rename {articles => src/articles}/migrations/0014_auto_20200818_1952.py (100%) rename {articles => src/articles}/migrations/0015_auto_20200818_2138.py (100%) rename {articles => src/articles}/migrations/0016_comment_user_notified.py (100%) rename {articles => src/articles}/migrations/0017_auto_20200820_1606.py (100%) rename {articles => src/articles}/migrations/0018_auto_20200821_1232.py (100%) rename {articles => src/articles}/migrations/0019_article_comments_allowed.py (100%) rename {articles => src/articles}/migrations/0020_auto_20200903_2157.py (100%) rename {articles => src/articles}/migrations/0021_auto_20201110_1623.py (100%) rename {articles => src/articles}/migrations/0022_article_keywords.py (100%) rename {articles => src/articles}/migrations/0023_article_has_code.py (100%) rename {articles => src/articles}/migrations/0024_auto_20201224_1746.py (100%) rename {articles => src/articles}/migrations/0025_article_custom_css.py (100%) rename {articles => src/articles}/migrations/0026_article_draft_key.py (100%) rename {articles => src/articles}/migrations/0027_auto_20210303_1633.py (100%) rename {articles => src/articles}/migrations/0028_remove_article_keywords.py (100%) rename {articles => src/articles}/migrations/0029_auto_20210303_1711.py (100%) rename {articles => src/articles}/migrations/0030_tag_slug.py (100%) rename {articles => src/articles}/migrations/0031_auto_20210306_1449.py (100%) rename {articles => src/articles}/migrations/0032_auto_20210306_1449.py (100%) rename {articles => src/articles}/migrations/__init__.py (100%) rename {articles => src/articles}/models.py (100%) rename {articles => src/articles}/static/admin_articles.css (100%) rename {articles => src/articles}/static/admonitions.css (100%) rename {articles => src/articles}/static/authenticated.css (100%) rename {articles => src/articles}/static/copy-code.js (100%) rename {articles => src/articles}/static/edit-keymap.js (100%) rename {articles => src/articles}/static/icons/android-chrome-96x96.png (100%) rename {articles => src/articles}/static/icons/apple-touch-icon.png (100%) rename {articles => src/articles}/static/icons/browserconfig.xml (100%) rename {articles => src/articles}/static/icons/favicon-16x16.png (100%) rename {articles => src/articles}/static/icons/favicon-32x32.png (100%) rename {articles => src/articles}/static/icons/favicon.ico (100%) rename {articles => src/articles}/static/icons/mstile-150x150.png (100%) rename {articles => src/articles}/static/icons/safari-pinned-tab.svg (100%) rename {articles => src/articles}/static/icons/site.webmanifest (100%) rename {articles => src/articles}/static/live-preview.js (100%) rename {articles => src/articles}/static/public.css (100%) rename {articles => src/articles}/static/vendor/codehilite.css (100%) rename {articles => src/articles}/static/vendor/goatcounter.js (100%) rename {articles => src/articles}/static/vendor/newcss.css (100%) rename {articles => src/articles}/templates/admin/articles/article/submit_line.html (100%) rename {articles => src/articles}/templates/articles/article_change_form.html (100%) rename {articles => src/articles}/templates/articles/article_detail.html (100%) rename {articles => src/articles}/templates/articles/article_list.html (100%) rename {articles => src/articles}/templates/articles/article_search.html (100%) rename {articles => src/articles}/templates/articles/base.html (100%) rename {articles => src/articles}/templates/articles/snippets/admin_link.html (100%) rename {articles => src/articles}/templates/articles/snippets/analytics.html (100%) rename {articles => src/articles}/templates/articles/snippets/analytics_head.html (100%) rename {articles => src/articles}/templates/articles/snippets/datetime.html (100%) rename {articles => src/articles}/templates/articles/snippets/favicon.html (100%) rename {articles => src/articles}/templates/articles/snippets/metadata.html (100%) rename {articles => src/articles}/templates/articles/snippets/navigation.html (100%) rename {articles => src/articles}/templates/articles/snippets/page_metadata.html (100%) rename {articles => src/articles}/tests/__init__.py (100%) rename {articles => src/articles}/tests/conftest.py (100%) rename {articles => src/articles}/tests/test_admin.py (100%) rename {articles => src/articles}/tests/test_api_views.py (100%) rename {articles => src/articles}/tests/test_feed_views.py (100%) rename {articles => src/articles}/tests/test_html_views.py (100%) rename {articles => src/articles}/tests/test_migrations.py (100%) rename {articles => src/articles}/tests/test_models.py (100%) rename {articles => src/articles}/urls.py (100%) rename {articles => src/articles}/utils.py (100%) rename {articles => src/articles}/views/__init__.py (100%) rename {articles => src/articles}/views/api.py (100%) rename {articles => src/articles}/views/feeds.py (100%) rename {articles => src/articles}/views/html.py (100%) rename {attachments => src/attachments}/__init__.py (100%) rename {attachments => src/attachments}/admin.py (100%) rename {attachments => src/attachments}/apps.py (100%) rename {attachments => src/attachments}/management/commands/reprocess_all_attachments.py (100%) rename {attachments => src/attachments}/migrations/0001_initial.py (100%) rename {attachments => src/attachments}/migrations/0002_auto_20200826_1814.py (100%) rename {attachments => src/attachments}/migrations/0003_auto_20200826_1843.py (100%) rename {attachments => src/attachments}/migrations/0004_auto_20200903_2116.py (100%) rename {attachments => src/attachments}/migrations/0005_attachment_open_graph_image.py (100%) rename {attachments => src/attachments}/migrations/0006_auto_20201128_2022.py (100%) rename {attachments => src/attachments}/migrations/0007_auto_20201201_1917.py (100%) rename {attachments => src/attachments}/migrations/__init__.py (100%) rename {attachments => src/attachments}/models.py (100%) rename {attachments => src/attachments}/static/attachments/js/copy_url.js (100%) rename {attachments => src/attachments}/tests/__init__.py (100%) rename {attachments => src/attachments}/tests/cassettes/test_models/test_attachment_is_processed_by_shortpixel.yaml (100%) rename {attachments => src/attachments}/tests/conftest.py (100%) rename {attachments => src/attachments}/tests/resources/image.png (100%) rename {attachments => src/attachments}/tests/test_models.py (100%) rename {blog => src/blog}/__init__.py (100%) rename {blog => src/blog}/asgi.py (100%) rename {blog => src/blog}/settings.py (100%) rename {blog => src/blog}/templates/admin/base_site.html (100%) rename {blog => src/blog}/templates/blog/robots.txt (100%) rename {blog => src/blog}/tests/__init__.py (100%) rename {blog => src/blog}/tests/test_robots.py (100%) rename {blog => src/blog}/urls.py (100%) rename {blog => src/blog}/wsgi.py (100%) rename manage.py => src/manage.py (100%) diff --git a/Dockerfile b/Dockerfile index 695a32b..9d4c621 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,11 +43,9 @@ COPY --from=venv /app/venv /app/venv/ ENV PATH /app/venv/bin:$PATH WORKDIR /app -COPY manage.py LICENSE pyproject.toml ./ +COPY LICENSE pyproject.toml ./ COPY docker ./docker/ -COPY blog ./blog/ -COPY attachments ./attachments/ -COPY articles ./articles/ +COPY src ./src/ COPY --from=git /version /app/.version ENV SECRET_KEY "changeme" diff --git a/README.md b/README.md index bef36ac..0f0ddbd 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,5 @@ Hosted at https://gabnotes.org ## Development ```shell inv test-cov -inv publish -inv deploy +inv build publish deploy ``` diff --git a/docker/nginx.conf b/docker/nginx.conf deleted file mode 100644 index 0696632..0000000 --- a/docker/nginx.conf +++ /dev/null @@ -1,42 +0,0 @@ -server { - server_name localhost:8000; - - client_max_body_size 10M; - - gzip on; - gzip_types - application/javascript - application/x-javascript - application/json - application/rss+xml - application/xml - application/vnd.ms-fontobject - application/font-sfnt - image/svg+xml - image/x-icon - text/xml - text/javascript - text/css - text/plain; - gzip_min_length 256; - gzip_comp_level 5; - gzip_http_version 1.1; - gzip_vary on; - - location /media/ { - alias /app/media/; - expires 30d; - } - - location / { - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $remote_addr; - proxy_set_header X-Forwarded-Proto https; - proxy_pass http://django:8000; - proxy_redirect off; - } - - listen [::]:80; - listen 80; -} diff --git a/docker/run.sh b/docker/run.sh index eea42c6..a25776d 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -1,5 +1,4 @@ #!/bin/bash set -eux python manage.py migrate --noinput -python manage.py collectstatic --noinput --clear gunicorn blog.wsgi -b 0.0.0.0:8000 --log-file - diff --git a/docker/runtests.sh b/docker/runtests.sh deleted file mode 100755 index 08cae94..0000000 --- a/docker/runtests.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -set -euxo pipefail -python -m pytest -pre-commit run --all-files -python manage.py makemigrations --check diff --git a/pyproject.toml b/pyproject.toml index 77619ee..caf09a6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,22 +1,3 @@ -[tool.black] -target-version = ['py38'] - -[tool.isort] -profile = "black" - -[tool.pytest.ini_options] -addopts = "--color=yes" -minversion = "6.0" -DJANGO_SETTINGS_MODULE = "blog.settings" -testpaths = [ - "articles", - "blog", - "attachments", -] -env = [ - "GOATCOUNTER_DOMAIN=gc.gabnotes.org" -] - [tool.poetry] name = "blog" version = "0.1.0" @@ -54,6 +35,23 @@ pytest-env = "^0.6.2" poetry-deps-scanner = "^1.0.1" invoke = "^1.6.0" +[tool.black] +target-version = ['py38'] + +[tool.isort] +profile = "black" + +[tool.pytest.ini_options] +addopts = "--color=yes" +minversion = "6.0" +DJANGO_SETTINGS_MODULE = "blog.settings" +testpaths = [ + "src", +] +env = [ + "GOATCOUNTER_DOMAIN=gc.gabnotes.org" +] + [build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" diff --git a/articles/__init__.py b/src/articles/__init__.py similarity index 100% rename from articles/__init__.py rename to src/articles/__init__.py diff --git a/articles/admin.py b/src/articles/admin.py similarity index 100% rename from articles/admin.py rename to src/articles/admin.py diff --git a/articles/apps.py b/src/articles/apps.py similarity index 100% rename from articles/apps.py rename to src/articles/apps.py diff --git a/articles/context_processors.py b/src/articles/context_processors.py similarity index 100% rename from articles/context_processors.py rename to src/articles/context_processors.py diff --git a/articles/markdown.py b/src/articles/markdown.py similarity index 100% rename from articles/markdown.py rename to src/articles/markdown.py diff --git a/articles/migrations/0001_initial.py b/src/articles/migrations/0001_initial.py similarity index 100% rename from articles/migrations/0001_initial.py rename to src/articles/migrations/0001_initial.py diff --git a/articles/migrations/0002_article.py b/src/articles/migrations/0002_article.py similarity index 100% rename from articles/migrations/0002_article.py rename to src/articles/migrations/0002_article.py diff --git a/articles/migrations/0003_auto_20200814_1522.py b/src/articles/migrations/0003_auto_20200814_1522.py similarity index 100% rename from articles/migrations/0003_auto_20200814_1522.py rename to src/articles/migrations/0003_auto_20200814_1522.py diff --git a/articles/migrations/0004_article_views_count.py b/src/articles/migrations/0004_article_views_count.py similarity index 100% rename from articles/migrations/0004_article_views_count.py rename to src/articles/migrations/0004_article_views_count.py diff --git a/articles/migrations/0005_article_slug.py b/src/articles/migrations/0005_article_slug.py similarity index 100% rename from articles/migrations/0005_article_slug.py rename to src/articles/migrations/0005_article_slug.py diff --git a/articles/migrations/0006_page.py b/src/articles/migrations/0006_page.py similarity index 100% rename from articles/migrations/0006_page.py rename to src/articles/migrations/0006_page.py diff --git a/articles/migrations/0007_auto_20200817_0941.py b/src/articles/migrations/0007_auto_20200817_0941.py similarity index 100% rename from articles/migrations/0007_auto_20200817_0941.py rename to src/articles/migrations/0007_auto_20200817_0941.py diff --git a/articles/migrations/0008_auto_20200817_1748.py b/src/articles/migrations/0008_auto_20200817_1748.py similarity index 100% rename from articles/migrations/0008_auto_20200817_1748.py rename to src/articles/migrations/0008_auto_20200817_1748.py diff --git a/articles/migrations/0009_comment.py b/src/articles/migrations/0009_comment.py similarity index 100% rename from articles/migrations/0009_comment.py rename to src/articles/migrations/0009_comment.py diff --git a/articles/migrations/0010_auto_20200818_1825.py b/src/articles/migrations/0010_auto_20200818_1825.py similarity index 100% rename from articles/migrations/0010_auto_20200818_1825.py rename to src/articles/migrations/0010_auto_20200818_1825.py diff --git a/articles/migrations/0011_auto_20200818_1829.py b/src/articles/migrations/0011_auto_20200818_1829.py similarity index 100% rename from articles/migrations/0011_auto_20200818_1829.py rename to src/articles/migrations/0011_auto_20200818_1829.py diff --git a/articles/migrations/0012_auto_20200818_1845.py b/src/articles/migrations/0012_auto_20200818_1845.py similarity index 100% rename from articles/migrations/0012_auto_20200818_1845.py rename to src/articles/migrations/0012_auto_20200818_1845.py diff --git a/articles/migrations/0013_auto_20200818_1912.py b/src/articles/migrations/0013_auto_20200818_1912.py similarity index 100% rename from articles/migrations/0013_auto_20200818_1912.py rename to src/articles/migrations/0013_auto_20200818_1912.py diff --git a/articles/migrations/0014_auto_20200818_1952.py b/src/articles/migrations/0014_auto_20200818_1952.py similarity index 100% rename from articles/migrations/0014_auto_20200818_1952.py rename to src/articles/migrations/0014_auto_20200818_1952.py diff --git a/articles/migrations/0015_auto_20200818_2138.py b/src/articles/migrations/0015_auto_20200818_2138.py similarity index 100% rename from articles/migrations/0015_auto_20200818_2138.py rename to src/articles/migrations/0015_auto_20200818_2138.py diff --git a/articles/migrations/0016_comment_user_notified.py b/src/articles/migrations/0016_comment_user_notified.py similarity index 100% rename from articles/migrations/0016_comment_user_notified.py rename to src/articles/migrations/0016_comment_user_notified.py diff --git a/articles/migrations/0017_auto_20200820_1606.py b/src/articles/migrations/0017_auto_20200820_1606.py similarity index 100% rename from articles/migrations/0017_auto_20200820_1606.py rename to src/articles/migrations/0017_auto_20200820_1606.py diff --git a/articles/migrations/0018_auto_20200821_1232.py b/src/articles/migrations/0018_auto_20200821_1232.py similarity index 100% rename from articles/migrations/0018_auto_20200821_1232.py rename to src/articles/migrations/0018_auto_20200821_1232.py diff --git a/articles/migrations/0019_article_comments_allowed.py b/src/articles/migrations/0019_article_comments_allowed.py similarity index 100% rename from articles/migrations/0019_article_comments_allowed.py rename to src/articles/migrations/0019_article_comments_allowed.py diff --git a/articles/migrations/0020_auto_20200903_2157.py b/src/articles/migrations/0020_auto_20200903_2157.py similarity index 100% rename from articles/migrations/0020_auto_20200903_2157.py rename to src/articles/migrations/0020_auto_20200903_2157.py diff --git a/articles/migrations/0021_auto_20201110_1623.py b/src/articles/migrations/0021_auto_20201110_1623.py similarity index 100% rename from articles/migrations/0021_auto_20201110_1623.py rename to src/articles/migrations/0021_auto_20201110_1623.py diff --git a/articles/migrations/0022_article_keywords.py b/src/articles/migrations/0022_article_keywords.py similarity index 100% rename from articles/migrations/0022_article_keywords.py rename to src/articles/migrations/0022_article_keywords.py diff --git a/articles/migrations/0023_article_has_code.py b/src/articles/migrations/0023_article_has_code.py similarity index 100% rename from articles/migrations/0023_article_has_code.py rename to src/articles/migrations/0023_article_has_code.py diff --git a/articles/migrations/0024_auto_20201224_1746.py b/src/articles/migrations/0024_auto_20201224_1746.py similarity index 100% rename from articles/migrations/0024_auto_20201224_1746.py rename to src/articles/migrations/0024_auto_20201224_1746.py diff --git a/articles/migrations/0025_article_custom_css.py b/src/articles/migrations/0025_article_custom_css.py similarity index 100% rename from articles/migrations/0025_article_custom_css.py rename to src/articles/migrations/0025_article_custom_css.py diff --git a/articles/migrations/0026_article_draft_key.py b/src/articles/migrations/0026_article_draft_key.py similarity index 100% rename from articles/migrations/0026_article_draft_key.py rename to src/articles/migrations/0026_article_draft_key.py diff --git a/articles/migrations/0027_auto_20210303_1633.py b/src/articles/migrations/0027_auto_20210303_1633.py similarity index 100% rename from articles/migrations/0027_auto_20210303_1633.py rename to src/articles/migrations/0027_auto_20210303_1633.py diff --git a/articles/migrations/0028_remove_article_keywords.py b/src/articles/migrations/0028_remove_article_keywords.py similarity index 100% rename from articles/migrations/0028_remove_article_keywords.py rename to src/articles/migrations/0028_remove_article_keywords.py diff --git a/articles/migrations/0029_auto_20210303_1711.py b/src/articles/migrations/0029_auto_20210303_1711.py similarity index 100% rename from articles/migrations/0029_auto_20210303_1711.py rename to src/articles/migrations/0029_auto_20210303_1711.py diff --git a/articles/migrations/0030_tag_slug.py b/src/articles/migrations/0030_tag_slug.py similarity index 100% rename from articles/migrations/0030_tag_slug.py rename to src/articles/migrations/0030_tag_slug.py diff --git a/articles/migrations/0031_auto_20210306_1449.py b/src/articles/migrations/0031_auto_20210306_1449.py similarity index 100% rename from articles/migrations/0031_auto_20210306_1449.py rename to src/articles/migrations/0031_auto_20210306_1449.py diff --git a/articles/migrations/0032_auto_20210306_1449.py b/src/articles/migrations/0032_auto_20210306_1449.py similarity index 100% rename from articles/migrations/0032_auto_20210306_1449.py rename to src/articles/migrations/0032_auto_20210306_1449.py diff --git a/articles/migrations/__init__.py b/src/articles/migrations/__init__.py similarity index 100% rename from articles/migrations/__init__.py rename to src/articles/migrations/__init__.py diff --git a/articles/models.py b/src/articles/models.py similarity index 100% rename from articles/models.py rename to src/articles/models.py diff --git a/articles/static/admin_articles.css b/src/articles/static/admin_articles.css similarity index 100% rename from articles/static/admin_articles.css rename to src/articles/static/admin_articles.css diff --git a/articles/static/admonitions.css b/src/articles/static/admonitions.css similarity index 100% rename from articles/static/admonitions.css rename to src/articles/static/admonitions.css diff --git a/articles/static/authenticated.css b/src/articles/static/authenticated.css similarity index 100% rename from articles/static/authenticated.css rename to src/articles/static/authenticated.css diff --git a/articles/static/copy-code.js b/src/articles/static/copy-code.js similarity index 100% rename from articles/static/copy-code.js rename to src/articles/static/copy-code.js diff --git a/articles/static/edit-keymap.js b/src/articles/static/edit-keymap.js similarity index 100% rename from articles/static/edit-keymap.js rename to src/articles/static/edit-keymap.js diff --git a/articles/static/icons/android-chrome-96x96.png b/src/articles/static/icons/android-chrome-96x96.png similarity index 100% rename from articles/static/icons/android-chrome-96x96.png rename to src/articles/static/icons/android-chrome-96x96.png diff --git a/articles/static/icons/apple-touch-icon.png b/src/articles/static/icons/apple-touch-icon.png similarity index 100% rename from articles/static/icons/apple-touch-icon.png rename to src/articles/static/icons/apple-touch-icon.png diff --git a/articles/static/icons/browserconfig.xml b/src/articles/static/icons/browserconfig.xml similarity index 100% rename from articles/static/icons/browserconfig.xml rename to src/articles/static/icons/browserconfig.xml diff --git a/articles/static/icons/favicon-16x16.png b/src/articles/static/icons/favicon-16x16.png similarity index 100% rename from articles/static/icons/favicon-16x16.png rename to src/articles/static/icons/favicon-16x16.png diff --git a/articles/static/icons/favicon-32x32.png b/src/articles/static/icons/favicon-32x32.png similarity index 100% rename from articles/static/icons/favicon-32x32.png rename to src/articles/static/icons/favicon-32x32.png diff --git a/articles/static/icons/favicon.ico b/src/articles/static/icons/favicon.ico similarity index 100% rename from articles/static/icons/favicon.ico rename to src/articles/static/icons/favicon.ico diff --git a/articles/static/icons/mstile-150x150.png b/src/articles/static/icons/mstile-150x150.png similarity index 100% rename from articles/static/icons/mstile-150x150.png rename to src/articles/static/icons/mstile-150x150.png diff --git a/articles/static/icons/safari-pinned-tab.svg b/src/articles/static/icons/safari-pinned-tab.svg similarity index 100% rename from articles/static/icons/safari-pinned-tab.svg rename to src/articles/static/icons/safari-pinned-tab.svg diff --git a/articles/static/icons/site.webmanifest b/src/articles/static/icons/site.webmanifest similarity index 100% rename from articles/static/icons/site.webmanifest rename to src/articles/static/icons/site.webmanifest diff --git a/articles/static/live-preview.js b/src/articles/static/live-preview.js similarity index 100% rename from articles/static/live-preview.js rename to src/articles/static/live-preview.js diff --git a/articles/static/public.css b/src/articles/static/public.css similarity index 100% rename from articles/static/public.css rename to src/articles/static/public.css diff --git a/articles/static/vendor/codehilite.css b/src/articles/static/vendor/codehilite.css similarity index 100% rename from articles/static/vendor/codehilite.css rename to src/articles/static/vendor/codehilite.css diff --git a/articles/static/vendor/goatcounter.js b/src/articles/static/vendor/goatcounter.js similarity index 100% rename from articles/static/vendor/goatcounter.js rename to src/articles/static/vendor/goatcounter.js diff --git a/articles/static/vendor/newcss.css b/src/articles/static/vendor/newcss.css similarity index 100% rename from articles/static/vendor/newcss.css rename to src/articles/static/vendor/newcss.css diff --git a/articles/templates/admin/articles/article/submit_line.html b/src/articles/templates/admin/articles/article/submit_line.html similarity index 100% rename from articles/templates/admin/articles/article/submit_line.html rename to src/articles/templates/admin/articles/article/submit_line.html diff --git a/articles/templates/articles/article_change_form.html b/src/articles/templates/articles/article_change_form.html similarity index 100% rename from articles/templates/articles/article_change_form.html rename to src/articles/templates/articles/article_change_form.html diff --git a/articles/templates/articles/article_detail.html b/src/articles/templates/articles/article_detail.html similarity index 100% rename from articles/templates/articles/article_detail.html rename to src/articles/templates/articles/article_detail.html diff --git a/articles/templates/articles/article_list.html b/src/articles/templates/articles/article_list.html similarity index 100% rename from articles/templates/articles/article_list.html rename to src/articles/templates/articles/article_list.html diff --git a/articles/templates/articles/article_search.html b/src/articles/templates/articles/article_search.html similarity index 100% rename from articles/templates/articles/article_search.html rename to src/articles/templates/articles/article_search.html diff --git a/articles/templates/articles/base.html b/src/articles/templates/articles/base.html similarity index 100% rename from articles/templates/articles/base.html rename to src/articles/templates/articles/base.html diff --git a/articles/templates/articles/snippets/admin_link.html b/src/articles/templates/articles/snippets/admin_link.html similarity index 100% rename from articles/templates/articles/snippets/admin_link.html rename to src/articles/templates/articles/snippets/admin_link.html diff --git a/articles/templates/articles/snippets/analytics.html b/src/articles/templates/articles/snippets/analytics.html similarity index 100% rename from articles/templates/articles/snippets/analytics.html rename to src/articles/templates/articles/snippets/analytics.html diff --git a/articles/templates/articles/snippets/analytics_head.html b/src/articles/templates/articles/snippets/analytics_head.html similarity index 100% rename from articles/templates/articles/snippets/analytics_head.html rename to src/articles/templates/articles/snippets/analytics_head.html diff --git a/articles/templates/articles/snippets/datetime.html b/src/articles/templates/articles/snippets/datetime.html similarity index 100% rename from articles/templates/articles/snippets/datetime.html rename to src/articles/templates/articles/snippets/datetime.html diff --git a/articles/templates/articles/snippets/favicon.html b/src/articles/templates/articles/snippets/favicon.html similarity index 100% rename from articles/templates/articles/snippets/favicon.html rename to src/articles/templates/articles/snippets/favicon.html diff --git a/articles/templates/articles/snippets/metadata.html b/src/articles/templates/articles/snippets/metadata.html similarity index 100% rename from articles/templates/articles/snippets/metadata.html rename to src/articles/templates/articles/snippets/metadata.html diff --git a/articles/templates/articles/snippets/navigation.html b/src/articles/templates/articles/snippets/navigation.html similarity index 100% rename from articles/templates/articles/snippets/navigation.html rename to src/articles/templates/articles/snippets/navigation.html diff --git a/articles/templates/articles/snippets/page_metadata.html b/src/articles/templates/articles/snippets/page_metadata.html similarity index 100% rename from articles/templates/articles/snippets/page_metadata.html rename to src/articles/templates/articles/snippets/page_metadata.html diff --git a/articles/tests/__init__.py b/src/articles/tests/__init__.py similarity index 100% rename from articles/tests/__init__.py rename to src/articles/tests/__init__.py diff --git a/articles/tests/conftest.py b/src/articles/tests/conftest.py similarity index 100% rename from articles/tests/conftest.py rename to src/articles/tests/conftest.py diff --git a/articles/tests/test_admin.py b/src/articles/tests/test_admin.py similarity index 100% rename from articles/tests/test_admin.py rename to src/articles/tests/test_admin.py diff --git a/articles/tests/test_api_views.py b/src/articles/tests/test_api_views.py similarity index 100% rename from articles/tests/test_api_views.py rename to src/articles/tests/test_api_views.py diff --git a/articles/tests/test_feed_views.py b/src/articles/tests/test_feed_views.py similarity index 100% rename from articles/tests/test_feed_views.py rename to src/articles/tests/test_feed_views.py diff --git a/articles/tests/test_html_views.py b/src/articles/tests/test_html_views.py similarity index 100% rename from articles/tests/test_html_views.py rename to src/articles/tests/test_html_views.py diff --git a/articles/tests/test_migrations.py b/src/articles/tests/test_migrations.py similarity index 100% rename from articles/tests/test_migrations.py rename to src/articles/tests/test_migrations.py diff --git a/articles/tests/test_models.py b/src/articles/tests/test_models.py similarity index 100% rename from articles/tests/test_models.py rename to src/articles/tests/test_models.py diff --git a/articles/urls.py b/src/articles/urls.py similarity index 100% rename from articles/urls.py rename to src/articles/urls.py diff --git a/articles/utils.py b/src/articles/utils.py similarity index 100% rename from articles/utils.py rename to src/articles/utils.py diff --git a/articles/views/__init__.py b/src/articles/views/__init__.py similarity index 100% rename from articles/views/__init__.py rename to src/articles/views/__init__.py diff --git a/articles/views/api.py b/src/articles/views/api.py similarity index 100% rename from articles/views/api.py rename to src/articles/views/api.py diff --git a/articles/views/feeds.py b/src/articles/views/feeds.py similarity index 100% rename from articles/views/feeds.py rename to src/articles/views/feeds.py diff --git a/articles/views/html.py b/src/articles/views/html.py similarity index 100% rename from articles/views/html.py rename to src/articles/views/html.py diff --git a/attachments/__init__.py b/src/attachments/__init__.py similarity index 100% rename from attachments/__init__.py rename to src/attachments/__init__.py diff --git a/attachments/admin.py b/src/attachments/admin.py similarity index 100% rename from attachments/admin.py rename to src/attachments/admin.py diff --git a/attachments/apps.py b/src/attachments/apps.py similarity index 100% rename from attachments/apps.py rename to src/attachments/apps.py diff --git a/attachments/management/commands/reprocess_all_attachments.py b/src/attachments/management/commands/reprocess_all_attachments.py similarity index 100% rename from attachments/management/commands/reprocess_all_attachments.py rename to src/attachments/management/commands/reprocess_all_attachments.py diff --git a/attachments/migrations/0001_initial.py b/src/attachments/migrations/0001_initial.py similarity index 100% rename from attachments/migrations/0001_initial.py rename to src/attachments/migrations/0001_initial.py diff --git a/attachments/migrations/0002_auto_20200826_1814.py b/src/attachments/migrations/0002_auto_20200826_1814.py similarity index 100% rename from attachments/migrations/0002_auto_20200826_1814.py rename to src/attachments/migrations/0002_auto_20200826_1814.py diff --git a/attachments/migrations/0003_auto_20200826_1843.py b/src/attachments/migrations/0003_auto_20200826_1843.py similarity index 100% rename from attachments/migrations/0003_auto_20200826_1843.py rename to src/attachments/migrations/0003_auto_20200826_1843.py diff --git a/attachments/migrations/0004_auto_20200903_2116.py b/src/attachments/migrations/0004_auto_20200903_2116.py similarity index 100% rename from attachments/migrations/0004_auto_20200903_2116.py rename to src/attachments/migrations/0004_auto_20200903_2116.py diff --git a/attachments/migrations/0005_attachment_open_graph_image.py b/src/attachments/migrations/0005_attachment_open_graph_image.py similarity index 100% rename from attachments/migrations/0005_attachment_open_graph_image.py rename to src/attachments/migrations/0005_attachment_open_graph_image.py diff --git a/attachments/migrations/0006_auto_20201128_2022.py b/src/attachments/migrations/0006_auto_20201128_2022.py similarity index 100% rename from attachments/migrations/0006_auto_20201128_2022.py rename to src/attachments/migrations/0006_auto_20201128_2022.py diff --git a/attachments/migrations/0007_auto_20201201_1917.py b/src/attachments/migrations/0007_auto_20201201_1917.py similarity index 100% rename from attachments/migrations/0007_auto_20201201_1917.py rename to src/attachments/migrations/0007_auto_20201201_1917.py diff --git a/attachments/migrations/__init__.py b/src/attachments/migrations/__init__.py similarity index 100% rename from attachments/migrations/__init__.py rename to src/attachments/migrations/__init__.py diff --git a/attachments/models.py b/src/attachments/models.py similarity index 100% rename from attachments/models.py rename to src/attachments/models.py diff --git a/attachments/static/attachments/js/copy_url.js b/src/attachments/static/attachments/js/copy_url.js similarity index 100% rename from attachments/static/attachments/js/copy_url.js rename to src/attachments/static/attachments/js/copy_url.js diff --git a/attachments/tests/__init__.py b/src/attachments/tests/__init__.py similarity index 100% rename from attachments/tests/__init__.py rename to src/attachments/tests/__init__.py diff --git a/attachments/tests/cassettes/test_models/test_attachment_is_processed_by_shortpixel.yaml b/src/attachments/tests/cassettes/test_models/test_attachment_is_processed_by_shortpixel.yaml similarity index 100% rename from attachments/tests/cassettes/test_models/test_attachment_is_processed_by_shortpixel.yaml rename to src/attachments/tests/cassettes/test_models/test_attachment_is_processed_by_shortpixel.yaml diff --git a/attachments/tests/conftest.py b/src/attachments/tests/conftest.py similarity index 100% rename from attachments/tests/conftest.py rename to src/attachments/tests/conftest.py diff --git a/attachments/tests/resources/image.png b/src/attachments/tests/resources/image.png similarity index 100% rename from attachments/tests/resources/image.png rename to src/attachments/tests/resources/image.png diff --git a/attachments/tests/test_models.py b/src/attachments/tests/test_models.py similarity index 100% rename from attachments/tests/test_models.py rename to src/attachments/tests/test_models.py diff --git a/blog/__init__.py b/src/blog/__init__.py similarity index 100% rename from blog/__init__.py rename to src/blog/__init__.py diff --git a/blog/asgi.py b/src/blog/asgi.py similarity index 100% rename from blog/asgi.py rename to src/blog/asgi.py diff --git a/blog/settings.py b/src/blog/settings.py similarity index 100% rename from blog/settings.py rename to src/blog/settings.py diff --git a/blog/templates/admin/base_site.html b/src/blog/templates/admin/base_site.html similarity index 100% rename from blog/templates/admin/base_site.html rename to src/blog/templates/admin/base_site.html diff --git a/blog/templates/blog/robots.txt b/src/blog/templates/blog/robots.txt similarity index 100% rename from blog/templates/blog/robots.txt rename to src/blog/templates/blog/robots.txt diff --git a/blog/tests/__init__.py b/src/blog/tests/__init__.py similarity index 100% rename from blog/tests/__init__.py rename to src/blog/tests/__init__.py diff --git a/blog/tests/test_robots.py b/src/blog/tests/test_robots.py similarity index 100% rename from blog/tests/test_robots.py rename to src/blog/tests/test_robots.py diff --git a/blog/urls.py b/src/blog/urls.py similarity index 100% rename from blog/urls.py rename to src/blog/urls.py diff --git a/blog/wsgi.py b/src/blog/wsgi.py similarity index 100% rename from blog/wsgi.py rename to src/blog/wsgi.py diff --git a/manage.py b/src/manage.py similarity index 100% rename from manage.py rename to src/manage.py diff --git a/tasks.py b/tasks.py index bf1a303..a82c890 100644 --- a/tasks.py +++ b/tasks.py @@ -3,17 +3,18 @@ from pathlib import Path from invoke import task BASE_DIR = Path(__file__).parent.resolve(strict=True) +SRC_DIR = BASE_DIR / "src" @task def test(ctx): - with ctx.cd(BASE_DIR): + with ctx.cd(SRC_DIR): ctx.run("pytest", pty=True, echo=True) @task def test_cov(ctx): - with ctx.cd(BASE_DIR): + with ctx.cd(SRC_DIR): ctx.run( "pytest --cov=. --cov-report term-missing:skip-covered", pty=True, @@ -22,9 +23,14 @@ def test_cov(ctx): @task -def publish(ctx): +def build(ctx): with ctx.cd(BASE_DIR): ctx.run("docker-compose build django", pty=True, echo=True) + + +@task +def publish(ctx): + with ctx.cd(BASE_DIR): ctx.run("docker-compose push django", pty=True, echo=True)