From 29f8f5dfcd3c4b97b1fd4a286458fe80cfe952f7 Mon Sep 17 00:00:00 2001 From: Silvio Vasiljevic Date: Mon, 24 Mar 2025 18:59:15 +0100 Subject: [PATCH 1/2] Fix deprecated naming of metadata in setup.cfg --- setup.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 0115b61f..b4ac6d2a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,4 +1,4 @@ [metadata] -description-file = README.md +description_file = README.md [aliases] -test=pytest \ No newline at end of file +test=pytest From 482caaea00504bac168785adafa07d47012f5717 Mon Sep 17 00:00:00 2001 From: Silvio Vasiljevic Date: Thu, 27 Mar 2025 13:44:22 +0100 Subject: [PATCH 2/2] Add wheel building and publishing workflow --- .github/workflows/build.yml | 69 +++++++++++++++++++++++++++++++++++++ README.md | 5 +++ setup.py | 6 ++-- 3 files changed, 77 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..a959103e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,69 @@ +name: Build + +on: + push: + branches: + - master + tags: + - v*.* + pull_request: + workflow_dispatch: + + +jobs: + build_wheel: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + # Used to host cibuildwheel + - name: Setup python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Build wheel + run: pip wheel -w ./wheelhouse . --no-deps + + - uses: actions/upload-artifact@v4 + with: + name: cibw-wheel + path: ./wheelhouse/*.whl + + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Build sdist + run: pipx run build --sdist + + - uses: actions/upload-artifact@v4 + with: + name: cibw-sdist + path: dist/*.tar.gz + + upload_pypi: + needs: [build_wheel, build_sdist] + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/kclpy-ext + permissions: + id-token: write + # if: github.event_name == 'release' && github.event.action == 'published' + # or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this) + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + steps: + - uses: actions/download-artifact@v4 + with: + # unpacks all CIBW artifacts into dist/ + pattern: cibw-* + path: dist + merge-multiple: true + - name: List artifacts + run: ls -lah dist/ + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/README.md b/README.md index d26db4ce..98e1560a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ +# Why this Fork for LocalStack? + +The official AWS python package does not publish the wheels, thus causing the need to always pull from maven on every install. +This destabilizes our pipeline because maven might rate-limit our runners when accessing the JARs. + # Amazon Kinesis Client Library for Python [![Version](https://img.shields.io/pypi/v/amazon-kclpy.svg?style=flat)](https://pypi.org/project/amazon-kclpy/) [![UnitTestCoverage](https://github.com/awslabs/amazon-kinesis-client-python/actions/workflows/run-unit-tests.yml/badge.svg)](https://github.com/awslabs/amazon-kinesis-client-python/actions/workflows/run-unit-tests.yml) diff --git a/setup.py b/setup.py index d83d3152..0d09ac8b 100644 --- a/setup.py +++ b/setup.py @@ -227,9 +227,9 @@ def run(self): pass setup( - name=PACKAGE_NAME, + name=PACKAGE_NAME + "-ext", version=PACKAGE_VERSION, - description='A python interface for the Amazon Kinesis Client Library MultiLangDaemon', + description='A python interface for the Amazon Kinesis Client Library MultiLangDaemon - ext', license='Apache-2.0', packages=[PACKAGE_NAME, PACKAGE_NAME + "/v2", PACKAGE_NAME + "/v3", 'samples'], scripts=glob.glob('samples/*py'), @@ -242,7 +242,7 @@ def run(self): setup_requires=["pytest-runner"], tests_require=["pytest", "mock"], cmdclass=commands, - url="https://github.com/awslabs/amazon-kinesis-client-python", + url="https://github.com/localstack/amazon-kinesis-client-python", keywords="amazon kinesis client library python", zip_safe=False, )