Skip to content

Commit 68b9f08

Browse files
authored
fix(python): fix py release on macos 13 (#2478)
<!-- **Thanks for contributing to Fory.** **If this is your first time opening a PR on fory, you can refer to [CONTRIBUTING.md](https://github.com/apache/fory/blob/main/CONTRIBUTING.md).** Contribution Checklist - The **Apache Fory** community has requirements on the naming of pr titles. You can also find instructions in [CONTRIBUTING.md](https://github.com/apache/fory/blob/main/CONTRIBUTING.md). - Fory has a strong focus on performance. If the PR you submit will have an impact on performance, please benchmark it first and provide the benchmark result here. --> ## What does this PR do? <!-- Describe the purpose of this PR. --> ## Related issues #2474 #2473 <!-- Is there any related issue? Please attach here. - #xxxx0 - #xxxx1 - #xxxx2 --> ## Does this PR introduce any user-facing change? <!-- If any user-facing interface changes, please [open an issue](https://github.com/apache/fory/issues/new/choose) describing the need to do so and update the document if necessary. --> - [ ] Does this PR introduce any public API change? - [ ] Does this PR introduce any binary protocol compatibility change? ## Benchmark <!-- When the PR has an impact on performance (if you don't know whether the PR will have an impact on performance, you can submit the PR first, and if it will have impact on performance, the code reviewer will explain it), be sure to attach a benchmark data here. -->
1 parent 1e01b9a commit 68b9f08

3 files changed

Lines changed: 16 additions & 18 deletions

File tree

.github/workflows/release.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ jobs:
125125
with:
126126
repository-url: https://test.pypi.org/legacy/
127127
skip-existing: true
128+
verbose: true
128129
verify-metadata: false
129130
packages-dir: downloaded_wheels
130131
- name: Publish to PyPI

ci/deploy.sh

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,19 @@ build_pyfory() {
7272
# Fix strange installed deps not found
7373
pip install setuptools -U
7474

75-
python setup.py bdist_wheel --dist-dir=../dist
75+
if [[ "$OSTYPE" == "darwin"* ]]; then
76+
MACOS_VERSION=$(sw_vers -productVersion | cut -d. -f1-2)
77+
echo "MACOS_VERSION: $MACOS_VERSION"
78+
if [[ "$MACOS_VERSION" == "13"* ]]; then
79+
export MACOSX_DEPLOYMENT_TARGET=10.13
80+
python setup.py bdist_wheel --plat-name macosx_10_13_x86_64 --dist-dir=../dist
81+
else
82+
python setup.py bdist_wheel --dist-dir=../dist
83+
fi
84+
else
85+
python setup.py bdist_wheel --dist-dir=../dist
86+
fi
87+
7688
ls -l ../dist
7789

7890
if [ -n "$PLAT" ]; then
@@ -83,22 +95,7 @@ build_pyfory() {
8395
auditwheel repair ../dist/pyfory-*-linux_*.whl --plat "$PLAT" --exclude '*arrow*' --exclude '*parquet*' --exclude '*numpy*' -w ../dist/
8496
rm ../dist/pyfory-*-linux_*.whl
8597
elif [[ "$OSTYPE" == "darwin"* ]]; then
86-
# Check macOS version
87-
MACOS_VERSION=$(sw_vers -productVersion | cut -d. -f1-2)
88-
if [[ "$MACOS_VERSION" == "13"* ]]; then
89-
# Check if wheel ends with x86_64.whl
90-
for wheel in ../dist/pyfory-*-macosx*.whl; do
91-
if [[ "$wheel" == *"x86_64.whl" ]]; then
92-
echo "Fixing wheel tags for x86_64 wheel: $wheel"
93-
wheel tags --platform-tag macosx_12_0_x86_64 "$wheel"
94-
else
95-
echo "Skipping wheel tags for non-x86_64 wheel: $wheel"
96-
fi
97-
done
98-
else
99-
# Other macOS versions: skip wheel repair
100-
echo "Skipping wheel repair for macOS $MACOS_VERSION"
101-
fi
98+
echo "Skip macos wheel repair"
10299
elif [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then
103100
echo "Skip windows wheel repair"
104101
fi

python/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ all = ["pyarrow"]
5959
dev = ["ruff"]
6060

6161
[tool.setuptools]
62-
packages = ["pyfory", "pyfory.format", "pyfory.lib", "pyfory.meta"]
62+
packages = ["pyfory", "pyfory.format", "pyfory.lib", "pyfory.lib.mmh3", "pyfory.meta"]
6363
include-package-data = true
6464
zip-safe = false
6565

0 commit comments

Comments
 (0)