From 02fcfbb3f6bcf11da44c8286622527f056236610 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Wed, 15 Feb 2023 17:56:30 -0800 Subject: [PATCH] Publish foxglove-schemas-flatbuffer to PyPI (#88) **Public-Facing Changes** - Publish flatbuffer package to PyPI (`pip install foxglove-schemas-flatbuffer`) --- .github/workflows/ci.yml | 21 ++++++++++++++++++++ python/Pipfile | 2 +- python/Pipfile.lock | 6 +----- python/foxglove-schemas-flatbuffer/README.md | 2 +- python/foxglove-schemas-protobuf/README.md | 2 +- 5 files changed, 25 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 063845b5..51969753 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,6 +85,27 @@ jobs: - run: make test - run: make build + - name: Publish foxglove-schemas-flatbuffer to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }} + with: + user: __token__ + password: ${{ secrets.TESTPYPI_API_TOKEN }} + packages_dir: python/foxglove-schemas-flatbuffer/dist + repository_url: https://test.pypi.org/legacy/ + skip_existing: true + + - name: Publish foxglove-schemas-flatbuffer to PyPI + if: | + !github.event.pull_request.head.repo.fork && + github.actor != 'dependabot[bot]' && + startsWith(github.ref, 'refs/tags/releases/python/foxglove-schemas-flatbuffer/v') + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + packages_dir: python/foxglove-schemas-flatbuffer/dist + - name: Publish foxglove-schemas-protobuf to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }} diff --git a/python/Pipfile b/python/Pipfile index 46074e98..5d407340 100644 --- a/python/Pipfile +++ b/python/Pipfile @@ -6,7 +6,7 @@ name = "pypi" [packages] flatbuffers = "*" protobuf = "*" -foxglove-schemas-flatbuffers = {editable = true, path = "./foxglove-schemas-flatbuffer"} +foxglove-schemas-flatbuffer = {editable = true, path = "./foxglove-schemas-flatbuffer"} foxglove-schemas-protobuf = {editable = true, path = "./foxglove-schemas-protobuf"} [dev-packages] diff --git a/python/Pipfile.lock b/python/Pipfile.lock index 7223d571..a015eaa1 100644 --- a/python/Pipfile.lock +++ b/python/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "0977308fe2b87d61ab61ec8c80a37a085c04790c1d151f3492fb6c61f1acef60" + "sha256": "a1d616c262c4933be8f4bc82934ff47e24687239f76c1d5382c5ec41858233d7" }, "pipfile-spec": 6, "requires": { @@ -28,10 +28,6 @@ "editable": true, "path": "./foxglove-schemas-flatbuffer" }, - "foxglove-schemas-flatbuffers": { - "editable": true, - "path": "./foxglove-schemas-flatbuffer" - }, "foxglove-schemas-protobuf": { "editable": true, "path": "./foxglove-schemas-protobuf" diff --git a/python/foxglove-schemas-flatbuffer/README.md b/python/foxglove-schemas-flatbuffer/README.md index 028da7e9..a2bb2c23 100644 --- a/python/foxglove-schemas-flatbuffer/README.md +++ b/python/foxglove-schemas-flatbuffer/README.md @@ -12,7 +12,7 @@ pipenv install foxglove-schemas-flatbuffer ## Usage -Import types from the `foxglove` module as follows: +Import types from the `foxglove_schemas_flatbuffer` module as follows: ```py import flatbuffers diff --git a/python/foxglove-schemas-protobuf/README.md b/python/foxglove-schemas-protobuf/README.md index 6f806e5b..7185b54b 100644 --- a/python/foxglove-schemas-protobuf/README.md +++ b/python/foxglove-schemas-protobuf/README.md @@ -12,7 +12,7 @@ pipenv install foxglove-schemas-protobuf ## Usage -Import types from the `foxglove` module as follows: +Import types from the `foxglove_schemas_protobuf` module as follows: ```py from foxglove_schemas_protobuf.CompressedImage_pb2 import CompressedImage