Skip to content

Commit fdfb590

Browse files
committed
publish to pypi
1 parent e27cd90 commit fdfb590

File tree

2 files changed

+71
-1
lines changed

2 files changed

+71
-1
lines changed

.github/workflows/publish.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Upload Python Package to PyPI when a Release is Created
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
pypi-publish:
9+
name: Publish release to PyPI
10+
runs-on: ${{ matrix.os }}
11+
environment:
12+
name: pypi
13+
url: https://pypi.org/p/pyiceberg-kevinliu
14+
permissions:
15+
id-token: write
16+
strategy:
17+
matrix:
18+
os: [ ubuntu-22.04, windows-2022, macos-11, macos-12, macos-13, macos-14 ]
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- uses: actions/setup-python@v5
26+
with:
27+
python-version: '3.11'
28+
29+
- name: Install poetry
30+
run: pip install poetry
31+
32+
# - name: Set version
33+
# run: python -m poetry version "${{ inputs.version }}"
34+
# if: "${{ github.event.inputs.version != 'main' }}"
35+
36+
# Publish the source distribution with the version that's in
37+
# the repository, otherwise the tests will fail
38+
- name: Compile source distribution
39+
run: python3 -m poetry build --format=sdist
40+
if: startsWith(matrix.os, 'ubuntu')
41+
42+
- name: Build wheels
43+
uses: pypa/[email protected]
44+
with:
45+
output-dir: wheelhouse
46+
config-file: "pyproject.toml"
47+
env:
48+
# Ignore 32 bit architectures
49+
CIBW_ARCHS: "auto64"
50+
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8,<3.12"
51+
CIBW_TEST_REQUIRES: "pytest==7.4.2 moto==5.0.1"
52+
CIBW_TEST_EXTRAS: "s3fs,glue"
53+
CIBW_TEST_COMMAND: "pytest {project}/tests/avro/test_decoder.py"
54+
# There is an upstream issue with installing on MacOSX
55+
# https://github.com/pypa/cibuildwheel/issues/1603
56+
# Ignore tests for pypy since not all dependencies are compiled for it
57+
# and would require a local rust build chain
58+
CIBW_TEST_SKIP: "pp* *macosx*"
59+
60+
- name: Add source distribution
61+
if: startsWith(matrix.os, 'ubuntu')
62+
run: ls -lah dist/* && cp dist/* wheelhouse/
63+
64+
- uses: actions/upload-artifact@v3
65+
with:
66+
name: "release-${{ github.event.inputs.version }}"
67+
path: ./wheelhouse/*
68+
69+
- name: Publish package distributions to PyPI
70+
uses: pypa/gh-action-pypi-publish@release/v1

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
[tool.poetry]
18-
name = "pyiceberg"
18+
name = "pyiceberg-kevinliu"
1919
version = "0.6.1"
2020
readme = "README.md"
2121
homepage = "https://py.iceberg.apache.org/"

0 commit comments

Comments
 (0)