Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing package error when first using docker-compose setup #1158

Merged
merged 2 commits into from
Sep 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dandiapi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from importlib.metadata import version

# This project module is imported for us when Django starts. To ensure that Celery app is always
# defined prior to any shared_task definitions (so those tasks will bind to the app), import
# the Celery module here for side effects.
from pkg_resources import get_distribution

from .celery import app as _celery_app # noqa: F401

__version__ = get_distribution('dandiapi').version
__version__ = version('dandiapi')
5 changes: 4 additions & 1 deletion dev/django.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ COPY ./setup.py /opt/django-project/setup.py
# Copy git folder for setuptools_scm
COPY ./.git/ /opt/django-project/.git/

RUN pip install --editable /opt/django-project[dev]
# Don't install as editable, so that when the directory is mounted over with docker-compose, the
# installation still exists (otherwise the dandiapi.egg-info/ directory would be overwritten, and
# the installation would no longer exist)
RUN pip install /opt/django-project[dev]

# Use a directory name which will never be an import name, as isort considers this as first-party.
WORKDIR /opt/django-project