Skip to content

Commit

Permalink
- new nzshm-common
Browse files Browse the repository at this point in the history
 - updated serverless, serverless-wsgi and serverless-python-requirements
 - move to python3.10
 - pin boto3 and botcore to workaround boto/boto3#3648
  • Loading branch information
chrisbc committed Apr 18, 2023
1 parent 1f82c65 commit c6d0b16
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 23 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## [0.7.2] - 2023-04-18
### Changed
- new nzshm-common
- updated serverless, serverless-wsgi and serverless-python-requirements
- move to python3.10
- pin boto3 and botcore to workaround https://github.com/boto/boto3/issues/3648
### Added
- about resolver returns version

## [0.7.1] - 2023-04-17
### Changed
- updated dependencies nzshm_common, geopandas, toshi_hazard_s
Expand Down
3 changes: 2 additions & 1 deletion kororaa_graphql_api/schema/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import logging

import graphene
import kororaa_graphql_api
from graphene import relay
from nzshm_common.location import CodedLocation

Expand Down Expand Up @@ -116,7 +117,7 @@ def resolve_hazard_curves(root, info, **kwargs):
return hazard_curves(kwargs)

def resolve_about(root, info, **args):
return "Hello World, I am kororaa_graphql_api!"
return f"Hello World, I am kororaa_graphql_api! Version: {kororaa_graphql_api.__version__}"


schema_root = graphene.Schema(query=QueryRoot, mutation=None, auto_camelcase=False)
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"homepage": "https://github.com/GNS-Science/kororaa-graphql-api#readme",
"dependencies": {
"ajv": "^8.11.0",
"serverless": "^3.18.2",
"serverless-python-requirements": "^5.4.0",
"serverless-wsgi": "^3.0.0"
"serverless": "^3.30.1",
"serverless-python-requirements": "^6.0.0",
"serverless-wsgi": "^3.0.2"
},
"devDependencies": {
"serverless-plugin-warmup": "^8.0.0",
Expand Down
28 changes: 11 additions & 17 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ PyYAML = "^6.0"
pandas = "^1.4.3"
geopandas = "^0.12.0"
matplotlib = "^3.5.3"
boto3 = "^1.24.57"
boto3 = "1.26.90" # to align with AWS pyton 3.10 lambda
botocore = "1.29.90" # as above
python-dateutil = "^2.8.2"
pyproj = "3.3.0"
nzshm-grid-loc = {git = "https://github.com/GNS-Science/nzshm-grid-loc.git", rev = "main"}
nzshm-common = {extras = ["geometry"], version = "^0.5.0"}
nzshm-model = "^0.2.0"
toshi-hazard-store = "^0.7.0"
nzshm-common = "^0.5.1"

[tool.poetry.group.dev.dependencies]
tox = "^4.2.8"
Expand Down
1 change: 1 addition & 0 deletions serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ custom:
slimPatterns:
- '**/*.egg-info*'
noDeploy:
- boto3
- botocore
- fiona
- Fiona.libs
Expand Down
14 changes: 14 additions & 0 deletions tests/test_kororaa_graphql_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from kororaa_graphql_api.schema import schema_root
from kororaa_graphql_api.kororaa_graphql_api import create_app

import kororaa_graphql_api

class TestFlaskApp(unittest.TestCase):
"""Tests the basic app create."""
Expand Down Expand Up @@ -35,3 +36,16 @@ def test_get_about(self):
executed = self.client.execute(QUERY)
print(executed)
self.assertTrue('Hello World' in executed['data']['about'])


def test_get_about_has_version(self):

QUERY = """
query {
about
}
"""

executed = self.client.execute(QUERY)
print(executed)
self.assertTrue(kororaa_graphql_api.__version__ in executed['data']['about'])

0 comments on commit c6d0b16

Please sign in to comment.