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

Move django-heroku to prod dependencies, update requirements #457

Merged
merged 1 commit into from
Dec 19, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
installer-parallel: true
- name: Install dependencies with Poetry
run: |
poetry install --no-root --with=dev
poetry install --no-root --with=prod
# add virtual environment to path for future steps
echo .venv/bin >> $GITHUB_PATH
- name: Run Tests
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-merge-conflict
- id: detect-private-key
Expand Down Expand Up @@ -29,18 +29,18 @@ repos:
verbose: true # always display output
# dependencies
- repo: https://github.com/python-poetry/poetry
rev: 1.6.0
rev: 1.7.0
hooks:
- id: poetry-check
- id: poetry-export
args: ["-f", "requirements.txt", "-o", "requirements.txt", "--without-hashes", "--with", "prod"]
# js
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
rev: v3.1.0
hooks:
- id: prettier
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.50.0
rev: v8.54.0
hooks:
- id: eslint
exclude: 'webpack\.config\.js'
Expand All @@ -50,7 +50,7 @@ repos:
args: ["--fix"]
# (s)css
- repo: https://github.com/thibaudcolas/pre-commit-stylelint
rev: v15.10.3
rev: v15.11.0
hooks:
- id: stylelint
args: ["--fix"]
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.django
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ENV PATH $VIRTUAL_ENV/bin:$PATH

# install python dependencies
COPY poetry.lock pyproject.toml ./
RUN poetry install --no-root --with=dev
RUN poetry install --no-root --with=prod

# start database
COPY ./docker-django-entrypoint.sh ./
Expand Down
1,190 changes: 597 additions & 593 deletions poetry.lock

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ boto3 = "^1.26.39"
django = "^4.1.4"
django-csp = "^3.7"
django-extensions = "^3.2.1"
django-heroku = "^0.3.1"
django-postgres-extra = "^2.0.6"
django-storages = "^1.13.2"
djangorestframework = "^3.14.0"
Expand All @@ -35,6 +34,10 @@ freezegun = "^1.2.2"
# console
ipython = "^8.7.0"

# prod dependencies that are still imported
sentry-sdk = "^1.12.1"
social-auth-app-django = "^5.0.0"

[tool.poetry.group.dev.dependencies]
# formatting/linting
black = "^22.12.0"
Expand All @@ -43,13 +46,16 @@ pre-commit = "^2.21.0"
pylint = "^2.15.9"
pylint-django = "^2.5.3"

[tool.poetry.group.prod]
# mark prod as optional; these are not needed during development
optional = true

[tool.poetry.group.prod.dependencies]
# django
django-heroku = "^0.3.1"
psycopg2-binary = "^2.9.5"
social-auth-app-django = "^5.0.0"
# heroku
gunicorn = "^20.1.0"
sentry-sdk = "^1.12.1"

### tools ###

