Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/uwcirg/cosri-patientsearch
Browse files Browse the repository at this point in the history
… into feature/frontend-dependencies-updates
  • Loading branch information
Amy Chen committed Jan 15, 2025
2 parents 3b956ab + 534a996 commit 6a5a384
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 70 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: 3.11

- name: Install Python linting dependencies
run: pip install black flake8
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
- name: Checkout git commit
uses: actions/checkout@v1

- name: Set up Python 3.7
- name: Set up Python 3.11
uses: actions/setup-python@v1
with:
python-version: 3.7
python-version: 3.11

- name: Install test runner
run: python3 -m pip install tox
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ COPY . .
RUN npm run build

# -----------------------------------------------------------------------------
FROM python:3.7 as backend
FROM python:3.11 as backend

RUN mkdir /opt/cosri-patientsearch
WORKDIR /opt/cosri-patientsearch
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ All views require Keycloak authentication. Keycloak roles determine authorizati
1) `git clone <this repository>`
2) `cp client_secrets.json.default client_secrets.json` # Edit to fit
3) `cp patientsearch.env.default patientsearch.env` # Edit to fit
4) `mkvirtualenv patientsearch` # Python 3.7
4) `mkvirtualenv patientsearch` # Python 3.11
5) `pip install nodeenv`
6) `nodeenv --python-virtualenv`
7) `pip install -e .`
Expand Down
5 changes: 4 additions & 1 deletion patientsearch/src/js/helpers/utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,10 @@ export function isInPast(dateString) {
const today = new Date();
const targetDate = new Date(dateString);
if (!isValid(targetDate)) return false;
return targetDate < today;
const diff = (today - targetDate); // in miniseconds
// this will check if diff is 5 minutes or more
// e.g. pad by 5 mins to give system time to transmit message, rather than indicate no next message time during processing
return diff > (1000 * 60 * 5);
}

/*
Expand Down
40 changes: 40 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "patientsearch"
dynamic = ["version"]
dependencies = [
"flask",
"flask-jwt-extended",
"flask-session",
"gunicorn",
"requests",
"redis",
"redis-dict",
"jmespath",
"python-json-logger",
]

[project.optional-dependencies]
dev = [
"pytest",
"pytest-flask",
"pytest-datadir",
"pytest-mock",
]

[tool.setuptools]
packages = ["patientsearch"]

[tool.pytest.ini_options]
addopts = "--color yes --verbose"
console_output_style = "classic"
filterwarnings = [
"module", # Only print each warning once per module
"ignore:^\"localhost\" is not a valid cookie domain, it must contain a.*:Warning",
"ignore::DeprecationWarning:dogpile", # Specific dependency warning
"ignore::DeprecationWarning:flask_user", # Specific dependency warning
"error:.*assertion is always true.*", # Error on bad assertions
]
2 changes: 1 addition & 1 deletion requirements.dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ importlib-metadata==4.8.1 # via pluggy, pytest
iniconfig==1.1.1 # via pytest
packaging==21.0 # via pytest
pluggy==1.0.0 # via pytest
py==1.10.0 # via pytest
py==1.11.0 # via pytest
pyparsing==2.4.7 # via packaging
pytest-datadir==1.3.1 # via patientsearch (setup.py)
pytest-flask==1.2.0 # via patientsearch (setup.py)
Expand Down
55 changes: 0 additions & 55 deletions setup.cfg

This file was deleted.

8 changes: 0 additions & 8 deletions setup.py

This file was deleted.

3 changes: 3 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ commands =
--cov patientsearch \
--cov-report xml:"{toxinidir}/coverage.xml" \
[]

[flake8]
max-line-length = 100

0 comments on commit 6a5a384

Please sign in to comment.