diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml new file mode 100644 index 0000000..f0a5b3c --- /dev/null +++ b/.github/workflows/publish-pypi.yml @@ -0,0 +1,31 @@ +# This workflow is triggered when a GitHub release is created. +# It can also be run manually to re-publish to PyPI in case it failed for some reason. +# You can run this workflow by navigating to https://www.github.com/CASParser/cas-parser-python/actions/workflows/publish-pypi.yml +name: Publish PyPI +on: + workflow_dispatch: + + release: + types: [published] + +jobs: + publish: + name: publish + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install Rye + run: | + curl -sSf https://rye.astral.sh/get | bash + echo "$HOME/.rye/shims" >> $GITHUB_PATH + env: + RYE_VERSION: '0.44.0' + RYE_INSTALL_OPTION: '--yes' + + - name: Publish to PyPI + run: | + bash ./bin/publish-pypi + env: + PYPI_TOKEN: ${{ secrets.CAS_PARSER_PYPI_TOKEN || secrets.PYPI_TOKEN }} diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml new file mode 100644 index 0000000..ea04f96 --- /dev/null +++ b/.github/workflows/release-doctor.yml @@ -0,0 +1,21 @@ +name: Release Doctor +on: + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + release_doctor: + name: release doctor + runs-on: ubuntu-latest + if: github.repository == 'CASParser/cas-parser-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') + + steps: + - uses: actions/checkout@v4 + + - name: Check release environment + run: | + bash ./bin/check-release-environment + env: + PYPI_TOKEN: ${{ secrets.CAS_PARSER_PYPI_TOKEN || secrets.PYPI_TOKEN }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..c7159c1 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.0.2" +} \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index b0bed10..4a4c195 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 5 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser%2Fcas-parser-b7fdba3d3f97c7debc22c7ca30b828bce81bcd64648df8c94029b27a3321ebb9.yml openapi_spec_hash: 03f1315f1d32ada42445ca920f047dff -config_hash: 2632d49bed76591e5ca0ddf94f518f17 +config_hash: 1de8a243a3962065e289ca915dfc6127 diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..9c28e65 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,10 @@ +# Changelog + +## 0.0.2 (2025-08-18) + +Full Changelog: [v0.0.1...v0.0.2](https://github.com/CASParser/cas-parser-python/compare/v0.0.1...v0.0.2) + +### Chores + +* configure new SDK language ([5748dab](https://github.com/CASParser/cas-parser-python/commit/5748dab8b8241dc537456d9b8c1dae3c0e4a5d5a)) +* update SDK settings ([25126eb](https://github.com/CASParser/cas-parser-python/commit/25126eb2330f0e84bd4dd9e814e6a2e5b2ebbddc)) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c565215..9de374b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -62,7 +62,7 @@ If you’d like to use the repository from source, you can either install from g To install via git: ```sh -$ pip install git+ssh://git@github.com/stainless-sdks/cas-parser-python.git +$ pip install git+ssh://git@github.com/CASParser/cas-parser-python.git ``` Alternatively, you can build from source and install the wheel file: @@ -120,7 +120,7 @@ the changes aren't made through the automated pipeline, you may want to make rel ### Publish with a GitHub workflow -You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/stainless-sdks/cas-parser-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up. +You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/CASParser/cas-parser-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up. ### Publish manually diff --git a/README.md b/README.md index 0843fd6..c139318 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,8 @@ The REST API documentation can be found on [docs.casparser.in](https://docs.casp ## Installation ```sh -# install from this staging repo -pip install git+ssh://git@github.com/stainless-sdks/cas-parser-python.git +# install from the production repo +pip install git+ssh://git@github.com/CASParser/cas-parser-python.git ``` > [!NOTE] @@ -79,8 +79,8 @@ By default, the async client uses `httpx` for HTTP requests. However, for improv You can enable this by installing `aiohttp`: ```sh -# install from this staging repo -pip install 'cas_parser[aiohttp] @ git+ssh://git@github.com/stainless-sdks/cas-parser-python.git' +# install from the production repo +pip install 'cas_parser[aiohttp] @ git+ssh://git@github.com/CASParser/cas-parser-python.git' ``` Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`: @@ -242,9 +242,9 @@ cas_parser = response.parse() # get the object that `cas_parser.cams_kfintech() print(cas_parser.demat_accounts) ``` -These methods return an [`APIResponse`](https://github.com/stainless-sdks/cas-parser-python/tree/main/src/cas_parser/_response.py) object. +These methods return an [`APIResponse`](https://github.com/CASParser/cas-parser-python/tree/main/src/cas_parser/_response.py) object. -The async client returns an [`AsyncAPIResponse`](https://github.com/stainless-sdks/cas-parser-python/tree/main/src/cas_parser/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. +The async client returns an [`AsyncAPIResponse`](https://github.com/CASParser/cas-parser-python/tree/main/src/cas_parser/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. #### `.with_streaming_response` @@ -348,7 +348,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. -We are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/cas-parser-python/issues) with questions, bugs, or suggestions. +We are keen for your feedback; please open an [issue](https://www.github.com/CASParser/cas-parser-python/issues) with questions, bugs, or suggestions. ### Determining the installed version diff --git a/bin/check-release-environment b/bin/check-release-environment new file mode 100644 index 0000000..b845b0f --- /dev/null +++ b/bin/check-release-environment @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +errors=() + +if [ -z "${PYPI_TOKEN}" ]; then + errors+=("The PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.") +fi + +lenErrors=${#errors[@]} + +if [[ lenErrors -gt 0 ]]; then + echo -e "Found the following errors in the release environment:\n" + + for error in "${errors[@]}"; do + echo -e "- $error\n" + done + + exit 1 +fi + +echo "The environment is ready to push releases!" diff --git a/pyproject.toml b/pyproject.toml index 2c2af13..1a1e4a2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "cas_parser" -version = "0.0.1" +version = "0.0.2" description = "The official Python library for the CAS Parser API" dynamic = ["readme"] license = "Apache-2.0" @@ -35,8 +35,8 @@ classifiers = [ ] [project.urls] -Homepage = "https://github.com/stainless-sdks/cas-parser-python" -Repository = "https://github.com/stainless-sdks/cas-parser-python" +Homepage = "https://github.com/CASParser/cas-parser-python" +Repository = "https://github.com/CASParser/cas-parser-python" [project.optional-dependencies] aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.8"] @@ -125,7 +125,7 @@ path = "README.md" [[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]] # replace relative links with absolute links pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)' -replacement = '[\1](https://github.com/stainless-sdks/cas-parser-python/tree/main/\g<2>)' +replacement = '[\1](https://github.com/CASParser/cas-parser-python/tree/main/\g<2>)' [tool.pytest.ini_options] testpaths = ["tests"] diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..316db21 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,66 @@ +{ + "packages": { + ".": {} + }, + "$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json", + "include-v-in-tag": true, + "include-component-in-tag": false, + "versioning": "prerelease", + "prerelease": true, + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": false, + "pull-request-header": "Automated Release PR", + "pull-request-title-pattern": "release: ${version}", + "changelog-sections": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "perf", + "section": "Performance Improvements" + }, + { + "type": "revert", + "section": "Reverts" + }, + { + "type": "chore", + "section": "Chores" + }, + { + "type": "docs", + "section": "Documentation" + }, + { + "type": "style", + "section": "Styles" + }, + { + "type": "refactor", + "section": "Refactors" + }, + { + "type": "test", + "section": "Tests", + "hidden": true + }, + { + "type": "build", + "section": "Build System" + }, + { + "type": "ci", + "section": "Continuous Integration", + "hidden": true + } + ], + "release-type": "python", + "extra-files": [ + "src/cas_parser/_version.py" + ] +} \ No newline at end of file diff --git a/src/cas_parser/_version.py b/src/cas_parser/_version.py index 96a609e..9687491 100644 --- a/src/cas_parser/_version.py +++ b/src/cas_parser/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "cas_parser" -__version__ = "0.0.1" +__version__ = "0.0.2" # x-release-please-version diff --git a/src/cas_parser/resources/cas_generator.py b/src/cas_parser/resources/cas_generator.py index 77bc291..511b893 100644 --- a/src/cas_parser/resources/cas_generator.py +++ b/src/cas_parser/resources/cas_generator.py @@ -30,7 +30,7 @@ def with_raw_response(self) -> CasGeneratorResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/cas-parser-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/CASParser/cas-parser-python#accessing-raw-response-data-eg-headers """ return CasGeneratorResourceWithRawResponse(self) @@ -39,7 +39,7 @@ def with_streaming_response(self) -> CasGeneratorResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/cas-parser-python#with_streaming_response + For more information, see https://www.github.com/CASParser/cas-parser-python#with_streaming_response """ return CasGeneratorResourceWithStreamingResponse(self) @@ -113,7 +113,7 @@ def with_raw_response(self) -> AsyncCasGeneratorResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/cas-parser-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/CASParser/cas-parser-python#accessing-raw-response-data-eg-headers """ return AsyncCasGeneratorResourceWithRawResponse(self) @@ -122,7 +122,7 @@ def with_streaming_response(self) -> AsyncCasGeneratorResourceWithStreamingRespo """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/cas-parser-python#with_streaming_response + For more information, see https://www.github.com/CASParser/cas-parser-python#with_streaming_response """ return AsyncCasGeneratorResourceWithStreamingResponse(self) diff --git a/src/cas_parser/resources/cas_parser.py b/src/cas_parser/resources/cas_parser.py index 45d205a..a64b7dd 100644 --- a/src/cas_parser/resources/cas_parser.py +++ b/src/cas_parser/resources/cas_parser.py @@ -35,7 +35,7 @@ def with_raw_response(self) -> CasParserResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/cas-parser-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/CASParser/cas-parser-python#accessing-raw-response-data-eg-headers """ return CasParserResourceWithRawResponse(self) @@ -44,7 +44,7 @@ def with_streaming_response(self) -> CasParserResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/cas-parser-python#with_streaming_response + For more information, see https://www.github.com/CASParser/cas-parser-python#with_streaming_response """ return CasParserResourceWithStreamingResponse(self) @@ -281,7 +281,7 @@ def with_raw_response(self) -> AsyncCasParserResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/cas-parser-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/CASParser/cas-parser-python#accessing-raw-response-data-eg-headers """ return AsyncCasParserResourceWithRawResponse(self) @@ -290,7 +290,7 @@ def with_streaming_response(self) -> AsyncCasParserResourceWithStreamingResponse """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/cas-parser-python#with_streaming_response + For more information, see https://www.github.com/CASParser/cas-parser-python#with_streaming_response """ return AsyncCasParserResourceWithStreamingResponse(self)