Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 5 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ on:
jobs:
build:
name: Compile and Test 🔨
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
runs-on: ubuntu-latest
steps:
- name: Clone Repository
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # 4.1.6
- name: Setup Python 3.9
- name: Setup Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # 5.1.0
with:
python-version: '3.9'
python-version: ${{ matrix.python-version }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍👍

- name: Install dependencies
run: make install
- name: Run tests
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ repos:
rev: stable
hooks:
- id: black
language_version: python3.6
language_version: python3.9
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,14 @@ install:

lint: install
${ISORT} --diff staxapp/*.py
${BLACK} -t py37 --check --diff staxapp/
${BLACK} -t py39 --check --diff staxapp/

format:
${ISORT} --apply staxapp/*.py
${BLACK} -t py37 staxapp/*.py
${BLACK} -t py37 staxapp/data/*.json
${BLACK} -t py39 staxapp/*.py

download-schema:
curl --fail --compressed -s -o staxapp/data/schema.json https://api.au1.staxapp.cloud/20190206/public/api-document
curl --fail --compressed -s -o staxapp/data/schema.json https://api.au1.staxapp.cloud/20190206/public/oas3-document


bundle-test: install
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.black]
line-length = 88
target-version = ['py36', 'py37']
target-version = ['py39', 'py310', 'py311', 'py312', 'py313']
include = '\.pyi?$'
exclude = '''
/(
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ pytest
pytest-cov
responses
requests
setuptools
pyjwt
boto3
aws_requests_auth
openapi-spec-validator==0.2.9
openapi-spec-validator
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def get_version():
include_package_data=True,
package_data={"staxapp": ["data/*.json"]},
zip_safe=False,
python_requires=">=3.6",
python_requires=">=3.9",
project_urls={"GitHub": "https://github.com/stax-labs/lib-stax-python-sdk"},
classifiers=[
'Development Status :: 4 - Beta',
Expand All @@ -44,9 +44,10 @@ def get_version():
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
],
)
2 changes: 1 addition & 1 deletion staxapp/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.3.1"
__version__ = "1.3.2"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

atleast a 1.4.0 :P

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can clearly see when things started out as "bump a few dependencies" into something much more involved. 😛 Will bump the version proper.

2 changes: 1 addition & 1 deletion staxapp/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def branch(cls):

@classmethod
def schema_url(cls):
return f"https://{cls.hostname}/{cls.API_VERSION}/public/api-document"
return f"https://{cls.hostname}/{cls.API_VERSION}/public/oas3-document"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be good to have some tests to validate the current calls are still valid. The sdk knows about these, for example:

>>> accounts.ffff()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/levence/.pyenv/versions/3.9.20/lib/python3.9/site-packages/staxapp/openapi.py", line 100, in stax_wrapper
    raise ValidationException(
staxapp.exceptions.ValidationException: No such operation: ffff for accounts. Please use one of ['UpdateAccountTypeMembers', 'ReadAccounts', 'CreateAccount', 'CloseAccount', 'DiscoverAccounts', 'OnboardAccount', 'ReadAccountTypes', 'CreateAccountType', 'UpdateAccountTypeAccess', 'DeleteAccountType', 'UpdateAccountType', 'UpdateAccount', 'ReadAccountPolicyAttachments']

accounts.UpdateAccount(x=1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/levence/.pyenv/versions/3.9.20/lib/python3.9/site-packages/staxapp/openapi.py", line 122, in stax_wrapper
    raise ValidationException(
staxapp.exceptions.ValidationException: Missing one or more parameters: ['account_id']

There is probably a smart way to retrieve these on the old schema and assert in the new schema yeah?


@classmethod
def get_auth_class(cls):
Expand Down
3 changes: 1 addition & 2 deletions staxapp/contract.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import json
import logging
import os
from contextlib import suppress

import requests
from jsonschema import validate as json_validate
Expand Down Expand Up @@ -53,7 +52,7 @@ def validate(cls, data, component):

@staticmethod
def default_swagger_template() -> dict:
# Get the default swagger template from https://api.au1.staxapp.cloud/20190206/public/api-document
# Get the default swagger template from https://api.au1.staxapp.cloud/20190206/public/oas3-document
schema_response = requests.get(Config.GetDefaultConfig().schema_url()).json()
template = dict(
openapi="3.0.0",
Expand Down
Loading
Loading