Skip to content

Commit

Permalink
Restructure
Browse files Browse the repository at this point in the history
  • Loading branch information
banesullivan committed Mar 22, 2022
1 parent d1afabf commit 16364e5
Show file tree
Hide file tree
Showing 49 changed files with 56 additions and 43 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,5 @@ dmypy.json
.pyre/

# End of https://www.gitignore.io/api/django

.ipynb_checkpoints
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Include any data files such as templates or static assets in the source distribution
graft example
graft django_large_image/static
graft django_large_image/templates
7 changes: 4 additions & 3 deletions dev/django.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ ENV PYTHONUNBUFFERED 1
# but find_packages() will find nothing (which is fine). When Docker Compose mounts the real source
# over top of this directory, the .egg-link in site-packages resolves to the mounted directory
# and all package modules are importable.
COPY ./django-large-image/setup.py /opt/django-project/django-large-image/setup.py
COPY ./project/setup.py /opt/django-project/project/setup.py
COPY ./setup.py /opt/django-project/setup.py

RUN pip install --editable /opt/django-project/django-large-image[dev,colormaps]
RUN pip install --find-links https://girder.github.io/large_image_wheels --editable /opt/django-project[dev]
RUN pip install --find-links https://girder.github.io/large_image_wheels \
--editable /opt/django-project[dev,colormaps] \
--editable /opt/django-project/project[dev]

# Use a directory name which will never be an import name, as isort considers this as first-party.
WORKDIR /opt/django-project
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
build:
context: .
dockerfile: ./dev/django.Dockerfile
command: ["./manage.py", "runserver", "0.0.0.0:8000"]
command: ["./project/manage.py", "runserver", "0.0.0.0:8000"]
# Log printing via Rich is enhanced by a TTY
tty: false
env_file: ./dev/.env.docker-compose
Expand Down
3 changes: 1 addition & 2 deletions django-large-image/MANIFEST.in → project/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# Include any data files such as templates or static assets in the source distribution
graft django_large_image/static
graft django_large_image/templates
graft example
File renamed without changes.
4 changes: 4 additions & 0 deletions project/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Example Project

This is an example Django project in the Girder4 fashion to demonstrate how
`django-large-image` can be used.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
31 changes: 24 additions & 7 deletions django-large-image/setup.py → project/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from setuptools import find_packages, setup

readme_file = Path(__file__).parent.parent / 'README.md'
readme_file = Path(__file__).parent / 'README.md'
if readme_file.exists():
with readme_file.open() as f:
long_description = f.read()
Expand All @@ -11,7 +11,7 @@
long_description = ''

setup(
name='django-large-image',
name='example',
version='0.1.0',
description='',
long_description=long_description,
Expand All @@ -37,16 +37,33 @@
include_package_data=True,
install_requires=[
'django>=3.2',
'django-allauth',
'django-configurations[database,email]',
'django-extensions',
'django-girder-utils',
'django-filter',
'django-oauth-toolkit<1.6.0',
'djangorestframework',
'drf-yasg',
'large-image>=1.9.0',
# Production-only
'django-composed-configuration[prod]>=0.18',
'django-s3-file-field[boto3]',
'gunicorn',
'django-large-image',
'large-image-source-gdal>=1.9.0',
'large-image-source-pil>=1.9.0',
],
extras_require={
'colormaps': [
'matplotlib',
'cmocean',
'dev': [
'django-composed-configuration[dev]>=0.18',
'django-debug-toolbar',
'django-s3-file-field[minio]',
'ipython',
'tox',
],
'graph': [
'pygraphviz',
'pyparsing',
'pydot',
],
},
)
31 changes: 7 additions & 24 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
long_description = ''

setup(
name='example',
name='django-large-image',
version='0.1.0',
description='',
long_description=long_description,
Expand All @@ -36,34 +36,17 @@
packages=find_packages(),
include_package_data=True,
install_requires=[
'django>=3.2',
'django-allauth',
'django-configurations[database,email]',
'django~=3.2',
'django-extensions',
'django-filter',
'django-oauth-toolkit<1.6.0',
'django-girder-utils',
'djangorestframework',
'drf-yasg',
# Production-only
'django-composed-configuration[prod]>=0.18',
'django-s3-file-field[boto3]',
'gunicorn',
'django-large-image',
'large-image-source-gdal>=1.9.0',
'large-image-source-pil>=1.9.0',
'large-image>=1.9.0',
],
extras_require={
'dev': [
'django-composed-configuration[dev]>=0.18',
'django-debug-toolbar',
'django-s3-file-field[minio]',
'ipython',
'tox',
],
'graph': [
'pygraphviz',
'pyparsing',
'pydot',
'colormaps': [
'matplotlib',
'cmocean',
],
},
)
16 changes: 11 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ commands =
black {posargs:.}

[testenv:test]
changedir = project
passenv =
DJANGO_CELERY_BROKER_URL
DJANGO_DATABASE_URL
Expand All @@ -50,17 +51,20 @@ passenv =
DJANGO_MINIO_STORAGE_SECRET_KEY
extras =
dev
colormaps
deps =
factory-boy
pytest
pytest-django
pytest-factoryboy
pytest-mock
-e ./django-large-image[colormaps,dev]
-e .[dev,colormaps]
-e ./project[dev]
commands =
pytest {posargs}

[testenv:check-migrations]
changedir = project
setenv =
DJANGO_CONFIGURATION = TestingConfiguration
PIP_FIND_LINKS = https://girder.github.io/large_image_wheels
Expand All @@ -71,20 +75,22 @@ passenv =
DJANGO_MINIO_STORAGE_ENDPOINT
DJANGO_MINIO_STORAGE_SECRET_KEY
deps =
-e ./django-large-image
-e .[dev]
-e ./project[dev]
extras =
dev
commands =
{envpython} ./manage.py makemigrations --check --dry-run
{envpython} ./project/manage.py makemigrations --check --dry-run

[testenv:graph-models]
changedir = project
setenv =
PIP_FIND_LINKS = https://girder.github.io/large_image_wheels
deps =
-e ./django-large-image
-e .[dev]
-e ./project[dev,graph]
extras =
dev
graph
passenv =
DJANGO_CONFIGURATION
DJANGO_DATABASE_URL
Expand Down

0 comments on commit 16364e5

Please sign in to comment.