diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 476eca9..520f5c7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -25,9 +25,10 @@ jobs: PDM_PUBLISH_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} run: pdm publish --username __token__ --repository pypi - name: upload to github release - uses: softprops/action-gh-release@v2 + uses: docker://antonyurchenko/git-release:v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # assume any version with "a" (gets "ALPHA") or "b" (gets BETA) or "rc" (release candidates) will be a prerelease + PRE_RELEASE: "${{ contains(github.ref_name, 'a') || contains(github.ref_name, 'b') || contains(github.ref_name, 'rc') }}" with: - files: | - dist/* - # assume any version with "a" (gets "ALPHA") or "b" (gets BETA) will be a prerelease - prerelease: ${{ contains(github.ref_name, 'a') || contains(github.ref_name, 'b') }} + args: dist/* diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..148676f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,15 @@ +# Changelog + +## [0.7.0] - 2024-08-21 + +_If you are upgrading: please see [`UPGRADING.md`](UPGRADING.md)._ + +### Changed + +- **Breaking:** Services now work with multiple Capabilities instead of a single Capability ([!9](https://github.com/INTERSECT-SDK/python-sdk/pull/9)) . + +### Added + +- **Breaking:** Added service-to-service request/response mechanism ([!9](https://github.com/INTERSECT-SDK/python-sdk/pull/9)) . + +[0.7.0]: https://github.com/Level/level/releases/tag/0.7.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..3cf6fde --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1 @@ +Please read the [Contributing](https://intersect-python-sdk.readthedocs.io/en/latest/contributing.html) section on the documentation website. diff --git a/UPGRADING.md b/UPGRADING.md new file mode 100644 index 0000000..6bdb805 --- /dev/null +++ b/UPGRADING.md @@ -0,0 +1,70 @@ +# Upgrade Guide + +This document describes breaking changes and how to upgrade. For a complete list of changes including minor and patch releases, please refer to the [changelog](CHANGELOG.md). + +## 0.7.0 + +### Services + +Services now provide a list of capabilities, instead of just a single capability. You will need to explicitly set your capability's `capability_name` property, and will provide a list of Capabilities to the Service instead of a single capability. So you will need to change former code which looks like this: + +```python +from intersect_sdk import IntersectBaseCapabilityImplementation, IntersectService, intersect_message + +class MyCapabilityImplementation(IntersectBaseCapabilityImplementation): + + @intersect_message + def my_endpoint(self, param: str) -> str: + # ... implementation + +if __name__ == '__main__': + # etc. + capability = MyCapabilityImplementation() + service = IntersectService(capability, + # ... other params + ) +``` + +to this: + +```python +from intersect_sdk import IntersectBaseCapabilityImplementation, IntersectService, intersect_message + +class MyCapabilityImplementation(IntersectBaseCapabilityImplementation): + + @intersect_message + def my_endpoint(self, param: str) -> str: + # ... implementation + +if __name__ == '__main__': + # etc. + capability = MyCapabilityImplementation() + capability.capability_name = 'MyCapability' + service = IntersectService([capability], + # ... other params + ) +``` + +Additionally, this reserves the `intersect_sdk_call_service` function - if you are using this function as a name, **you must change its name**. (You should avoid starting your functions with `__intersect_sdk_`, `_intersect_sdk_`, or `intersect_sdk` - these functions could potentially be reserved by the BaseCapability in the future.) + +### Clients + +When calling another Service's operation, the namespacing has changed from `` to `.` . So for example, if we were calling `my_endpoint` in the above Service example, the code would change from: + +```python +params = IntersectClientMessageParams( + operation='my_endpoint', + # ... other parameters unchanged +) + +``` + +to + +```python +params = IntersectClientMessageParams( + operation='MyCapability.my_endpoint', + # ... other parameters unchanged +) + +``` diff --git a/docs/contributing.rst b/docs/contributing.rst index 615fd0f..ed78685 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -72,3 +72,9 @@ Docstrings Docstrings for Python classes, functions, and modules should adhere to the `Google style `_. The docstrings are processed by the `napoleon extension `_ for the Sphinx generated documentation. We require docstrings for all public classes, functions, and modules. + + +Changelog +--------- + +We follow the `Common Changelog `_ format. When changing/adding/removing functionality, or for bugfixes, please add an appropriate entry in the Change Group (Changed/Added/Removed/Fixed) . See sections 2.2 and 2.4 for details.