From 12579052a3d75b069249ddf99ba24982a77f9383 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Tue, 15 Sep 2020 12:30:14 -0400 Subject: [PATCH] ref: change names --- .../0007_deconstructable_file_field.py | 23 ------------------- {dandi => dandiapi}/__init__.py | 0 {dandi/publish => dandiapi/api}/__init__.py | 0 {dandi/publish => dandiapi/api}/admin.py | 2 +- {dandi/publish => dandiapi/api}/apps.py | 2 +- {dandi/publish => dandiapi/api}/girder.py | 0 .../api}/migrations/0001_initial.py | 14 +++++------ .../migrations/0002_alter_version_meta.py | 2 +- .../api}/migrations/0003_asset_ordering.py | 2 +- .../migrations/0004_auto_20200722_1718.py | 2 +- .../api}/migrations/0005_add_drafts_model.py | 4 ++-- .../0006_populate_drafts_from_versions.py | 6 ++--- .../0007_deconstructable_file_field.py | 23 +++++++++++++++++++ .../0008_draft_version_related_name.py | 4 ++-- .../migrations/0009_remove_description.py | 2 +- .../api}/migrations/0009_rename_modified.py | 2 +- .../api}/migrations/0010_timestampedmodel.py | 2 +- .../api}/migrations/0011_merge.py | 4 ++-- .../api}/migrations/__init__.py | 0 .../api}/models/__init__.py | 0 .../publish => dandiapi/api}/models/asset.py | 4 ++-- .../publish => dandiapi/api}/models/common.py | 0 .../api}/models/dandiset.py | 2 +- .../api}/models/draft_version.py | 0 .../api}/models/version.py | 2 +- {dandi/publish => dandiapi/api}/storage.py | 0 {dandi/publish => dandiapi/api}/tasks.py | 4 ++-- .../api}/tests/__init__.py | 0 .../api}/tests/conftest.py | 0 .../api}/tests/factories.py | 4 ++-- .../publish => dandiapi/api}/tests/fuzzy.py | 0 .../publish => dandiapi/api}/tests/girder.py | 2 +- .../api}/tests/test_asset.py | 2 +- .../api}/tests/test_dandiset.py | 2 +- .../api}/tests/test_stats.py | 0 .../api}/tests/test_version.py | 2 +- .../api}/views/__init__.py | 0 .../publish => dandiapi/api}/views/asset.py | 6 ++--- .../publish => dandiapi/api}/views/common.py | 0 .../api}/views/dandiset.py | 6 ++--- .../publish => dandiapi/api}/views/stats.py | 2 +- .../publish => dandiapi/api}/views/version.py | 8 +++---- {dandi => dandiapi}/asgi.py | 2 +- {dandi => dandiapi}/celery.py | 2 +- {dandi => dandiapi}/settings.py | 8 +++---- {dandi => dandiapi}/urls.py | 2 +- {dandi => dandiapi}/wsgi.py | 2 +- docker-compose.override.yml | 2 +- manage.py | 2 +- setup.py | 2 +- 50 files changed, 81 insertions(+), 81 deletions(-) delete mode 100644 dandi/publish/migrations/0007_deconstructable_file_field.py rename {dandi => dandiapi}/__init__.py (100%) rename {dandi/publish => dandiapi/api}/__init__.py (100%) rename {dandi/publish => dandiapi/api}/admin.py (89%) rename {dandi/publish => dandiapi/api}/apps.py (79%) rename {dandi/publish => dandiapi/api}/girder.py (100%) rename {dandi/publish => dandiapi/api}/migrations/0001_initial.py (92%) rename {dandi/publish => dandiapi/api}/migrations/0002_alter_version_meta.py (90%) rename {dandi/publish => dandiapi/api}/migrations/0003_asset_ordering.py (84%) rename {dandi/publish => dandiapi/api}/migrations/0004_auto_20200722_1718.py (93%) rename {dandi/publish => dandiapi/api}/migrations/0005_add_drafts_model.py (93%) rename {dandi/publish => dandiapi/api}/migrations/0006_populate_drafts_from_versions.py (81%) create mode 100644 dandiapi/api/migrations/0007_deconstructable_file_field.py rename {dandi/publish => dandiapi/api}/migrations/0008_draft_version_related_name.py (85%) rename {dandi/publish => dandiapi/api}/migrations/0009_remove_description.py (87%) rename {dandi/publish => dandiapi/api}/migrations/0009_rename_modified.py (93%) rename {dandi/publish => dandiapi/api}/migrations/0010_timestampedmodel.py (97%) rename {dandi/publish => dandiapi/api}/migrations/0011_merge.py (64%) rename {dandi/publish => dandiapi/api}/migrations/__init__.py (100%) rename {dandi/publish => dandiapi/api}/models/__init__.py (100%) rename {dandi/publish => dandiapi/api}/models/asset.py (96%) rename {dandi/publish => dandiapi/api}/models/common.py (100%) rename {dandi/publish => dandiapi/api}/models/dandiset.py (97%) rename {dandi/publish => dandiapi/api}/models/draft_version.py (100%) rename {dandi/publish => dandiapi/api}/models/version.py (98%) rename {dandi/publish => dandiapi/api}/storage.py (100%) rename {dandi/publish => dandiapi/api}/tasks.py (85%) rename {dandi/publish => dandiapi/api}/tests/__init__.py (100%) rename {dandi/publish => dandiapi/api}/tests/conftest.py (100%) rename {dandi/publish => dandiapi/api}/tests/factories.py (92%) rename {dandi/publish => dandiapi/api}/tests/fuzzy.py (100%) rename {dandi/publish => dandiapi/api}/tests/girder.py (97%) rename {dandi/publish => dandiapi/api}/tests/test_asset.py (99%) rename {dandi/publish => dandiapi/api}/tests/test_dandiset.py (97%) rename {dandi/publish => dandiapi/api}/tests/test_stats.py (100%) rename {dandi/publish => dandiapi/api}/tests/test_version.py (98%) rename {dandi/publish => dandiapi/api}/views/__init__.py (100%) rename {dandi/publish => dandiapi/api}/views/asset.py (93%) rename {dandi/publish => dandiapi/api}/views/common.py (100%) rename {dandi/publish => dandiapi/api}/views/dandiset.py (92%) rename {dandi/publish => dandiapi/api}/views/stats.py (92%) rename {dandi/publish => dandiapi/api}/views/version.py (88%) rename {dandi => dandiapi}/asgi.py (83%) rename {dandi => dandiapi}/celery.py (89%) rename {dandi => dandiapi}/settings.py (90%) rename {dandi => dandiapi}/urls.py (94%) rename {dandi => dandiapi}/wsgi.py (83%) diff --git a/dandi/publish/migrations/0007_deconstructable_file_field.py b/dandi/publish/migrations/0007_deconstructable_file_field.py deleted file mode 100644 index 585461af1..000000000 --- a/dandi/publish/migrations/0007_deconstructable_file_field.py +++ /dev/null @@ -1,23 +0,0 @@ -from django.db import migrations - -import dandi.publish.models.asset -import dandi.publish.storage - - -class Migration(migrations.Migration): - - dependencies = [ - ('publish', '0006_populate_drafts_from_versions'), - ] - - operations = [ - migrations.AlterField( - model_name='asset', - name='blob', - field=dandi.publish.storage.DeconstructableFileField( - blank=True, - storage=dandi.publish.models.asset._get_asset_blob_storage, - upload_to=dandi.publish.models.asset._get_asset_blob_prefix, - ), - ), - ] diff --git a/dandi/__init__.py b/dandiapi/__init__.py similarity index 100% rename from dandi/__init__.py rename to dandiapi/__init__.py diff --git a/dandi/publish/__init__.py b/dandiapi/api/__init__.py similarity index 100% rename from dandi/publish/__init__.py rename to dandiapi/api/__init__.py diff --git a/dandi/publish/admin.py b/dandiapi/api/admin.py similarity index 89% rename from dandi/publish/admin.py rename to dandiapi/api/admin.py index 7872781b8..4c79c135b 100644 --- a/dandi/publish/admin.py +++ b/dandiapi/api/admin.py @@ -1,6 +1,6 @@ from django.contrib import admin -from dandi.publish.models import Asset, Dandiset, DraftVersion, Version +from dandiapi.api.models import Asset, Dandiset, DraftVersion, Version @admin.register(Dandiset) diff --git a/dandi/publish/apps.py b/dandiapi/api/apps.py similarity index 79% rename from dandi/publish/apps.py rename to dandiapi/api/apps.py index e5dc94d51..f7dd43c90 100644 --- a/dandi/publish/apps.py +++ b/dandiapi/api/apps.py @@ -2,5 +2,5 @@ class PublishConfig(AppConfig): - name = 'dandi.publish' + name = 'dandiapi.api' verbose_name = 'DANDI: Publish' diff --git a/dandi/publish/girder.py b/dandiapi/api/girder.py similarity index 100% rename from dandi/publish/girder.py rename to dandiapi/api/girder.py diff --git a/dandi/publish/migrations/0001_initial.py b/dandiapi/api/migrations/0001_initial.py similarity index 92% rename from dandi/publish/migrations/0001_initial.py rename to dandiapi/api/migrations/0001_initial.py index f18a42143..f9772daec 100644 --- a/dandi/publish/migrations/0001_initial.py +++ b/dandiapi/api/migrations/0001_initial.py @@ -7,8 +7,8 @@ from django.db import migrations, models import django.db.models.deletion -import dandi.publish.models -import dandi.publish.storage +import dandiapi.api.models +import dandiapi.api.storage class Migration(migrations.Migration): @@ -51,7 +51,7 @@ class Migration(migrations.Migration): ( 'version', models.CharField( - default=dandi.publish.models.version._get_default_version, + default=dandiapi.api.models.version._get_default_version, max_length=13, validators=[django.core.validators.RegexValidator('^0\\.\\d{6}\\.\\d{4}$')], ), @@ -67,7 +67,7 @@ class Migration(migrations.Migration): models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, related_name='versions', - to='publish.Dandiset', + to='api.Dandiset', ), ), ], @@ -100,10 +100,10 @@ class Migration(migrations.Migration): 'blob', models.FileField( blank=True, - storage=dandi.publish.storage.create_s3_storage( + storage=dandiapi.api.storage.create_s3_storage( settings.DANDI_DANDISETS_BUCKET_NAME ), - upload_to=dandi.publish.models.asset._get_asset_blob_prefix, + upload_to=dandiapi.api.models.asset._get_asset_blob_prefix, ), ), ('created', models.DateTimeField(auto_now_add=True)), @@ -113,7 +113,7 @@ class Migration(migrations.Migration): models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, related_name='assets', - to='publish.Version', + to='api.Version', ), ), ], diff --git a/dandi/publish/migrations/0002_alter_version_meta.py b/dandiapi/api/migrations/0002_alter_version_meta.py similarity index 90% rename from dandi/publish/migrations/0002_alter_version_meta.py rename to dandiapi/api/migrations/0002_alter_version_meta.py index f81c35f3d..38904e2bf 100644 --- a/dandi/publish/migrations/0002_alter_version_meta.py +++ b/dandiapi/api/migrations/0002_alter_version_meta.py @@ -6,7 +6,7 @@ class Migration(migrations.Migration): dependencies = [ - ('publish', '0001_initial'), + ('api', '0001_initial'), ] operations = [ diff --git a/dandi/publish/migrations/0003_asset_ordering.py b/dandiapi/api/migrations/0003_asset_ordering.py similarity index 84% rename from dandi/publish/migrations/0003_asset_ordering.py rename to dandiapi/api/migrations/0003_asset_ordering.py index ba59259a6..d4ef02586 100644 --- a/dandi/publish/migrations/0003_asset_ordering.py +++ b/dandiapi/api/migrations/0003_asset_ordering.py @@ -6,7 +6,7 @@ class Migration(migrations.Migration): dependencies = [ - ('publish', '0002_alter_version_meta'), + ('api', '0002_alter_version_meta'), ] operations = [ diff --git a/dandi/publish/migrations/0004_auto_20200722_1718.py b/dandiapi/api/migrations/0004_auto_20200722_1718.py similarity index 93% rename from dandi/publish/migrations/0004_auto_20200722_1718.py rename to dandiapi/api/migrations/0004_auto_20200722_1718.py index f27989a22..da0a09c3c 100644 --- a/dandi/publish/migrations/0004_auto_20200722_1718.py +++ b/dandiapi/api/migrations/0004_auto_20200722_1718.py @@ -6,7 +6,7 @@ class Migration(migrations.Migration): dependencies = [ - ('publish', '0003_asset_ordering'), + ('api', '0003_asset_ordering'), ] operations = [ diff --git a/dandi/publish/migrations/0005_add_drafts_model.py b/dandiapi/api/migrations/0005_add_drafts_model.py similarity index 93% rename from dandi/publish/migrations/0005_add_drafts_model.py rename to dandiapi/api/migrations/0005_add_drafts_model.py index 6655659c8..2a5cda700 100644 --- a/dandi/publish/migrations/0005_add_drafts_model.py +++ b/dandiapi/api/migrations/0005_add_drafts_model.py @@ -7,7 +7,7 @@ class Migration(migrations.Migration): dependencies = [ - ('publish', '0004_auto_20200722_1718'), + ('api', '0004_auto_20200722_1718'), ] operations = [ @@ -20,7 +20,7 @@ class Migration(migrations.Migration): on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, - to='publish.Dandiset', + to='api.Dandiset', ), ), ('name', models.CharField(max_length=150)), diff --git a/dandi/publish/migrations/0006_populate_drafts_from_versions.py b/dandiapi/api/migrations/0006_populate_drafts_from_versions.py similarity index 81% rename from dandi/publish/migrations/0006_populate_drafts_from_versions.py rename to dandiapi/api/migrations/0006_populate_drafts_from_versions.py index 6e8f349fb..433e1dfa3 100644 --- a/dandi/publish/migrations/0006_populate_drafts_from_versions.py +++ b/dandiapi/api/migrations/0006_populate_drafts_from_versions.py @@ -4,8 +4,8 @@ def populate_drafts(apps, schema_editor): - Dandiset = apps.get_model('publish', 'Dandiset') # noqa: N806 - DraftVersion = apps.get_model('publish', 'DraftVersion') # noqa: N806 + Dandiset = apps.get_model('api', 'Dandiset') # noqa: N806 + DraftVersion = apps.get_model('api', 'DraftVersion') # noqa: N806 for dandiset in Dandiset.objects.all(): try: @@ -24,7 +24,7 @@ def populate_drafts(apps, schema_editor): class Migration(migrations.Migration): dependencies = [ - ('publish', '0005_add_drafts_model'), + ('api', '0005_add_drafts_model'), ] operations = [ diff --git a/dandiapi/api/migrations/0007_deconstructable_file_field.py b/dandiapi/api/migrations/0007_deconstructable_file_field.py new file mode 100644 index 000000000..310814787 --- /dev/null +++ b/dandiapi/api/migrations/0007_deconstructable_file_field.py @@ -0,0 +1,23 @@ +from django.db import migrations + +import dandiapi.api.models.asset +import dandiapi.api.storage + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0006_populate_drafts_from_versions'), + ] + + operations = [ + migrations.AlterField( + model_name='asset', + name='blob', + field=dandiapi.api.storage.DeconstructableFileField( + blank=True, + storage=dandiapi.api.models.asset._get_asset_blob_storage, + upload_to=dandiapi.api.models.asset._get_asset_blob_prefix, + ), + ), + ] diff --git a/dandi/publish/migrations/0008_draft_version_related_name.py b/dandiapi/api/migrations/0008_draft_version_related_name.py similarity index 85% rename from dandi/publish/migrations/0008_draft_version_related_name.py rename to dandiapi/api/migrations/0008_draft_version_related_name.py index c9640f9bf..b435990fd 100644 --- a/dandi/publish/migrations/0008_draft_version_related_name.py +++ b/dandiapi/api/migrations/0008_draft_version_related_name.py @@ -7,7 +7,7 @@ class Migration(migrations.Migration): dependencies = [ - ('publish', '0007_deconstructable_file_field'), + ('api', '0007_deconstructable_file_field'), ] operations = [ @@ -19,7 +19,7 @@ class Migration(migrations.Migration): primary_key=True, related_name='draft_version', serialize=False, - to='publish.Dandiset', + to='api.Dandiset', ), ), ] diff --git a/dandi/publish/migrations/0009_remove_description.py b/dandiapi/api/migrations/0009_remove_description.py similarity index 87% rename from dandi/publish/migrations/0009_remove_description.py rename to dandiapi/api/migrations/0009_remove_description.py index 1f0603d25..888d0831d 100644 --- a/dandi/publish/migrations/0009_remove_description.py +++ b/dandiapi/api/migrations/0009_remove_description.py @@ -6,7 +6,7 @@ class Migration(migrations.Migration): dependencies = [ - ('publish', '0008_draft_version_related_name'), + ('api', '0008_draft_version_related_name'), ] operations = [ diff --git a/dandi/publish/migrations/0009_rename_modified.py b/dandiapi/api/migrations/0009_rename_modified.py similarity index 93% rename from dandi/publish/migrations/0009_rename_modified.py rename to dandiapi/api/migrations/0009_rename_modified.py index 01a30f3ea..238fe9f29 100644 --- a/dandi/publish/migrations/0009_rename_modified.py +++ b/dandiapi/api/migrations/0009_rename_modified.py @@ -6,7 +6,7 @@ class Migration(migrations.Migration): dependencies = [ - ('publish', '0008_draft_version_related_name'), + ('api', '0008_draft_version_related_name'), ] operations = [ diff --git a/dandi/publish/migrations/0010_timestampedmodel.py b/dandiapi/api/migrations/0010_timestampedmodel.py similarity index 97% rename from dandi/publish/migrations/0010_timestampedmodel.py rename to dandiapi/api/migrations/0010_timestampedmodel.py index ca163e20d..fa438f332 100644 --- a/dandi/publish/migrations/0010_timestampedmodel.py +++ b/dandiapi/api/migrations/0010_timestampedmodel.py @@ -7,7 +7,7 @@ class Migration(migrations.Migration): dependencies = [ - ('publish', '0009_rename_modified'), + ('api', '0009_rename_modified'), ] operations = [ diff --git a/dandi/publish/migrations/0011_merge.py b/dandiapi/api/migrations/0011_merge.py similarity index 64% rename from dandi/publish/migrations/0011_merge.py rename to dandiapi/api/migrations/0011_merge.py index 90f36ed67..d257bdd16 100644 --- a/dandi/publish/migrations/0011_merge.py +++ b/dandiapi/api/migrations/0011_merge.py @@ -6,8 +6,8 @@ class Migration(migrations.Migration): dependencies = [ - ('publish', '0010_timestampedmodel'), - ('publish', '0009_remove_description'), + ('api', '0010_timestampedmodel'), + ('api', '0009_remove_description'), ] operations = [] diff --git a/dandi/publish/migrations/__init__.py b/dandiapi/api/migrations/__init__.py similarity index 100% rename from dandi/publish/migrations/__init__.py rename to dandiapi/api/migrations/__init__.py diff --git a/dandi/publish/models/__init__.py b/dandiapi/api/models/__init__.py similarity index 100% rename from dandi/publish/models/__init__.py rename to dandiapi/api/models/__init__.py diff --git a/dandi/publish/models/asset.py b/dandiapi/api/models/asset.py similarity index 96% rename from dandi/publish/models/asset.py rename to dandiapi/api/models/asset.py index dc3538be6..47dcb97f9 100644 --- a/dandi/publish/models/asset.py +++ b/dandiapi/api/models/asset.py @@ -15,8 +15,8 @@ from django.db.models import Sum from django_extensions.db.models import TimeStampedModel -from dandi.publish.girder import GirderClient, GirderFile -from dandi.publish.storage import DeconstructableFileField, create_s3_storage +from dandiapi.api.girder import GirderClient, GirderFile +from dandiapi.api.storage import DeconstructableFileField, create_s3_storage from .version import Version diff --git a/dandi/publish/models/common.py b/dandiapi/api/models/common.py similarity index 100% rename from dandi/publish/models/common.py rename to dandiapi/api/models/common.py diff --git a/dandi/publish/models/dandiset.py b/dandiapi/api/models/dandiset.py similarity index 97% rename from dandi/publish/models/dandiset.py rename to dandiapi/api/models/dandiset.py index efbf858ed..02c66a4a2 100644 --- a/dandi/publish/models/dandiset.py +++ b/dandiapi/api/models/dandiset.py @@ -8,7 +8,7 @@ from django.db import models from django_extensions.db.models import TimeStampedModel -from dandi.publish.girder import GirderClient, GirderError +from dandiapi.api.girder import GirderClient, GirderError logger = logging.getLogger(__name__) diff --git a/dandi/publish/models/draft_version.py b/dandiapi/api/models/draft_version.py similarity index 100% rename from dandi/publish/models/draft_version.py rename to dandiapi/api/models/draft_version.py diff --git a/dandi/publish/models/version.py b/dandiapi/api/models/version.py similarity index 98% rename from dandi/publish/models/version.py rename to dandiapi/api/models/version.py index 1d5d000c2..5ed9eecfd 100644 --- a/dandi/publish/models/version.py +++ b/dandiapi/api/models/version.py @@ -10,7 +10,7 @@ from django.db import models from django_extensions.db.models import TimeStampedModel -from dandi.publish.girder import GirderClient +from dandiapi.api.girder import GirderClient from .common import SelectRelatedManager from .dandiset import Dandiset diff --git a/dandi/publish/storage.py b/dandiapi/api/storage.py similarity index 100% rename from dandi/publish/storage.py rename to dandiapi/api/storage.py diff --git a/dandi/publish/tasks.py b/dandiapi/api/tasks.py similarity index 85% rename from dandi/publish/tasks.py rename to dandiapi/api/tasks.py index 381b90389..dc0777f2e 100644 --- a/dandi/publish/tasks.py +++ b/dandiapi/api/tasks.py @@ -2,8 +2,8 @@ from celery.utils.log import get_task_logger from django.db.transaction import atomic -from dandi.publish.girder import GirderClient -from dandi.publish.models import Asset, Dandiset, Version +from dandiapi.api.girder import GirderClient +from dandiapi.api.models import Asset, Dandiset, Version logger = get_task_logger(__name__) diff --git a/dandi/publish/tests/__init__.py b/dandiapi/api/tests/__init__.py similarity index 100% rename from dandi/publish/tests/__init__.py rename to dandiapi/api/tests/__init__.py diff --git a/dandi/publish/tests/conftest.py b/dandiapi/api/tests/conftest.py similarity index 100% rename from dandi/publish/tests/conftest.py rename to dandiapi/api/tests/conftest.py diff --git a/dandi/publish/tests/factories.py b/dandiapi/api/tests/factories.py similarity index 92% rename from dandi/publish/tests/factories.py rename to dandiapi/api/tests/factories.py index 4a0f82004..a9cb9f38d 100644 --- a/dandi/publish/tests/factories.py +++ b/dandiapi/api/tests/factories.py @@ -1,7 +1,7 @@ from django.contrib.auth.models import User import factory.django -from dandi.publish.models import Asset, Dandiset, DraftVersion, Version +from dandiapi.api.models import Asset, Dandiset, DraftVersion, Version class UserFactory(factory.django.DjangoModelFactory): @@ -24,7 +24,7 @@ class Meta: # DandisetFactory. This will call DraftVersionFactory(dandiset=our_new_dandiset), thus skipping # the SubFactory. draft_version = factory.RelatedFactory( - 'dandi.publish.tests.factories.DraftVersionFactory', factory_related_name='dandiset' + 'dandiapi.api.tests.factories.DraftVersionFactory', factory_related_name='dandiset' ) diff --git a/dandi/publish/tests/fuzzy.py b/dandiapi/api/tests/fuzzy.py similarity index 100% rename from dandi/publish/tests/fuzzy.py rename to dandiapi/api/tests/fuzzy.py diff --git a/dandi/publish/tests/girder.py b/dandiapi/api/tests/girder.py similarity index 97% rename from dandi/publish/tests/girder.py rename to dandiapi/api/tests/girder.py index 16a574880..025fdac0e 100644 --- a/dandi/publish/tests/girder.py +++ b/dandiapi/api/tests/girder.py @@ -3,7 +3,7 @@ import factory -from dandi.publish.girder import GirderClient, GirderFile +from dandiapi.api.girder import GirderClient, GirderFile class _GirderClientFolderFactory(factory.DictFactory): diff --git a/dandi/publish/tests/test_asset.py b/dandiapi/api/tests/test_asset.py similarity index 99% rename from dandi/publish/tests/test_asset.py rename to dandiapi/api/tests/test_asset.py index 28db8657b..6031ddf74 100644 --- a/dandi/publish/tests/test_asset.py +++ b/dandiapi/api/tests/test_asset.py @@ -2,7 +2,7 @@ import pytest -from dandi.publish.models import Asset +from dandiapi.api.models import Asset from .fuzzy import TIMESTAMP_RE diff --git a/dandi/publish/tests/test_dandiset.py b/dandiapi/api/tests/test_dandiset.py similarity index 97% rename from dandi/publish/tests/test_dandiset.py rename to dandiapi/api/tests/test_dandiset.py index 1b6784a9d..20240f7ac 100644 --- a/dandi/publish/tests/test_dandiset.py +++ b/dandiapi/api/tests/test_dandiset.py @@ -1,6 +1,6 @@ import pytest -from dandi.publish.models import Dandiset +from dandiapi.api.models import Dandiset from .fuzzy import TIMESTAMP_RE diff --git a/dandi/publish/tests/test_stats.py b/dandiapi/api/tests/test_stats.py similarity index 100% rename from dandi/publish/tests/test_stats.py rename to dandiapi/api/tests/test_stats.py diff --git a/dandi/publish/tests/test_version.py b/dandiapi/api/tests/test_version.py similarity index 98% rename from dandi/publish/tests/test_version.py rename to dandiapi/api/tests/test_version.py index 09bfe0b17..714e7c3b1 100644 --- a/dandi/publish/tests/test_version.py +++ b/dandiapi/api/tests/test_version.py @@ -1,7 +1,7 @@ from django.core.exceptions import ValidationError import pytest -from dandi.publish.models import Version +from dandiapi.api.models import Version from .fuzzy import TIMESTAMP_RE diff --git a/dandi/publish/views/__init__.py b/dandiapi/api/views/__init__.py similarity index 100% rename from dandi/publish/views/__init__.py rename to dandiapi/api/views/__init__.py diff --git a/dandi/publish/views/asset.py b/dandiapi/api/views/asset.py similarity index 93% rename from dandi/publish/views/asset.py rename to dandiapi/api/views/asset.py index 2822cf4f4..bf4c2cdc8 100644 --- a/dandi/publish/views/asset.py +++ b/dandiapi/api/views/asset.py @@ -7,9 +7,9 @@ from rest_framework.viewsets import ReadOnlyModelViewSet from rest_framework_extensions.mixins import NestedViewSetMixin -from dandi.publish.models import Asset -from dandi.publish.views.common import DandiPagination -from dandi.publish.views.version import VersionSerializer +from dandiapi.api.models import Asset +from dandiapi.api.views.common import DandiPagination +from dandiapi.api.views.version import VersionSerializer class AssetSerializer(serializers.ModelSerializer): diff --git a/dandi/publish/views/common.py b/dandiapi/api/views/common.py similarity index 100% rename from dandi/publish/views/common.py rename to dandiapi/api/views/common.py diff --git a/dandi/publish/views/dandiset.py b/dandiapi/api/views/dandiset.py similarity index 92% rename from dandi/publish/views/dandiset.py rename to dandiapi/api/views/dandiset.py index 919490d6d..14cd2687a 100644 --- a/dandi/publish/views/dandiset.py +++ b/dandiapi/api/views/dandiset.py @@ -6,9 +6,9 @@ from rest_framework.response import Response from rest_framework.viewsets import ReadOnlyModelViewSet -from dandi.publish.girder import GirderClient -from dandi.publish.models import Dandiset -from dandi.publish.views.common import DandiPagination +from dandiapi.api.girder import GirderClient +from dandiapi.api.models import Dandiset +from dandiapi.api.views.common import DandiPagination class DandisetSerializer(serializers.ModelSerializer): diff --git a/dandi/publish/views/stats.py b/dandiapi/api/views/stats.py similarity index 92% rename from dandi/publish/views/stats.py rename to dandiapi/api/views/stats.py index e2fd78408..47a9275a3 100644 --- a/dandi/publish/views/stats.py +++ b/dandiapi/api/views/stats.py @@ -2,7 +2,7 @@ from rest_framework.decorators import api_view from rest_framework.response import Response -from dandi.publish.models import Asset, Dandiset +from dandiapi.api.models import Asset, Dandiset @api_view() diff --git a/dandi/publish/views/version.py b/dandiapi/api/views/version.py similarity index 88% rename from dandi/publish/views/version.py rename to dandiapi/api/views/version.py index 87232e4ea..078f5f45e 100644 --- a/dandi/publish/views/version.py +++ b/dandiapi/api/views/version.py @@ -6,10 +6,10 @@ from rest_framework.viewsets import ReadOnlyModelViewSet from rest_framework_extensions.mixins import DetailSerializerMixin, NestedViewSetMixin -from dandi.publish.models import Dandiset, Version -from dandi.publish.tasks import publish_version -from dandi.publish.views.common import DandiPagination -from dandi.publish.views.dandiset import DandisetSerializer +from dandiapi.api.models import Dandiset, Version +from dandiapi.api.tasks import publish_version +from dandiapi.api.views.common import DandiPagination +from dandiapi.api.views.dandiset import DandisetSerializer class VersionSerializer(serializers.ModelSerializer): diff --git a/dandi/asgi.py b/dandiapi/asgi.py similarity index 83% rename from dandi/asgi.py rename to dandiapi/asgi.py index 7d12304b0..bf8afa87a 100644 --- a/dandi/asgi.py +++ b/dandiapi/asgi.py @@ -3,7 +3,7 @@ import configurations.importer from django.core.asgi import get_asgi_application -os.environ['DJANGO_SETTINGS_MODULE'] = 'dandi.settings' +os.environ['DJANGO_SETTINGS_MODULE'] = 'dandiapi.settings' if not os.environ.get('DJANGO_CONFIGURATION'): raise ValueError('The environment variable "DJANGO_CONFIGURATION" must be set.') configurations.importer.install() diff --git a/dandi/celery.py b/dandiapi/celery.py similarity index 89% rename from dandi/celery.py rename to dandiapi/celery.py index b0bdb305d..6dc2d59f4 100644 --- a/dandi/celery.py +++ b/dandiapi/celery.py @@ -3,7 +3,7 @@ from celery import Celery import configurations.importer -os.environ['DJANGO_SETTINGS_MODULE'] = 'dandi.settings' +os.environ['DJANGO_SETTINGS_MODULE'] = 'dandiapi.settings' if not os.environ.get('DJANGO_CONFIGURATION'): raise ValueError('The environment variable "DJANGO_CONFIGURATION" must be set.') configurations.importer.install() diff --git a/dandi/settings.py b/dandiapi/settings.py similarity index 90% rename from dandi/settings.py rename to dandiapi/settings.py index b81f60d56..c94d9bff2 100644 --- a/dandi/settings.py +++ b/dandiapi/settings.py @@ -35,8 +35,8 @@ def after_binding(configuration: Type[ComposedConfiguration]) -> None: class DandiConfig(ConfigMixin): - WSGI_APPLICATION = 'dandi.wsgi.application' - ROOT_URLCONF = 'dandi.urls' + WSGI_APPLICATION = 'dandiapi.wsgi.application' + ROOT_URLCONF = 'dandiapi.urls' BASE_DIR = str(Path(__file__).absolute().parent.parent) @@ -44,7 +44,7 @@ class DandiConfig(ConfigMixin): @staticmethod def before_binding(configuration: Type[ComposedConfiguration]): - configuration.INSTALLED_APPS += ['dandi.publish.apps.PublishConfig'] + configuration.INSTALLED_APPS += ['dandiapi.api.apps.PublishConfig'] DANDI_DANDISETS_BUCKET_NAME = values.Value(environ_required=True) DANDI_GIRDER_API_URL = values.URLValue(environ_required=True) @@ -58,7 +58,7 @@ class DevelopmentConfiguration(DandiConfig, DevelopmentBaseConfiguration): class TestingConfiguration(DandiConfig, TestingBaseConfiguration): MINIO_STORAGE_MEDIA_BUCKET_NAME = 'test-django-storage' - DANDI_DANDISETS_BUCKET_NAME = 'test-dandi-dandisets' + DANDI_DANDISETS_BUCKET_NAME = 'test-dandiapi-dandisets' DANDI_GIRDER_API_KEY = 'testkey' DANDI_GIRDER_API_URL = 'http://girder.test/api/v1' diff --git a/dandi/urls.py b/dandiapi/urls.py similarity index 94% rename from dandi/urls.py rename to dandiapi/urls.py index 3849fd05f..2da8b22e8 100644 --- a/dandi/urls.py +++ b/dandiapi/urls.py @@ -6,7 +6,7 @@ from rest_framework import permissions from rest_framework_extensions.routers import ExtendedSimpleRouter -from dandi.publish.views import AssetViewSet, DandisetViewSet, VersionViewSet, stats_view +from dandiapi.api.views import AssetViewSet, DandisetViewSet, VersionViewSet, stats_view router = ExtendedSimpleRouter() ( diff --git a/dandi/wsgi.py b/dandiapi/wsgi.py similarity index 83% rename from dandi/wsgi.py rename to dandiapi/wsgi.py index cb13c0909..a42b8a6a3 100644 --- a/dandi/wsgi.py +++ b/dandiapi/wsgi.py @@ -3,7 +3,7 @@ import configurations.importer from django.core.wsgi import get_wsgi_application -os.environ['DJANGO_SETTINGS_MODULE'] = 'dandi.settings' +os.environ['DJANGO_SETTINGS_MODULE'] = 'dandiapi.settings' if not os.environ.get('DJANGO_CONFIGURATION'): raise ValueError('The environment variable "DJANGO_CONFIGURATION" must be set.') configurations.importer.install() diff --git a/docker-compose.override.yml b/docker-compose.override.yml index 001ca5e9d..5e0664eca 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -21,7 +21,7 @@ services: dockerfile: ./dev/django.Dockerfile command: [ "celery", "worker", - "--app", "dandi.celery", + "--app", "dandiapi.celery", "--loglevel", "info", "--without-heartbeat" ] diff --git a/manage.py b/manage.py index dfe6a78e2..27eb1a701 100755 --- a/manage.py +++ b/manage.py @@ -7,7 +7,7 @@ def main() -> None: - os.environ['DJANGO_SETTINGS_MODULE'] = 'dandi.settings' + os.environ['DJANGO_SETTINGS_MODULE'] = 'dandiapi.settings' # Production usage runs manage.py for tasks like collectstatic, # so DJANGO_CONFIGURATION should always be explicitly set in production os.environ.setdefault('DJANGO_CONFIGURATION', 'DevelopmentConfiguration') diff --git a/setup.py b/setup.py index aabf0f658..93bb8b32d 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ long_description = '' setup( - name='dandi-archive', + name='dandiapi', version='0.1.0', description='', long_description=long_description,