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

Upgrade Python 3.10 -> 3.11 & Node 16 -> 20 #280

Merged
merged 9 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from 7 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/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'
cache: 'pip'
cache-dependency-path: 'requirements/*/**.txt'
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- run: npm run build
- uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'
cache: 'pip'
cache-dependency-path: 'requirements/*/**.txt'
- name: Cache pre-commit
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/erbium
lts/iron
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
repos:
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 24.4.2
hooks:
- id: black
language_version: python3.10
language_version: python3.11
exclude: migrations
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM node:16-alpine as static_files
FROM node:20-bookworm-slim as static_files
WORKDIR /code
ENV PATH /code/node_modules/.bin:$PATH
COPY package.json package-lock.json webpack.config.js /code/
RUN npm install --silent
COPY . /code/
RUN npm run build

FROM python:3.10-slim-bullseye as base
FROM python:3.11-slim-bookworm as base

# Install packages needed to run your application (not build deps):
# mime-support -- for mime types when serving static files
Expand Down Expand Up @@ -101,7 +101,7 @@ ENTRYPOINT ["/code/docker-entrypoint.sh"]
CMD ["newrelic-admin", "run-program", "uwsgi", "--single-interpreter", "--enable-threads", "--show-config"]


FROM python:3.10-slim-bullseye AS dev
FROM python:3.11-slim-bookworm AS dev

ARG USERNAME=appuser
ARG USER_UID=1000
Expand Down Expand Up @@ -161,7 +161,7 @@ RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/
&& curl https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor | tee /etc/apt/trusted.gpg.d/docker.gpg >/dev/null \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/trusted.gpg.d/docker.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null \
# nodejs
&& sh -c 'echo "deb https://deb.nodesource.com/node_16.x $(lsb_release -cs) main" > /etc/apt/sources.list.d/nodesource.list' \
&& sh -c 'echo "deb https://deb.nodesource.com/node_20.x $(lsb_release -cs) main" > /etc/apt/sources.list.d/nodesource.list' \
&& wget --quiet -O- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
# PostgreSQL
&& sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' \
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
## ✏️ **Develop**
To begin you should have the following applications installed on your local development system:

- Python >= 3.10
- NodeJS == 16.13.x
- npm == 8.1.x (comes with node 16)
- Python >= 3.11
- NodeJS == 20.5.x
- npm == 9.8.x (comes with node 16)
- [nvm](https://github.com/nvm-sh/nvm/blob/master/README.md) is not strictly _required_, but will almost certainly be necessary unless you just happen to have Node.js 16.x installed on your machine.
- [pip](http://www.pip-installer.org/) >= 20
- [virtualenv](http://www.virtualenv.org/) >= 1.10
Expand Down
16 changes: 10 additions & 6 deletions apps/disease_control/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@ def get_disease_control_services_qs():
def get_visible_section_headers():
return [
"Topic-specific Guidance" if get_topic_specific_guidance_qs().exists() else "",
"Facility-specific Guidance"
if get_facility_specific_guidance_qs().exists()
else "",
"Disease Control Services"
if get_disease_control_services_qs().exists()
else "",
(
"Facility-specific Guidance"
if get_facility_specific_guidance_qs().exists()
else ""
),
(
"Disease Control Services"
if get_disease_control_services_qs().exists()
else ""
),
]
2 changes: 1 addition & 1 deletion apps/hip/tests/test_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def test_only_pdfs_are_scaned(db, mocker):
mock_scan_function = mocker.patch("apps.hip.forms.scan_pdf_for_malicious_content")

# Uploading a non-PDF file does not call scan_pdf_for_malicious_content()
for (extension, content_type) in [
for extension, content_type in [
("png", "image/png"),
("jpg", "image/jpeg"),
("jpeg", "image/jpeg"),
Expand Down
14 changes: 8 additions & 6 deletions apps/reports/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@ def get_context(self, request):
"title": r.title,
"url": r.url,
"update_frequency": r.staticpage.datareportdetailpage.update_frequency,
"last_updated": r.latest_revision_created_at.date()
if r.latest_revision_created_at
else None,
"last_updated": (
r.latest_revision_created_at.date()
if r.latest_revision_created_at
else None
),
"associated_disease": r.staticpage.datareportdetailpage.associated_disease,
"external": False,
}
Expand Down Expand Up @@ -135,9 +137,9 @@ class DataReportDetailArchiveListPage(HipBasePage):

def get_context(self, request):
context = super().get_context(request)
context[
"archived_reports"
] = DataReportDetailArchiveDetailPage.objects.child_of(self).order_by("-year")
context["archived_reports"] = (
DataReportDetailArchiveDetailPage.objects.child_of(self).order_by("-year")
)
return context


Expand Down
Loading
Loading