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

Remove Support for Python 3.8 #70

Merged
merged 23 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:

- uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: 3.12

- name: install dependencies and render templates
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:

- uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: 3.12

- run: |
python -m pip install --upgrade pip
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [PEP 440](https://www.python.org/dev/peps/pep-0440/)
and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.0]
### Removed
- Support for Python 3.8 has been removed. Python 3.12 is now supported.

## [0.0.13]
### Changed
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Review the parameters in [cloudformation.yml](cloudformation.yml) for deploy tim

### Deploy with CloudFormation

- Install dependencies for each component (requires pip for python 3.8)
- Install dependencies for each component (requires pip for python 3.12)

```sh
python -m pip install -r find_new/requirements.txt -t find_new/src
Expand Down
1 change: 1 addition & 0 deletions api/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
flask
flask_api
werkzeug<3
Flask-Cors
serverless_wsgi
./database
2 changes: 1 addition & 1 deletion api/src/api.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from datetime import datetime, timedelta, timezone
from decimal import Decimal
from json import JSONEncoder

from flask import Flask, abort, jsonify
from flask.json import JSONEncoder
from flask_api.status import HTTP_404_NOT_FOUND
from flask_cors import CORS
from serverless_wsgi import handle_request
Expand Down
2 changes: 1 addition & 1 deletion database/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
license='BSD',
include_package_data=True,

python_requires='~=3.8',
python_requires='~=3.12',

packages=find_packages(),
)
2 changes: 1 addition & 1 deletion find_new/cloudformation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Resources:
Handler: find_new.lambda_handler
MemorySize: 128
Role: !GetAtt Role.Arn
Runtime: python3.8
Runtime: python3.12
Timeout: 900

EventInvokeConfig:
Expand Down
2 changes: 1 addition & 1 deletion find_new/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
asf-search==3.1.3
hyp3-sdk>=1.3.2
hyp3-sdk<6.1.0
AndrewPlayer3 marked this conversation as resolved.
Show resolved Hide resolved
python-dateutil
requests
./database
2 changes: 1 addition & 1 deletion harvest_products/cloudformation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Resources:
Handler: harvest_products.lambda_handler
MemorySize: 2048
Role: !GetAtt Role.Arn
Runtime: python3.8
Runtime: python3.12
Timeout: 900

EventInvokeConfig:
Expand Down
2 changes: 1 addition & 1 deletion harvest_products/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
hyp3-sdk>=1.3.2
hyp3-sdk<6.1.0
requests
AndrewPlayer3 marked this conversation as resolved.
Show resolved Hide resolved
./database
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pytest
import yaml
from botocore.stub import Stubber
from moto import mock_dynamodb2
from moto import mock_aws

import api
import harvest_products
Expand All @@ -23,7 +23,7 @@ def get_table_properties_from_template(resource_name):

@pytest.fixture
def tables():
with mock_dynamodb2():
with mock_aws():
database.DB = boto3.resource('dynamodb')

class Tables:
Expand Down
17 changes: 10 additions & 7 deletions tests/test_find_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def test_get_neighbors_max_neighbors_error():

@responses.activate
def test_submit_jobs_for_granule(tables):
responses.add(responses.GET, AUTH_URL)
responses.add(responses.GET, AUTH_URL, json.dumps({}))
mock_hyp3_response = {
'jobs': [
{
Expand Down Expand Up @@ -393,6 +393,9 @@ def test_submit_jobs_for_granule(tables):
}
event_id = 'event_id1'

mock_user = {"user_id": "some_user"}
responses.add(responses.GET, environ['HYP3_URL'] + '/user', json.dumps(mock_user))

hyp3 = HyP3(environ['HYP3_URL'], username=environ['EDL_USERNAME'], password=environ['EDL_PASSWORD'])
with patch('find_new.get_neighbors', lambda x: mock_neighbors):
find_new.submit_jobs_for_granule(hyp3, event_id, granule)
Expand Down Expand Up @@ -590,13 +593,13 @@ def test_lambda_handler(tables):

assert len(products) == 5

assert products[2]['job_type'] == 'RTC_GAMMA'
assert products[4]['job_type'] == 'RTC_GAMMA'
assert products[4]['granules'][0]['granule_name'] == 'granule3'

assert products[2]['job_type'] == 'INSAR_GAMMA'
assert products[2]['granules'][0]['granule_name'] == 'granule3'
assert products[2]['granules'][1]['granule_name'] == 'neighbor1'

assert products[3]['job_type'] == 'INSAR_GAMMA'
assert products[3]['granules'][0]['granule_name'] == 'granule3'
assert products[3]['granules'][1]['granule_name'] == 'neighbor1'

assert products[4]['job_type'] == 'INSAR_GAMMA'
assert products[4]['granules'][0]['granule_name'] == 'granule3'
assert products[4]['granules'][1]['granule_name'] == 'neighbor2'
assert products[3]['granules'][1]['granule_name'] == 'neighbor2'
Loading