Skip to content

Commit

Permalink
Merge pull request #628 from openedx/jenkins/upgrade-python-requireme…
Browse files Browse the repository at this point in the history
…nts-e1d2839

Python Requirements Update
  • Loading branch information
mumarkhan999 committed Apr 4, 2024
2 parents e1d2839 + 08b2904 commit 3ed13e8
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 35 deletions.
1 change: 1 addition & 0 deletions license_manager/apps/subscriptions/event_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ def identify_braze_alias(lms_user_id, email_address):
'Authorization': 'Bearer {}'.format(settings.BRAZE_API_KEY),
'Accept-Encoding': 'identity'
}
# pylint: disable=missing-timeout
response = requests.post(
url=f'{settings.BRAZE_URL}/users/identify',
headers=headers,
Expand Down
4 changes: 2 additions & 2 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ backports-zoneinfo[tzdata]==0.2.1 ; python_version < "3.9"
# kombu
billiard==4.2.0
# via celery
boto3==1.34.75
boto3==1.34.76
# via django-ses
botocore==1.34.75
botocore==1.34.76
# via
# boto3
# s3transfer
Expand Down
8 changes: 0 additions & 8 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@
# Using the same version of diff-cover which is being used currently in edx-platform to avoid this conflict.
diff-cover==4.0.0

# Constraint from astroid 2.3.3
wrapt==1.14.*

# edx-lint>=5.3.0 and/or pylint>=2.15 throws a bunch of unknown option value errors
edx-lint<5.3
pylint<2.15
astroid<2.12

# Stay on LTS release
# This can be removed once all IDAs have been upgraded to Django 4.2
# and the global constraint has been updated from Django<4.0 to Django<4.3
Expand Down
8 changes: 4 additions & 4 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ billiard==4.2.0
# via
# -r requirements/validation.txt
# celery
boto3==1.34.75
boto3==1.34.76
# via
# -r requirements/validation.txt
# django-ses
botocore==1.34.75
botocore==1.34.76
# via
# -r requirements/validation.txt
# boto3
Expand Down Expand Up @@ -339,7 +339,7 @@ lazy-object-proxy==1.10.0
# via
# -r requirements/validation.txt
# astroid
lxml==5.2.0
lxml==5.2.1
# via
# -r requirements/validation.txt
# edx-i18n-tools
Expand Down Expand Up @@ -639,7 +639,7 @@ wheel==0.43.0
# via
# -r requirements/pip-tools.txt
# pip-tools
wrapt==1.11.2
wrapt==1.14.1
# via
# -c requirements/constraints.txt
# -r requirements/validation.txt
Expand Down
6 changes: 3 additions & 3 deletions requirements/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ billiard==4.2.0
# via
# -r requirements/test.txt
# celery
boto3==1.34.75
boto3==1.34.76
# via
# -r requirements/test.txt
# django-ses
botocore==1.34.75
botocore==1.34.76
# via
# -r requirements/test.txt
# boto3
Expand Down Expand Up @@ -620,7 +620,7 @@ wcwidth==0.2.13
# via
# -r requirements/test.txt
# prompt-toolkit
wrapt==1.11.2
wrapt==1.14.1
# via
# -c requirements/constraints.txt
# -r requirements/test.txt
Expand Down
4 changes: 2 additions & 2 deletions requirements/production.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ billiard==4.2.0
# via
# -r requirements/base.txt
# celery
boto3==1.34.75
boto3==1.34.76
# via
# -r requirements/base.txt
# django-ses
botocore==1.34.75
botocore==1.34.76
# via
# -r requirements/base.txt
# boto3
Expand Down
6 changes: 3 additions & 3 deletions requirements/quality.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ billiard==4.2.0
# via
# -r requirements/base.txt
# celery
boto3==1.34.75
boto3==1.34.76
# via
# -r requirements/base.txt
# django-ses
botocore==1.34.75
botocore==1.34.76
# via
# -r requirements/base.txt
# boto3
Expand Down Expand Up @@ -488,7 +488,7 @@ wcwidth==0.2.13
# via
# -r requirements/base.txt
# prompt-toolkit
wrapt==1.11.2
wrapt==1.14.1
# via
# -c requirements/constraints.txt
# astroid
Expand Down
6 changes: 3 additions & 3 deletions requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ billiard==4.2.0
# via
# -r requirements/base.txt
# celery
boto3==1.34.75
boto3==1.34.76
# via
# -r requirements/base.txt
# django-ses
botocore==1.34.75
botocore==1.34.76
# via
# -r requirements/base.txt
# boto3
Expand Down Expand Up @@ -517,7 +517,7 @@ wcwidth==0.2.13
# via
# -r requirements/base.txt
# prompt-toolkit
wrapt==1.11.2
wrapt==1.14.1
# via
# -c requirements/constraints.txt
# astroid
Expand Down
8 changes: 4 additions & 4 deletions requirements/validation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ billiard==4.2.0
# -r requirements/quality.txt
# -r requirements/test.txt
# celery
boto3==1.34.75
boto3==1.34.76
# via
# -r requirements/quality.txt
# -r requirements/test.txt
# django-ses
botocore==1.34.75
botocore==1.34.76
# via
# -r requirements/quality.txt
# -r requirements/test.txt
Expand Down Expand Up @@ -390,7 +390,7 @@ lazy-object-proxy==1.10.0
# -r requirements/quality.txt
# -r requirements/test.txt
# astroid
lxml==5.2.0
lxml==5.2.1
# via edx-i18n-tools
markupsafe==2.1.5
# via
Expand Down Expand Up @@ -707,7 +707,7 @@ wcwidth==0.2.13
# -r requirements/quality.txt
# -r requirements/test.txt
# prompt-toolkit
wrapt==1.11.2
wrapt==1.14.1
# via
# -c requirements/constraints.txt
# -r requirements/quality.txt
Expand Down
8 changes: 5 additions & 3 deletions scripts/local_assignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
To use:
```
# os environ names are meaningful and should correspond to the requested environment
# this allows us to fetch a JWT before each request, so you don't have to
# this allows us to fetch a JWT before each request, so you don't have to
# worry about your JWT expiring in the middle of the script execution.
export CLIENT_SECRET_LOCAL=[your-client-secret]
export CLIENT_ID_LOCAL=[your-client-id]
Expand All @@ -24,8 +24,8 @@
```
Options:
* ``input-file`` is your input file - it should be a single-column csv
(or just a list delimited by newlines, really) of valid email addresses. This
* ``input-file`` is your input file - it should be a single-column csv
(or just a list delimited by newlines, really) of valid email addresses. This
script does not attempt to do any validation. Required.
* ``subscription-plan-uuid`` is the uuid of the plan to assign license to. Required.
Expand Down Expand Up @@ -79,6 +79,7 @@ def _get_jwt(fetch_jwt=False, environment='local'):
}
# we want to sent with a Content-Type of 'application/x-www-form-urlencoded'
# so send in the `data` param instead of `json`.
# pylint: disable=missing-timeout
response = requests.post(
ACCESS_TOKEN_URL_BY_ENVIRONMENT.get(environment),
data=request_payload,
Expand Down Expand Up @@ -142,6 +143,7 @@ def request_assignments(subscription_plan_uuid, chunk_id, emails_for_chunk, envi
"Authorization": "JWT {}".format(_get_jwt(fetch_jwt, environment=environment)),
}

# pylint: disable=missing-timeout
response = requests.post(url, json=payload, headers=headers)

response.raise_for_status()
Expand Down
8 changes: 5 additions & 3 deletions scripts/local_assignment_multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
To use:
```
# os environ names are meaningful and should correspond to the requested environment
# this allows us to fetch a JWT before each request, so you don't have to
# this allows us to fetch a JWT before each request, so you don't have to
# worry about your JWT expiring in the middle of the script execution.
export CLIENT_SECRET_LOCAL=[your-client-secret]
export CLIENT_ID_LOCAL=[your-client-id]
Expand All @@ -23,7 +23,7 @@
```
Options:
* ``input-file`` is your input file - it should contain columns ``email`` and ``subcription_plan_uuid``.
* ``input-file`` is your input file - it should contain columns ``email`` and ``subcription_plan_uuid``.
This script does not attempt to do any validation. Required.
* ``output-file`` is where results of the call to the assignment view are stored.
Expand Down Expand Up @@ -84,6 +84,7 @@ def _get_jwt(fetch_jwt=False, environment='local'):
}
# we want to sent with a Content-Type of 'application/x-www-form-urlencoded'
# so send in the `data` param instead of `json`.
# pylint: disable=missing-timeout
response = requests.post(
ACCESS_TOKEN_URL_BY_ENVIRONMENT.get(environment),
data=request_payload,
Expand Down Expand Up @@ -155,7 +156,7 @@ def is_valid_email(email):

def get_email_chunks(input_file_path, plans_by_name, chunk_size=DEFAULT_CHUNK_SIZE):
"""
Yield chunks of (chunk_id, subscription_plan, email) from the given input file.
Yield chunks of (chunk_id, subscription_plan, email) from the given input file.
Given the same input file and chunk_size,
this will always yield rows with the same chunk id for each provided email.
Expand Down Expand Up @@ -225,6 +226,7 @@ def _post_assignments(subscription_plan_uuid, emails_for_chunk, environment='loc
"Authorization": "JWT {}".format(_get_jwt(fetch_jwt, environment=environment)),
}

# pylint: disable=missing-timeout
return requests.post(url, json=payload, headers=headers)


Expand Down
3 changes: 3 additions & 0 deletions scripts/local_license_enrollment.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def _get_jwt(fetch_jwt=False, environment='local'):
}
# we want to sent with a Content-Type of 'application/x-www-form-urlencoded'
# so send in the `data` param instead of `json`.
# pylint: disable=missing-timeout
response = requests.post(
ACCESS_TOKEN_URL_BY_ENVIRONMENT.get(environment),
data=request_payload,
Expand Down Expand Up @@ -185,6 +186,7 @@ def request_enrollments(
print(f'POST query parameters: {params}')
print(f'POST payload: {payload}')

# pylint: disable=missing-timeout
response = requests.post(
url,
headers=headers,
Expand All @@ -210,6 +212,7 @@ def request_enrollments(
'course_run_keys': [course_run_key],
'notify': False,
}
# pylint: disable=missing-timeout
response = requests.post(
url,
headers=headers,
Expand Down

0 comments on commit 3ed13e8

Please sign in to comment.