Skip to content

Commit

Permalink
Merge pull request #172 from JSv4/JSv4/post-2-0-0-fixes
Browse files Browse the repository at this point in the history
Upgrade Django App Dependencies to work with Django LTS
  • Loading branch information
JSv4 authored Jul 30, 2024
2 parents d26b78c + 01ce5ef commit 1a584dd
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 6 deletions.
4 changes: 4 additions & 0 deletions compose/local/django/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
# Requirements are installed here to ensure they will be cached.
COPY ./requirements .

RUN pip install --upgrade pip

# Create Python Dependency and Sub-Dependency Wheels.
RUN pip wheel --wheel-dir /usr/src/app/wheels \
-r ${BUILD_ENVIRONMENT}.txt
Expand Down Expand Up @@ -74,6 +76,8 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
# copy python dependency wheels from python-build-stage
COPY --from=python-build-stage /usr/src/app/wheels /wheels/

RUN pip install --upgrade pip

# Install CPU-less requirements
RUN pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
RUN pip install sentence-transformers
Expand Down
1 change: 1 addition & 0 deletions config/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
application = get_wsgi_application()

# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplication(application)
4 changes: 3 additions & 1 deletion opencontractserver/tests/test_corpus_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ def setUp(self):
)

@override_settings(CELERY_TASK_ALWAYS_EAGER=True)
@vcr.use_cassette("fixtures/vcr_cassettes/run_query.yaml")
@vcr.use_cassette(
"fixtures/vcr_cassettes/run_query.yaml", filter_headers=["authorization"]
)
def test_run_query(self):

print(self.query)
Expand Down
5 changes: 4 additions & 1 deletion opencontractserver/tests/test_extract_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@ def setUp(self):
self.extract.save()

@override_settings(CELERY_TASK_ALWAYS_EAGER=True)
@vcr.use_cassette("fixtures/vcr_cassettes/test_run_extract_task.yaml")
@vcr.use_cassette(
"fixtures/vcr_cassettes/test_run_extract_task.yaml",
filter_headers=["authorization"],
)
def test_run_extract_task(self):
print(f"{self.extract.documents.all()}")

Expand Down
4 changes: 2 additions & 2 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ crispy-bootstrap5==0.7 # https://github.com/django-crispy-forms/crispy-bootstra
django-redis==5.2.0 # https://github.com/jazzband/django-redis
django-filter==22.1 # https://github.com/carltongibson/django-filter
django-storages[boto3]==1.13.1 # https://github.com/jschneier/django-storages
django-extensions==3.2.0 # https://github.com/django-extensions/django-extensions
django-extensions==3.2.3 # https://github.com/django-extensions/django-extensions
whitenoise
django-tree-queries
pgvector # For vector embeddings
Expand Down Expand Up @@ -63,7 +63,7 @@ marvin==2.3.4

# Data Processing Tools
# -------------------------------------------------------------------------------
opencv-python==4.7.0.68 # https://github.com/opencv/opencv-python
opencv-python==4.10.0.84 # https://github.com/opencv/opencv-python
filetype==1.2.0 # https://github.com/h2non/filetype.py

# Permissioning
Expand Down
4 changes: 2 additions & 2 deletions requirements/local.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ watchgod==0.8.2 # https://github.com/samuelcolvin/watchgod
# Testing
# ------------------------------------------------------------------------------
mypy==0.991 # https://github.com/python/mypy
django-stubs==1.13.0 # https://github.com/typeddjango/django-stubs
django-stubs==4.2.7 # https://github.com/typeddjango/django-stubs
pytest==8.2.2 # https://github.com/pytest-dev/pytest
pytest-cov==4.0.0 # https://github.com/pytest-dev/pytest-cov
pytest-sugar==0.9.5 # https://github.com/Frozenball/pytest-sugar
djangorestframework-stubs==1.8.0 # https://github.com/typeddjango/djangorestframework-stubs
responses==0.22.0 # https://github.com/getsentry/responses
vcrpy==6.0.1 # https://vcrpy.readthedocs.io/en/latest/
git+https://github.com/kevin1024/vcrpy.git@35650b141b5689eed84eac05c23b48412c76dd52 # VCR.py 6.0.* has deprecated setuptools which broke recently.

# Profiling
# ------------------------------------------------------------------------------
Expand Down

0 comments on commit 1a584dd

Please sign in to comment.