THRIFT-5688: DONOTMERGE: Test PyPI publishing
diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml
new file mode 100644
index 0000000..1a12097
--- /dev/null
+++ b/.github/workflows/pypi.yml
@@ -0,0 +1,34 @@
+name: "PyPI publishing"
+
+on:
+  pull_request:
+    branches: ["*"]
+
+jobs:
+  pypi-publish:
+    name: upload release to PyPI
+    runs-on: ubuntu-latest
+    # Specifying a GitHub environment is optional, but strongly encouraged
+    environment: release
+    permissions:
+      # IMPORTANT: this permission is mandatory for trusted publishing
+      id-token: write
+    steps:
+      - uses: actions/checkout@v4
+
+      - name: Set up Python
+        uses: actions/setup-python@v5
+        with:
+          python-version: "3.8"
+
+      - name: Build
+        run: |
+          cd lib/py
+          python setup.py sdist
+
+      - name: Publish package distributions to PyPI
+        uses: pypa/gh-action-pypi-publish@release/v1
+        with:
+          repository-url: https://test.pypi.org/legacy/
+          packages-dir: lib/py/dist/
+
diff --git a/lib/py/setup.py b/lib/py/setup.py
index 31e2bae..3a0ec41 100644
--- a/lib/py/setup.py
+++ b/lib/py/setup.py
@@ -104,7 +104,7 @@
     tornado_deps = ['tornado>=4.0']
     twisted_deps = ['twisted']
 
-    setup(name='thrift',
+    setup(name='thrift-test',
           version='0.21.0',
           description='Python bindings for the Apache Thrift RPC system',
           long_description=read_file("README.md"),