Skip to content

Commit

Permalink
Merge pull request #984 from uktrade/release
Browse files Browse the repository at this point in the history
Prod Release
  • Loading branch information
bobmeredith authored Oct 22, 2021
2 parents a1b1e32 + 2bd4447 commit 21d69f8
Show file tree
Hide file tree
Showing 9 changed files with 147 additions and 126 deletions.
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ jobs:
test:
working_directory: /tmp/cci-test
docker:
- image: circleci/python:3.6.15
- image: circleci/python:3.9.7
- image: circleci/redis:3.2-alpine
steps:
- checkout
Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:
notify:
working_directory: /tmp/cci-test
docker:
- image: circleci/python:3.6.15
- image: circleci/python:3.9.7
steps:
- attach_workspace:
at: /tmp/cci-test/workspace
Expand All @@ -56,7 +56,7 @@ jobs:

flake8:
docker:
- image: circleci/python:3.6.15
- image: circleci/python:3.9.7
steps:
- checkout
- setup_remote_docker:
Expand All @@ -71,7 +71,7 @@ jobs:
migrations:
docker:
- image: circleci/python:3.6.15
- image: circleci/python:3.9.7
steps:
- checkout
- setup_remote_docker:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Pre-release
### Implemented enhancements
- NOTICKET: Added GreatMedia to d-cms
- GP2-3740: Python 3.9 upgrade

### Fixed bugs

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.6.12
FROM python:3.9.7
ENV PYTHONUNBUFFERED 1

RUN mkdir -p /app
Expand Down
11 changes: 5 additions & 6 deletions great_international/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2501,22 +2501,21 @@ def get_sub_sectors(self, instance):
return sub_sectors_list

def get_related_opportunities(self, instance):
# Related opportunities are defined as ones in the same REGION, whereas previously (with the
# CapitalInvestOpportunityPageSerializer) we were showing based on SECTOR.
# Related opportunities are defined as based on SECTOR.

related_regions_set = self._get_regions(instance)
related_sectors_set = set(sector.related_sector_id for sector in instance.related_sectors.all())

if not related_regions_set:
if not related_sectors_set:
return []

related_opps = []

for opp in InvestmentOpportunityPage.objects.live().public().exclude(
id=instance.id
).order_by(
'-priority_weighting'
).distinct():
if self._get_regions(opp).intersection(related_regions_set):
opp_sectors_set = set(sector.related_sector_id for sector in opp.related_sectors.all())
if opp_sectors_set.intersection(related_sectors_set):
related_opps.append(opp)

if not related_opps:
Expand Down
8 changes: 4 additions & 4 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
django==2.2.*
djangorestframework==3.12.*
django-environ==0.4.5
gunicorn==19.5.0
gunicorn==20.1.0
sentry-sdk==0.13.4
django_storages==1.7.1
whitenoise==4.1.2
dj-database-url==0.5.0
psycopg2==2.7.3.2
psycopg2==2.8.* --no-binary psycopg2
django-pglocks==1.0.2
boto3==1.6.3
sigauth==4.1.0
Expand All @@ -24,7 +24,7 @@ celery[redis]==4.4.7
django-celery-beat==2.0.0
kombu==4.*
requests[security]==2.25.1
markdown==2.6
markdown==2.*
bleach==3.*
bleach-whitelist==0.*
wagtail-modeltranslation==0.10.17
Expand All @@ -36,7 +36,7 @@ pillow>=8.1.2
num2words==0.5.10
pycountry==19.8.18
elastic-apm>=5.5.2,<6.0.0
gevent>=20.6.1,<=21.1.2
gevent==21.8.0
psycogreen>=1.0.2,<2.0.0
wagtailmedia==0.5.0
cryptography==3.3.2
28 changes: 12 additions & 16 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#
# This file is autogenerated by pip-compile with python 3.6
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile requirements.in
#
--no-binary psycopg2