Expand Down
80 changes: 39 additions & 41 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,72 +1,70 @@
appnope==0.1.3 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0" and sys_platform == "darwin"
asgiref==3.7.2 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
asttokens==2.2.1 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
backcall==0.2.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
boto3==1.26.142 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
botocore==1.29.142 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
certifi==2023.5.7 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
cffi==1.15.1 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
charset-normalizer==3.1.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
asttokens==2.4.1 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
boto3==1.29.6 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
botocore==1.32.6 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
certifi==2023.11.17 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
cffi==1.16.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
charset-normalizer==3.3.2 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
colorama==0.4.6 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0" and sys_platform == "win32"
cryptography==40.0.2 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
cryptography==41.0.5 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
decorator==5.1.1 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
defusedxml==0.7.1 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
dj-database-url==2.0.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
dj-database-url==2.1.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
django-csp==3.7 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
django-extensions==3.2.1 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
django-extensions==3.2.3 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
django-heroku==0.3.1 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
django-postgres-extra==2.0.8 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
django-storages==1.13.2 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
django==4.2.1 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
django-storages==1.14.2 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
django==4.2.7 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
djangorestframework-camel-case==1.4.2 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
djangorestframework==3.14.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
drf-nested-forms==1.1.7 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
exceptiongroup==1.1.1 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
executing==1.2.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
factory-boy==3.2.1 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
faker==18.9.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
drf-nested-forms==1.1.8 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
exceptiongroup==1.2.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
executing==2.0.1 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
factory-boy==3.3.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
faker==20.1.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
freezegun==1.2.2 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
gunicorn==20.1.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
idna==3.4 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
iniconfig==2.0.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
ipython==8.13.2 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
jedi==0.18.2 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
ipython==8.17.2 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
jedi==0.19.1 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
jmespath==1.0.1 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
matplotlib-inline==0.1.6 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
networkx==2.8.8 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
oauthlib==3.2.2 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
packaging==23.1 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
packaging==23.2 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
parso==0.8.3 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
pexpect==4.8.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0" and sys_platform != "win32"
pickleshare==0.7.5 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
pluggy==1.0.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
prompt-toolkit==3.0.38 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
psycopg2-binary==2.9.6 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
psycopg2==2.9.6 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
pluggy==1.3.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
prompt-toolkit==3.0.41 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
psycopg2-binary==2.9.9 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
psycopg2==2.9.9 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
ptyprocess==0.7.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0" and sys_platform != "win32"
pure-eval==0.2.2 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
pycparser==2.21 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
pygments==2.15.1 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
pyjwt==2.7.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
pytest-django==4.5.2 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
pytest==7.3.1 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
pygments==2.17.2 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
pyjwt==2.8.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
pytest-django==4.7.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
pytest==7.4.3 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
python-dateutil==2.8.2 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
python3-openid==3.2.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
pytz==2023.3 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
pytz==2023.3.post1 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
requests-oauthlib==1.3.1 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
requests==2.31.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
s3transfer==0.6.1 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
sentry-sdk==1.24.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
setuptools==67.8.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
s3transfer==0.7.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
sentry-sdk==1.36.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
setuptools==69.0.2 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
six==1.16.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
social-auth-app-django==5.2.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
social-auth-core==4.4.2 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
social-auth-app-django==5.4.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
social-auth-core==4.5.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
sqlparse==0.4.4 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
stack-data==0.6.2 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
stack-data==0.6.3 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
tomli==2.0.1 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
traitlets==5.9.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
typing-extensions==4.6.2 ; python_full_version >= "3.9.13" and python_version < "3.10"
traitlets==5.13.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
typing-extensions==4.8.0 ; python_full_version >= "3.9.13" and python_version < "3.10"
tzdata==2023.3 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0" and sys_platform == "win32"
urllib3==1.26.16 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
wcwidth==0.2.6 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
whitenoise==6.4.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
urllib3==1.26.18 ; python_full_version >= "3.9.13" and python_version < "3.10"
wcwidth==0.2.12 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
whitenoise==6.6.0 ; python_full_version >= "3.9.13" and python_full_version < "3.10.0"
7 changes: 4 additions & 3 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ then
exit 1
elif ! ( command -v psql ) > /dev/null
then
echo 'You must have postgres installed before running this script! (See https://www.postgresql.org/download)' 1>&2
exit 1
echo 'You do not have PostgreSQL installed; this is okay, but you will be required to use Docker for any interactions with the database. (See https://www.postgresql.org/download for installation instructions.)' 1>&2
elif ! (command -v docker) > /dev/null
then
echo 'You must have docker installed before running this script! (See https://www.docker.com)' 1>&2
Expand All @@ -49,8 +48,10 @@ sleep 1 # Give user time to read above message

# Node and Python requirements
npm ci
# Before using Poetry, make sure poetry-plugin-export is added to poetry
poetry self add poetry-plugin-export
# The LDFLAGS are specified so that heroku's implicit psycopg2 (*not* binary) dependency will build successfully on macOS
LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" poetry install --no-root --with=dev
LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" poetry install --no-root
# Activate virtual environment (only local to this script)
source $(poetry env info --path)/bin/activate

Expand Down
Loading