-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace jsonpickle with json to serialize entity (#275)
* Replace jsonpickle with json to serialize entity * Added workflow to create release tag * Pinned sqlalchemy and Flask-SQLAlchemy for unit test * Fixed version * Changed log to debug level * Update logging * Added empty line
- Loading branch information
1 parent
508f929
commit 266bc82
Showing
10 changed files
with
640 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Release X-Ray Python SDK | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: The version to tag the release with, e.g., 1.2.0, 1.3.0 | ||
required: true | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout master branch | ||
uses: actions/checkout@v2 | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: '${{ github.event.inputs.version }}' | ||
release_name: '${{ github.event.inputs.version }} Release' | ||
body: 'See details in [CHANGELOG](https://github.com/aws/aws-xray-sdk-python/blob/master/CHANGELOG.rst)' | ||
draft: true | ||
prerelease: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import logging | ||
|
||
log = logging.getLogger(__name__) | ||
|
||
def metadata_to_dict(obj): | ||
""" | ||
Convert object to dict with all serializable properties like: | ||
dict, list, set, tuple, str, bool, int, float, type, object, etc. | ||
""" | ||
try: | ||
if isinstance(obj, dict): | ||
metadata = {} | ||
for key, value in obj.items(): | ||
metadata[key] = metadata_to_dict(value) | ||
return metadata | ||
elif isinstance(obj, type): | ||
return str(obj) | ||
elif hasattr(obj, "_ast"): | ||
return metadata_to_dict(obj._ast()) | ||
elif hasattr(obj, "__iter__") and not isinstance(obj, str): | ||
metadata = [] | ||
for item in obj: | ||
metadata.append(metadata_to_dict(item)) | ||
return metadata | ||
elif hasattr(obj, "__dict__"): | ||
metadata = {} | ||
for key, value in vars(obj).items(): | ||
if not callable(value) and not key.startswith('_'): | ||
metadata[key] = metadata_to_dict(value) | ||
return metadata | ||
else: | ||
return obj | ||
except Exception: | ||
log.exception("Failed to convert {} to dict".format(str(obj))) | ||
return {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,6 @@ | |
], | ||
|
||
install_requires=[ | ||
'jsonpickle', | ||
'enum34;python_version<"3.4"', | ||
'wrapt', | ||
'future', | ||
|
Oops, something went wrong.