amqp==2.6.1
# via kombu
anyascii==0.3.0
Expand All @@ -30,12 +32,12 @@ celery[redis]==4.4.7
# via
# -r requirements.in
# django-celery-beat
certifi==2021.5.30
certifi==2021.10.8
# via
# elastic-apm
# requests
# sentry-sdk
cffi==1.14.6
cffi==1.15.0
# via cryptography
chardet==4.0.0
# via requests
Expand Down Expand Up @@ -87,7 +89,7 @@ django-health-check==3.8.0
# via directory-healthcheck
django-ipware==2.1.0
# via django-admin-ip-restrictor
django-modelcluster==5.1
django-modelcluster==5.2
# via wagtail
django-modeltranslation==0.17.3
# via wagtail-modeltranslation
Expand Down Expand Up @@ -124,20 +126,18 @@ et-xmlfile==1.1.0
# via openpyxl
future==0.18.2
# via notifications-python-client
gevent==21.1.2
gevent==21.8.0
# via -r requirements.in
greenlet==1.1.2
# via gevent
gunicorn==19.5.0
gunicorn==20.1.0
# via -r requirements.in
html2text==2018.1.9
# via -r requirements.in
html5lib==1.1
# via wagtail
idna==2.10
# via requests
importlib-metadata==4.8.1
# via kombu
jmespath==0.10.0
# via
# boto3
Expand All @@ -150,7 +150,7 @@ kombu==4.6.11
# celery
l18n==2020.6.1
# via wagtail
markdown==2.6
markdown==2.6.11
# via -r requirements.in
mohawk==0.3.4
# via sigauth
Expand All @@ -166,19 +166,19 @@ openpyxl==3.0.9
# via tablib
packaging==21.0
# via bleach
pillow==8.3.2
pillow==8.4.0
# via
# -r requirements.in
# wagtail
psycogreen==1.0.2
# via -r requirements.in
psycopg2==2.7.3.2
psycopg2==2.8.6
# via -r requirements.in
pycountry==19.8.18
# via -r requirements.in
pycparser==2.20
# via cffi
pyjwt==2.2.0
pyjwt==2.3.0
# via notifications-python-client
pyopenssl==21.0.0
# via requests
Expand Down Expand Up @@ -237,8 +237,6 @@ sqlparse==0.4.2
# via django
tablib[xls,xlsx]==3.0.0
# via wagtail
typing-extensions==3.10.0.2
# via importlib-metadata
unidecode==1.3.2
# via wagtail
urllib3==1.26.7
Expand Down Expand Up @@ -276,8 +274,6 @@ xlsxwriter==1.4.5
# via wagtail
xlwt==1.3.0
# via tablib
zipp==3.6.0
# via importlib-metadata
zope.event==4.5.0
# via gevent
zope.interface==5.4.0
Expand Down
50 changes: 19 additions & 31 deletions requirements_test.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#
# This file is autogenerated by pip-compile with python 3.6
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile requirements_test.in
#
--no-binary psycopg2

amqp==2.6.1
# via kombu
anyascii==0.3.0
Expand Down Expand Up @@ -33,16 +35,16 @@ celery[redis]==4.4.7
# via
# -r requirements.in
# django-celery-beat
certifi==2021.5.30
certifi==2021.10.8
# via
# elastic-apm
# requests
# sentry-sdk
cffi==1.14.6
cffi==1.15.0
# via cryptography
chardet==4.0.0
# via requests
click==8.0.1
click==8.0.3
# via pip-tools
codecov==2.1.12
# via -r requirements_test.in
Expand Down Expand Up @@ -104,7 +106,7 @@ django-health-check==3.8.0
# via directory-healthcheck
django-ipware==2.1.0
# via django-admin-ip-restrictor
django-modelcluster==5.1
django-modelcluster==5.2
# via wagtail
django-modeltranslation==0.17.3
# via wagtail-modeltranslation
Expand Down Expand Up @@ -144,34 +146,26 @@ factory-boy==2.12.0
# via
# -r requirements_test.in
# wagtail-factories
faker==9.2.0
faker==9.3.1
# via factory-boy
flake8==3.9.2
flake8==4.0.1
# via -r requirements_test.in
freezegun==0.3.14
# via -r requirements_test.in
future==0.18.2
# via notifications-python-client
gevent==21.1.2
gevent==21.8.0
# via -r requirements.in
greenlet==1.1.2
# via gevent
gunicorn==19.5.0
gunicorn==20.1.0
# via -r requirements.in
html2text==2018.1.9
# via -r requirements.in
html5lib==1.1
# via wagtail
idna==2.10
# via requests
importlib-metadata==4.8.1
# via
# click
# flake8
# kombu
# pep517
# pluggy
# pytest
iniconfig==1.1.1
# via pytest
jmespath==0.10.0
Expand All @@ -186,7 +180,7 @@ kombu==4.6.11
# celery
l18n==2020.6.1
# via wagtail
markdown==2.6
markdown==2.6.11
# via -r requirements.in
mccabe==0.6.1
# via flake8
Expand All @@ -207,31 +201,31 @@ packaging==21.0
# bleach
# pytest
# pytest-sugar
pep517==0.11.0
pep517==0.12.0
# via pip-tools
pillow==8.3.2
pillow==8.4.0
# via
# -r requirements.in
# wagtail
pip-tools==6.3.0
pip-tools==6.4.0
# via -r requirements_test.in
pluggy==1.0.0
# via pytest
psycogreen==1.0.2
# via -r requirements.in
psycopg2==2.7.3.2
psycopg2==2.8.6
# via -r requirements.in
py==1.10.0
# via pytest
pycodestyle==2.7.0
pycodestyle==2.8.0
# via flake8
pycountry==19.8.18
# via -r requirements.in
pycparser==2.20
# via cffi
pyflakes==2.3.1
pyflakes==2.4.0
# via flake8
pyjwt==2.2.0
pyjwt==2.3.0
# via notifications-python-client
pyopenssl==21.0.0
# via requests
Expand Down Expand Up @@ -323,8 +317,6 @@ toml==0.10.2
# pytest
tomli==1.2.1
# via pep517
typing-extensions==3.10.0.2
# via importlib-metadata
unidecode==1.3.2
# via wagtail
urllib3==1.26.7
Expand Down Expand Up @@ -367,10 +359,6 @@ xlsxwriter==1.4.5
# via wagtail
xlwt==1.3.0
# via tablib
zipp==3.6.0
# via
# importlib-metadata
# pep517
zope.event==4.5.0
# via gevent
zope.interface==5.4.0
Expand Down
2 changes: 1 addition & 1 deletion runtime.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-3.6.15
python-3.9.7
Loading

0 comments on commit 21d69f8

Please sign in to comment.