From a4d4364ab3995147a216d46ecbd65a4bf478be20 Mon Sep 17 00:00:00 2001 From: LuptonM Date: Thu, 2 Mar 2023 18:35:41 +0000 Subject: [PATCH 01/14] added serializer for map data for freeport map --- great_international/serializers.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/great_international/serializers.py b/great_international/serializers.py index 561d4a68..48c174e6 100644 --- a/great_international/serializers.py +++ b/great_international/serializers.py @@ -311,6 +311,25 @@ class InternationalArticlePageSerializer(BasePageSerializer): cta_link = serializers.CharField() tags = core_fields.TagsListField() + + freeport_data = serializers.SerializerMethodField() + # import pdb + # pdb.set_trace() + def get_freeport_data(self, instance): + # if instance.type_of_article == 'Freeport landing': + queryset = InvestmentOpportunityPage.objects.live().public().filter(investment_type__name = 'Freeport') + import pdb + # pdb.set_trace() + if not queryset: + return [] + + serializer = InvestmentOpportunityForListPageSerializer( + queryset, + many=True, + allow_null=True, + context=self.context + ) + return serializer.data class GreatMediaSerializer(serializers.Serializer): From 20c8444e06e1da0698b2a66cc3aa005be6db20c2 Mon Sep 17 00:00:00 2001 From: LuptonM Date: Wed, 8 Mar 2023 15:33:53 +0000 Subject: [PATCH 02/14] edit type of article panel --- great_international/panels/great_international.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/great_international/panels/great_international.py b/great_international/panels/great_international.py index 4566420c..fd82ddf1 100644 --- a/great_international/panels/great_international.py +++ b/great_international/panels/great_international.py @@ -283,7 +283,7 @@ class InternationalArticlePagePanels: content_panels = [ FieldPanel('title'), FieldPanel('article_title'), - FieldPanel('type_of_article'), + FieldPanel('type_of_article', widget=Select), ImageChooserPanel('hero_image'), MediaChooserPanel('hero_video'), MultiFieldPanel( @@ -312,7 +312,6 @@ class InternationalArticlePagePanels: ] settings_panels = [ - FieldPanel('type_of_article', widget=Select), FieldPanel('slug'), FieldPanel('tags', widget=CheckboxSelectMultiple) ] From 5e532533b13140ad4248cf3469aec7a1a2eeec86 Mon Sep 17 00:00:00 2001 From: LuptonM Date: Wed, 8 Mar 2023 15:36:18 +0000 Subject: [PATCH 03/14] remove stacktrace --- great_international/serializers.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/great_international/serializers.py b/great_international/serializers.py index 48c174e6..fdd59422 100644 --- a/great_international/serializers.py +++ b/great_international/serializers.py @@ -313,13 +313,10 @@ class InternationalArticlePageSerializer(BasePageSerializer): tags = core_fields.TagsListField() freeport_data = serializers.SerializerMethodField() - # import pdb - # pdb.set_trace() + def get_freeport_data(self, instance): - # if instance.type_of_article == 'Freeport landing': + if instance.type_of_article == 'Freeport landing': queryset = InvestmentOpportunityPage.objects.live().public().filter(investment_type__name = 'Freeport') - import pdb - # pdb.set_trace() if not queryset: return [] From 0b71f8d8f26e4e2ceff997e9e1f00a657bb7da73 Mon Sep 17 00:00:00 2001 From: LuptonM Date: Wed, 8 Mar 2023 15:56:41 +0000 Subject: [PATCH 04/14] flake8 issues fixed --- great_international/serializers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/great_international/serializers.py b/great_international/serializers.py index fdd59422..7a64ca4a 100644 --- a/great_international/serializers.py +++ b/great_international/serializers.py @@ -311,12 +311,12 @@ class InternationalArticlePageSerializer(BasePageSerializer): cta_link = serializers.CharField() tags = core_fields.TagsListField() - + freeport_data = serializers.SerializerMethodField() - + def get_freeport_data(self, instance): if instance.type_of_article == 'Freeport landing': - queryset = InvestmentOpportunityPage.objects.live().public().filter(investment_type__name = 'Freeport') + queryset = InvestmentOpportunityPage.objects.live().public().filter(investment_type__name='Freeport') if not queryset: return [] From 30ef43ac6d6294ec97f613e98246d38d1aee998f Mon Sep 17 00:00:00 2001 From: LuptonM Date: Fri, 10 Mar 2023 10:11:21 +0000 Subject: [PATCH 05/14] added freeport data tests --- tests/great_international/test_serializers.py | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/tests/great_international/test_serializers.py b/tests/great_international/test_serializers.py index df67d3b6..62494773 100644 --- a/tests/great_international/test_serializers.py +++ b/tests/great_international/test_serializers.py @@ -18,6 +18,7 @@ InvestmentOpportunityForListPageSerializer, InternationalInvestmentSectorPageSerializer, InternationalInvestmentSubSectorPageSerializer, + InternationalArticlePageSerializer ) from tests.core.helpers import make_test_video from tests.great_international.factories import ( @@ -64,6 +65,12 @@ def fdi_investment_type(): return InvestmentTypeFactory( name=settings.FOREIGN_DIRECT_INVESTMENT_SNIPPET_LABEL_DEFAULT ) + +@pytest.fixture +def freeport_investment_type(): + return InvestmentTypeFactory( + name='Freeport' + ) @pytest.fixture @@ -1613,3 +1620,53 @@ def test_foreign_direct_investment_form_sucess_page_serializer( assert len(serializer.data['opportunity_list']) == 2 assert serializer.data['opportunity_list'][0]['meta']['slug'] == 'opp_1__fdi' assert serializer.data['opportunity_list'][1]['meta']['slug'] == 'opp_3__fdi' + + +@pytest.mark.django_db +def test_freeport_data( + rf, international_root_page, freeport_investment_type, non_fdi_investment_type +): + + + InvestmentOpportunityPageFactory.create_batch( + 2, + parent=international_root_page, + investment_type= freeport_investment_type + ) + + InvestmentOpportunityPageFactory.create_batch( + 2, + parent=international_root_page, + investment_type=non_fdi_investment_type + ) + + + opportunity = InternationalArticlePageFactory( + type_of_article ='Freeport landing' + ) + + freeport_data = InternationalArticlePageSerializer( + instance=opportunity, + ).get_freeport_data(instance=opportunity) + + assert len(freeport_data) == 2 + +@pytest.mark.django_db +def test_freeport_data_has_no_results( + rf, international_root_page, non_fdi_investment_type +): + InvestmentOpportunityPageFactory.create_batch( + 2, + parent=international_root_page, + investment_type=non_fdi_investment_type + ) + + opportunity = InternationalArticlePageFactory( + type_of_article ='Freeport landing' + ) + + freeport_data = InternationalArticlePageSerializer( + instance=opportunity, + ).get_freeport_data(instance=opportunity) + + assert freeport_data == [] \ No newline at end of file From 95e041de854d2418b708d98758e67093395fc136 Mon Sep 17 00:00:00 2001 From: LuptonM Date: Fri, 10 Mar 2023 10:13:42 +0000 Subject: [PATCH 06/14] removed redundant arg from test --- tests/great_international/test_serializers.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/great_international/test_serializers.py b/tests/great_international/test_serializers.py index 62494773..ef83078b 100644 --- a/tests/great_international/test_serializers.py +++ b/tests/great_international/test_serializers.py @@ -1623,9 +1623,7 @@ def test_foreign_direct_investment_form_sucess_page_serializer( @pytest.mark.django_db -def test_freeport_data( - rf, international_root_page, freeport_investment_type, non_fdi_investment_type -): +def test_freeport_data(international_root_page, freeport_investment_type, non_fdi_investment_type): InvestmentOpportunityPageFactory.create_batch( @@ -1652,9 +1650,7 @@ def test_freeport_data( assert len(freeport_data) == 2 @pytest.mark.django_db -def test_freeport_data_has_no_results( - rf, international_root_page, non_fdi_investment_type -): +def test_freeport_data_has_no_results(international_root_page, non_fdi_investment_type): InvestmentOpportunityPageFactory.create_batch( 2, parent=international_root_page, From 93727086f01c7b9c2dc02acee30b542c0de740be Mon Sep 17 00:00:00 2001 From: LuptonM Date: Fri, 10 Mar 2023 10:20:42 +0000 Subject: [PATCH 07/14] fixed flake8 issues --- tests/great_international/test_serializers.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/great_international/test_serializers.py b/tests/great_international/test_serializers.py index ef83078b..918d62ae 100644 --- a/tests/great_international/test_serializers.py +++ b/tests/great_international/test_serializers.py @@ -65,7 +65,8 @@ def fdi_investment_type(): return InvestmentTypeFactory( name=settings.FOREIGN_DIRECT_INVESTMENT_SNIPPET_LABEL_DEFAULT ) - + + @pytest.fixture def freeport_investment_type(): return InvestmentTypeFactory( @@ -1625,22 +1626,20 @@ def test_foreign_direct_investment_form_sucess_page_serializer( @pytest.mark.django_db def test_freeport_data(international_root_page, freeport_investment_type, non_fdi_investment_type): - InvestmentOpportunityPageFactory.create_batch( 2, parent=international_root_page, - investment_type= freeport_investment_type + investment_type=freeport_investment_type ) - + InvestmentOpportunityPageFactory.create_batch( 2, parent=international_root_page, investment_type=non_fdi_investment_type ) - opportunity = InternationalArticlePageFactory( - type_of_article ='Freeport landing' + type_of_article='Freeport landing' ) freeport_data = InternationalArticlePageSerializer( @@ -1649,6 +1648,7 @@ def test_freeport_data(international_root_page, freeport_investment_type, non_fd assert len(freeport_data) == 2 + @pytest.mark.django_db def test_freeport_data_has_no_results(international_root_page, non_fdi_investment_type): InvestmentOpportunityPageFactory.create_batch( @@ -1658,11 +1658,11 @@ def test_freeport_data_has_no_results(international_root_page, non_fdi_investmen ) opportunity = InternationalArticlePageFactory( - type_of_article ='Freeport landing' + type_of_article='Freeport landing' ) freeport_data = InternationalArticlePageSerializer( instance=opportunity, ).get_freeport_data(instance=opportunity) - assert freeport_data == [] \ No newline at end of file + assert freeport_data == [] From b037c268e7fadbbf377f080ee322ac4984a8f253 Mon Sep 17 00:00:00 2001 From: LuptonM Date: Fri, 10 Mar 2023 11:10:27 +0000 Subject: [PATCH 08/14] renamed page variable --- tests/great_international/test_serializers.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/great_international/test_serializers.py b/tests/great_international/test_serializers.py index 918d62ae..698d821b 100644 --- a/tests/great_international/test_serializers.py +++ b/tests/great_international/test_serializers.py @@ -1638,13 +1638,13 @@ def test_freeport_data(international_root_page, freeport_investment_type, non_fd investment_type=non_fdi_investment_type ) - opportunity = InternationalArticlePageFactory( + freeport_landing_page = InternationalArticlePageFactory( type_of_article='Freeport landing' ) freeport_data = InternationalArticlePageSerializer( - instance=opportunity, - ).get_freeport_data(instance=opportunity) + instance=freeport_landing_page, + ).get_freeport_data(instance=freeport_landing_page) assert len(freeport_data) == 2 @@ -1657,12 +1657,12 @@ def test_freeport_data_has_no_results(international_root_page, non_fdi_investmen investment_type=non_fdi_investment_type ) - opportunity = InternationalArticlePageFactory( + freeport_landing_page = InternationalArticlePageFactory( type_of_article='Freeport landing' ) freeport_data = InternationalArticlePageSerializer( - instance=opportunity, - ).get_freeport_data(instance=opportunity) + instance=freeport_landing_page, + ).get_freeport_data(instance=freeport_landing_page) assert freeport_data == [] From 62fcf8d87f28f99af2b18f565188201fe94d4e90 Mon Sep 17 00:00:00 2001 From: Tim Patterson Date: Fri, 10 Mar 2023 15:24:37 +0000 Subject: [PATCH 09/14] Update changelog --- CHANGELOG.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 083b64f5..8dbc4124 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,8 +3,15 @@ ## Pre-release ### Fixed bugs -* KLS-358 - Missing content on Investment Opportunity content editing panels + +### Implemented enhancements + +## [2.9.3](https://github.com/uktrade/directory-cms/releases/tag/2.9.3) +[Full Changelog](https://github.com/uktrade/directory-cms/compare/2.9.2...2.9.3) ### Implemented enhancements +* KLS-247 - Add hero_image and hero_video to article page for freeports work +### Fixed bugs +* KLS-358 - Missing content on Investment Opportunity content editing panels ## [2.9.2](https://github.com/uktrade/directory-cms/releases/tag/2.9.2) [Full Changelog](https://github.com/uktrade/directory-cms/compare/2.9.1...2.9.2) From bcb4d41691f6cd37955f12f988bcc4c08f962154 Mon Sep 17 00:00:00 2001 From: Halidu Abubakar Date: Sun, 9 Apr 2023 14:52:10 +0100 Subject: [PATCH 10/14] KLS-515 Remove changelog requirement in pull request --- pull_request_template.md | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/pull_request_template.md b/pull_request_template.md index e9245dc8..fb10d909 100644 --- a/pull_request_template.md +++ b/pull_request_template.md @@ -1,8 +1,27 @@ -To do (delete all that do not apply): - - - [ ] Change has a jira ticket that has the correct status. - - [ ] Changelog entry added. - - [ ] (if there are vulnerable requirements) Upgraded any vulnerable dependencies. - - [ ] (if updating requirements) Requirements have been compiled. - - [ ] (if adding env vars) Added any new environment variable to vault. - - [ ] (if adding feature flags) Cleaned up old flags +(Please add a sentence or two explaining the context of this PR. Reviewers can go to the ticket for detail.) +CONTEXT: This changeset adds/removes/updates [summary of feature/area/code] so that [summary of benefit]. + +_Tick or delete as appropriate:_ + +### Workflow + +- [ ] Ticket exists in Jira https://uktrade.atlassian.net/browse/TICKET_ID_HERE +- [ ] Jira ticket has the correct status. +- [ ] A clear/description pull request messaged added. + +### Reviewing help + +- [ ] Explains how to test locally, including how to set up appropriate data +- [ ] Includes screenshot(s) - ideally before and after, but at least after + +### Housekeeping + +- [ ] Added all new environment variables to Vault. +- [ ] Cleaned up old feature flags +- [ ] Upgraded any vulnerable dependencies. +- [ ] I have updated security dependencies +- [ ] Python requirements have been re-compiled. + +### Merging + +- [x] This PR can be merged by reviewers. (If unticked, please leave for the author to merge) From ccf8dccc394998f1899333581878a2dd15392d8c Mon Sep 17 00:00:00 2001 From: Abhilash Nair Date: Tue, 18 Apr 2023 09:39:51 +0100 Subject: [PATCH 11/14] patch redis --- requirements.in | 4 +-- requirements.txt | 46 +++++++++++++++++-------------- requirements_test.txt | 64 ++++++++++++++++++++++--------------------- 3 files changed, 60 insertions(+), 54 deletions(-) diff --git a/requirements.in b/requirements.in index 619bb343..a6f4b2f6 100644 --- a/requirements.in +++ b/requirements.in @@ -18,8 +18,8 @@ html2text==2020.* wagtailmedia==0.* pytube==9.2.2 django-filter>=2.4.0 -django-redis==5.2.0 -celery[redis]==5.2.2 +django-redis +celery[redis] django-celery-beat==2.2.1 kombu==5.2.3 requests[security]==2.27.1 diff --git a/requirements.txt b/requirements.txt index 23f7f092..fcc815ac 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,11 +8,13 @@ amqp==5.1.1 # via kombu -anyascii==0.3.1 +anyascii==0.3.2 # via wagtail asgiref==3.6.0 # via django -attrs==22.2.0 +async-timeout==4.0.2 + # via redis +attrs==23.1.0 # via jsonschema beautifulsoup4==4.9.3 # via @@ -34,7 +36,7 @@ botocore==1.27.96 # s3transfer bump2version==1.0.1 # via wagtail-modeltranslation -celery[redis]==5.2.2 +celery[redis]==5.2.7 # via # -r requirements.in # django-celery-beat @@ -69,9 +71,9 @@ directory-constants==22.0.2 # via # -r requirements.in # directory-components -directory-healthcheck==3.0.2 +directory-healthcheck==3.0.4 # via -r requirements.in -dj-database-url==1.2.0 +dj-database-url==1.3.0 # via -r requirements.in django==3.2.18 # via @@ -127,7 +129,7 @@ django-taggit==1.5.1 # via wagtail django-timezone-field==4.2.3 # via django-celery-beat -django-treebeard==4.6.1 +django-treebeard==4.7 # via wagtail djangorestframework==3.14.0 # via @@ -158,7 +160,7 @@ html5lib==1.1 # via wagtail idna==3.4 # via requests -importlib-metadata==6.0.0 +importlib-metadata==6.4.1 # via # keyring # twine @@ -192,11 +194,11 @@ oauthlib==3.2.2 # via # -r requirements.in # requests-oauthlib -openpyxl==3.1.1 +openpyxl==3.1.2 # via tablib -packaging==23.0 +packaging==23.1 # via bleach -pillow==9.4.0 +pillow==9.5.0 # via wagtail pkginfo==1.9.6 # via twine @@ -204,13 +206,13 @@ prompt-toolkit==3.0.38 # via click-repl psycogreen==1.0.2 # via -r requirements.in -psycopg2==2.9.5 +psycopg2==2.9.6 # via -r requirements.in pycountry==19.8.18 # via -r requirements.in pycparser==2.21 # via cffi -pygments==2.14.0 +pygments==2.15.0 # via readme-renderer pyjwt==2.6.0 # via notifications-python-client @@ -224,7 +226,7 @@ python-dateutil==2.8.2 # python-crontab pytube==9.2.2 # via -r requirements.in -pytz==2022.7.1 +pytz==2023.3 # via # celery # django @@ -234,7 +236,7 @@ pytz==2022.7.1 # l18n readme-renderer==37.3 # via twine -redis==3.5.3 +redis==4.5.4 # via # celery # django-redis @@ -254,7 +256,7 @@ rfc3986==2.0.0 # via twine s3transfer==0.6.0 # via boto3 -sentry-sdk==1.16.0 +sentry-sdk==1.19.1 # via -r requirements.in sigauth==5.1.1 # via -r requirements.in @@ -270,11 +272,11 @@ six==1.16.0 # mohawk # python-dateutil # w3lib -soupsieve==2.4 +soupsieve==2.4.1 # via beautifulsoup4 -sqlparse==0.4.3 +sqlparse==0.4.4 # via django -tablib[xls,xlsx]==3.3.0 +tablib[xls,xlsx]==3.4.0 # via wagtail telepath==0.3 # via wagtail @@ -282,7 +284,9 @@ tqdm==4.65.0 # via twine twine==3.8.0 # via wagtail-modeltranslation -urllib3==1.26.14 +typing-extensions==4.5.0 + # via dj-database-url +urllib3==1.26.15 # via # -r requirements.in # botocore @@ -320,7 +324,7 @@ wrapt==1.15.0 # via elastic-apm xlrd==2.0.1 # via tablib -xlsxwriter==3.0.8 +xlsxwriter==3.1.0 # via wagtail xlwt==1.3.0 # via tablib @@ -328,7 +332,7 @@ zipp==3.15.0 # via importlib-metadata zope-event==4.6 # via gevent -zope-interface==5.5.2 +zope-interface==6.0 # via gevent # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements_test.txt b/requirements_test.txt index 4b3fb12f..67b99486 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -8,14 +8,14 @@ amqp==5.1.1 # via kombu -anyascii==0.3.1 +anyascii==0.3.2 # via wagtail asgiref==3.6.0 # via django -attrs==22.2.0 - # via - # jsonschema - # pytest +async-timeout==4.0.2 + # via redis +attrs==23.1.0 + # via jsonschema beautifulsoup4==4.9.3 # via # directory-components @@ -38,7 +38,7 @@ build==0.10.0 # via pip-tools bump2version==1.0.1 # via wagtail-modeltranslation -celery[redis]==5.2.2 +celery[redis]==5.2.7 # via # -r requirements.in # django-celery-beat @@ -64,7 +64,7 @@ click-plugins==1.1.1 # via celery click-repl==0.2.0 # via celery -codecov==2.1.12 +codecov==2.1.13 # via -r requirements_test.in colorama==0.4.6 # via twine @@ -83,9 +83,9 @@ directory-constants==22.0.2 # via # -r requirements.in # directory-components -directory-healthcheck==3.0.2 +directory-healthcheck==3.0.4 # via -r requirements.in -dj-database-url==1.2.0 +dj-database-url==1.3.0 # via -r requirements.in django==3.2.18 # via @@ -144,7 +144,7 @@ django-taggit==1.5.1 # via wagtail django-timezone-field==4.2.3 # via django-celery-beat -django-treebeard==4.6.1 +django-treebeard==4.7 # via wagtail djangorestframework==3.14.0 # via @@ -164,13 +164,13 @@ elastic-apm==6.15.1 # via -r requirements.in et-xmlfile==1.1.0 # via openpyxl -exceptiongroup==1.1.0 +exceptiongroup==1.1.1 # via pytest factory-boy==2.12.0 # via # -r requirements_test.in # wagtail-factories -faker==17.6.0 +faker==18.4.0 # via factory-boy flake8==6.0.0 # via -r requirements_test.in @@ -188,7 +188,7 @@ html5lib==1.1 # via wagtail idna==3.4 # via requests -importlib-metadata==6.0.0 +importlib-metadata==6.4.1 # via # keyring # twine @@ -226,17 +226,17 @@ oauthlib==3.2.2 # via # -r requirements.in # requests-oauthlib -openpyxl==3.1.1 +openpyxl==3.1.2 # via tablib -packaging==23.0 +packaging==23.1 # via # bleach # build # pytest # pytest-sugar -pillow==9.4.0 +pillow==9.5.0 # via wagtail -pip-tools==6.12.3 +pip-tools==6.13.0 # via -r requirements_test.in pkginfo==1.9.6 # via twine @@ -246,7 +246,7 @@ prompt-toolkit==3.0.38 # via click-repl psycogreen==1.0.2 # via -r requirements.in -psycopg2==2.9.5 +psycopg2==2.9.6 # via -r requirements.in pycodestyle==2.10.0 # via flake8 @@ -256,7 +256,7 @@ pycparser==2.21 # via cffi pyflakes==3.0.1 # via flake8 -pygments==2.14.0 +pygments==2.15.0 # via readme-renderer pyjwt==2.6.0 # via notifications-python-client @@ -264,7 +264,7 @@ pyproject-hooks==1.0.0 # via build pyrsistent==0.19.3 # via jsonschema -pytest==7.2.2 +pytest==7.3.1 # via # -r requirements_test.in # pytest-cov @@ -274,7 +274,7 @@ pytest-cov==4.0.0 # via -r requirements_test.in pytest-django==4.5.2 # via -r requirements_test.in -pytest-sugar==0.9.6 +pytest-sugar==0.9.7 # via -r requirements_test.in python-crontab==2.7.1 # via django-celery-beat @@ -286,7 +286,7 @@ python-dateutil==2.8.2 # python-crontab pytube==9.2.2 # via -r requirements.in -pytz==2022.7.1 +pytz==2023.3 # via # celery # django @@ -296,7 +296,7 @@ pytz==2022.7.1 # l18n readme-renderer==37.3 # via twine -redis==3.5.3 +redis==4.5.4 # via # celery # django-redis @@ -321,7 +321,7 @@ rfc3986==2.0.0 # via twine s3transfer==0.6.0 # via boto3 -sentry-sdk==1.16.0 +sentry-sdk==1.19.1 # via -r requirements.in sigauth==5.1.1 # via -r requirements.in @@ -339,13 +339,13 @@ six==1.16.0 # python-dateutil # requests-mock # w3lib -soupsieve==2.4 +soupsieve==2.4.1 # via beautifulsoup4 -sqlparse==0.4.3 +sqlparse==0.4.4 # via # django # django-debug-toolbar -tablib[xls,xlsx]==3.3.0 +tablib[xls,xlsx]==3.4.0 # via wagtail telepath==0.3 # via wagtail @@ -361,7 +361,9 @@ tqdm==4.65.0 # via twine twine==3.8.0 # via wagtail-modeltranslation -urllib3==1.26.14 +typing-extensions==4.5.0 + # via dj-database-url +urllib3==1.26.15 # via # -r requirements.in # botocore @@ -394,7 +396,7 @@ webencodings==0.5.1 # via # bleach # html5lib -wheel==0.38.4 +wheel==0.40.0 # via pip-tools whitenoise==6.4.0 # via -r requirements.in @@ -404,7 +406,7 @@ wrapt==1.15.0 # via elastic-apm xlrd==2.0.1 # via tablib -xlsxwriter==3.0.8 +xlsxwriter==3.1.0 # via wagtail xlwt==1.3.0 # via tablib @@ -412,7 +414,7 @@ zipp==3.15.0 # via importlib-metadata zope-event==4.6 # via gevent -zope-interface==5.5.2 +zope-interface==6.0 # via gevent # The following packages are considered to be unsafe in a requirements file: From f3cc519c7fd37a51d4120c8055ef1ccbd93576b5 Mon Sep 17 00:00:00 2001 From: Abhilash Nair Date: Tue, 18 Apr 2023 10:16:29 +0100 Subject: [PATCH 12/14] codecov update --- .circleci/config.yml | 4 +--- makefile | 10 ++++++++++ requirements_test.in | 3 ++- requirements_test.txt | 19 ++++++++++++++----- 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d37ba249..9c622a51 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -27,9 +27,7 @@ jobs: command: | . venv/bin/activate mkdir test-reports - TESTFILES=$(circleci tests glob "tests/**/*.py") - ENV_FILES=test,dev pytest ${TESTFILES} --cov=. --cov-config=.coveragerc --cov-report html --cov-report term --junitxml=test-reports/junit.xml - codecov + make pytest_codecov -- --codecov-token=${CODECOV_TOKEN} - run: mkdir -p workspace - run: echo "export TARGET_CIRCLE_BUILD_NUM=$CIRCLE_BUILD_NUM" >> workspace/new-env-vars - store_test_results: diff --git a/makefile b/makefile index 0d33ff98..96fbaa64 100644 --- a/makefile +++ b/makefile @@ -15,6 +15,16 @@ pytest: --cov=. \ $(ARGUMENTS) +pytest_codecov: + ENV_FILES='test,dev' \ + pytest \ + ${TESTFILES} + --junitxml=test-reports/junit.xml \ + --cov-config=.coveragerc \ + --cov-report=term \ + --cov=. \ + --codecov \ + $(ARGUMENTS) flake8: flake8 . \ diff --git a/requirements_test.in b/requirements_test.in index a59d9c5d..e0fb70a9 100644 --- a/requirements_test.in +++ b/requirements_test.in @@ -12,4 +12,5 @@ factory-boy==2.* wagtail-factories==2.0.1 django-debug-toolbar==3.2.* pip-tools -codecov +pytest-codecov +GitPython diff --git a/requirements_test.txt b/requirements_test.txt index 67b99486..cd68e9c0 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -64,14 +64,12 @@ click-plugins==1.1.1 # via celery click-repl==0.2.0 # via celery -codecov==2.1.13 - # via -r requirements_test.in colorama==0.4.6 # via twine coverage[toml]==6.5.0 # via - # codecov # coveralls + # pytest-codecov # pytest-cov coveralls==3.3.1 # via -r requirements_test.in @@ -178,6 +176,10 @@ freezegun==0.3.14 # via -r requirements_test.in gevent==22.10.2 # via -r requirements.in +gitdb==4.0.10 + # via gitpython +gitpython==3.1.31 + # via -r requirements_test.in greenlet==2.0.2 # via gevent gunicorn==20.1.0 @@ -267,11 +269,16 @@ pyrsistent==0.19.3 pytest==7.3.1 # via # -r requirements_test.in + # pytest-codecov # pytest-cov # pytest-django # pytest-sugar -pytest-cov==4.0.0 +pytest-codecov==0.5.1 # via -r requirements_test.in +pytest-cov==4.0.0 + # via + # -r requirements_test.in + # pytest-codecov pytest-django==4.5.2 # via -r requirements_test.in pytest-sugar==0.9.7 @@ -303,9 +310,9 @@ redis==4.5.4 requests[security]==2.27.1 # via # -r requirements.in - # codecov # coveralls # notifications-python-client + # pytest-codecov # requests-mock # requests-oauthlib # requests-toolbelt @@ -339,6 +346,8 @@ six==1.16.0 # python-dateutil # requests-mock # w3lib +smmap==5.0.0 + # via gitdb soupsieve==2.4.1 # via beautifulsoup4 sqlparse==0.4.4 From 4ef4dc9a7aaffcfeb8081dd8a560f64f19ef356c Mon Sep 17 00:00:00 2001 From: Abhilash Nair Date: Tue, 18 Apr 2023 11:00:11 +0100 Subject: [PATCH 13/14] codecov update push --- requirements.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.in b/requirements.in index a6f4b2f6..b094c862 100644 --- a/requirements.in +++ b/requirements.in @@ -40,4 +40,4 @@ gevent==22.10.* psycogreen==1.0.2 wagtailmedia==0.5.0 cryptography==39.* -oauthlib==3.2.* +oauthlib==3.2.* \ No newline at end of file From ebeae31245f52a93b598d49a31a0dd67c88d55bc Mon Sep 17 00:00:00 2001 From: Abhilash Nair Date: Tue, 18 Apr 2023 12:30:52 +0100 Subject: [PATCH 14/14] codecov update without testfiles --- makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/makefile b/makefile index 96fbaa64..b4f99a02 100644 --- a/makefile +++ b/makefile @@ -18,7 +18,6 @@ pytest: pytest_codecov: ENV_FILES='test,dev' \ pytest \ - ${TESTFILES} --junitxml=test-reports/junit.xml \ --cov-config=.coveragerc \ --cov-report=term \