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

HOPE Add PDM #3751

Merged
merged 46 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
9dfe6e2
init pdm
pavlo-mk Apr 2, 2024
e66e6e1
Merge branch 'develop' into 182432_add_pdm
pavlo-mk Apr 3, 2024
a54c8c1
add changes to Dockerfile
pavlo-mk Apr 3, 2024
8c2d0ab
upd PYTHONPATH
pavlo-mk Apr 4, 2024
0f918fd
Merge branch 'develop' into 182432_add_pdm
pavlo-mk Apr 5, 2024
9b6b74b
update path
pavlo-mk Apr 5, 2024
2db91c3
upd
pavlo-mk Apr 8, 2024
3c5a417
upd dockerfile
pavlo-mk Apr 9, 2024
c6830d9
linter & upd lock file
pavlo-mk Apr 9, 2024
b416ff2
Merge branch 'develop' into 182432_add_pdm
pavlo-mk Apr 9, 2024
b84aa99
Merge branch 'develop' into 182432_add_pdm
pavlo-mk Apr 9, 2024
c8ac13f
Merge branch 'develop' into 182432_add_pdm
pavlo-mk Apr 10, 2024
b68bf0d
add pytest-html
pavlo-mk Apr 10, 2024
bb42154
add test get_version
pavlo-mk Apr 11, 2024
5e44df9
upd test
pavlo-mk Apr 11, 2024
d902aae
Merge branch 'develop' into 182432_add_pdm
pavlo-mk Apr 15, 2024
1b01b72
minor fixes
pavlo-mk Apr 16, 2024
6874f90
refactoring
pavlo-mk Apr 16, 2024
8ef4f92
upd dependencies list
pavlo-mk Apr 16, 2024
f5a2118
upd bump version & docker file
pavlo-mk Apr 17, 2024
f7d1231
Merge branch 'develop' into 182432_add_pdm
pavlo-mk Apr 17, 2024
b539c8c
merge develop
pavlo-mk May 7, 2024
1f8d6af
black
pavlo-mk May 7, 2024
a49845b
upd lock file & black
pavlo-mk May 7, 2024
475a0df
mypy & add more info about pdm
pavlo-mk May 8, 2024
6f78235
Merge branch 'develop' into 182432_add_pdm
pavlo-mk May 8, 2024
d875cf6
black
pavlo-mk May 8, 2024
da66d7c
upd Dockerfile & pdm.lock
pavlo-mk May 8, 2024
9ac8bd7
test new Docker file
pavlo-mk May 8, 2024
75bbb9f
upd PATH
pavlo-mk May 9, 2024
58395d3
resolve conflicts
pavlo-mk May 9, 2024
139cfb8
clenup & add new docker env
pavlo-mk May 9, 2024
292e87d
black & more add info
pavlo-mk May 9, 2024
fd0bd9a
drf-extensions
pavlo-mk May 10, 2024
1e774fd
Merge branch 'develop' into 182432_add_pdm
pavlo-mk May 10, 2024
f3d2e72
add pytest-html-reporter
pavlo-mk May 10, 2024
4c909db
black
pavlo-mk May 10, 2024
727afa9
add test
pavlo-mk May 10, 2024
349e831
upd Docker file
pavlo-mk May 10, 2024
6508ac9
Merge branch 'develop' into 182432_add_pdm
pavlo-mk May 14, 2024
46319f6
black
pavlo-mk May 14, 2024
ecfa942
Merge remote-tracking branch 'origin/182432_add_pdm' into 182432_add_pdm
pavlo-mk May 14, 2024
401622c
black
pavlo-mk May 14, 2024
10fbd1a
isort
pavlo-mk May 14, 2024
f99726f
Merge branch 'develop' into 182432_add_pdm
pavlo-mk May 14, 2024
7d7c845
review
pavlo-mk May 14, 2024
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ backend/test-results/
backend/lint-results/
backend/mypy-results/
backend/screenshot/
backend/__pypackages__/
cypress-results/
cypress-reports/

Expand Down
3 changes: 2 additions & 1 deletion backend/.flake8
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ exclude =
# This contains builds of flake8 that we don't want to check
dist,
migrations,
snapshots
snapshots,
__pypackages__,

ignore =
# black formatting related
Expand Down
1 change: 1 addition & 0 deletions backend/.pdm-python
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/usr/local/bin/python
pavlo-mk marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion backend/hct_mis_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
def get_full_version() -> str:
with open("pyproject.toml", mode="rb") as fp:
config = tomli.load(fp)
return config["tool"]["poetry"]["version"]
return config["project"]["version"]
2 changes: 1 addition & 1 deletion backend/hct_mis_api/api/endpoints/rdi/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def create(self, validated_data: Dict) -> Dict:
number_of_households=info.households,
datahub_id=str(rdi_datahub.pk),
business_area=self.business_area,
program=program
program=program,
)
rdi_datahub.hct_id = rdi_mis.id
rdi_datahub.save()
Expand Down
2 changes: 1 addition & 1 deletion backend/hct_mis_api/apps/geo/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def get_choices(
include_blank: bool = True,
blank_choice: Optional[List[Union[Tuple[Any, Any], Tuple[str, Iterable[Tuple[Any, Any]]]]]] = None,
*args: Any,
**kwargs: Any
**kwargs: Any,
) -> List:
if self.choices and self.choices[0] == (None, None):
self.choices = Country.objects.all().values_list("iso_code2", "name")
Expand Down
6 changes: 3 additions & 3 deletions backend/hct_mis_api/apps/grievance/tests/test_grievance_es.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ def setUpTestData(cls) -> None:
}
)

cls.es.index(
cls.es.index( # type: ignore
index="test_es_db",
doc_type="_doc",
id=cls.grievance_ticket_1.id,
Expand Down Expand Up @@ -405,7 +405,7 @@ def setUpTestData(cls) -> None:
}
)

cls.es.index(
cls.es.index( # type: ignore
index="test_es_db",
doc_type="_doc",
id=cls.grievance_ticket_2.id,
Expand Down Expand Up @@ -447,7 +447,7 @@ def setUpTestData(cls) -> None:
}
)

cls.es.index(
cls.es.index( # type: ignore
index="test_es_db",
doc_type="_doc",
id=cls.grievance_ticket_3.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def test_update_referral_ticket_with_household_and_individual_extras(
) -> None:
self.create_user_role_with_permissions(self.user, permissions, self.business_area)

extras = {
extras: Dict = {
"household": self.id_to_base64(self.household.id, "HouseholdNode"),
"individual": self.id_to_base64(self.individuals[0].id, "IndividualNode"),
}
Expand Down
22 changes: 22 additions & 0 deletions backend/hct_mis_api/apps/utils/tests/test_get_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from typing import Any
from unittest.mock import mock_open, patch

from django.test import TestCase

from hct_mis_api import get_full_version


class TestUtils(TestCase):
@patch("builtins.open", new_callable=mock_open, read_data=b'[project]\n version = "2.3.4"')
def test_get_full_version(self, mock_file_open: Any) -> None:
self.assertEqual(get_full_version(), "2.3.4")

@patch("builtins.open", side_effect=FileNotFoundError)
def test_file_not_found(self, mock_file_open: Any) -> None:
with self.assertRaises(FileNotFoundError):
get_full_version()

@patch("builtins.open", new_callable=mock_open, read_data=b'[project]\n wrong_key = "empty_version_XD"')
def test_key_not_found(self, mock_file_open: Any) -> None:
with self.assertRaises(KeyError):
get_full_version()
4,227 changes: 4,227 additions & 0 deletions backend/pdm.lock

Large diffs are not rendered by default.

Loading
Loading