Skip to content

Commit

Permalink
Strip Linux wheels to reduce size
Browse files Browse the repository at this point in the history
  • Loading branch information
Baekalfen committed Mar 22, 2024
1 parent 7240115 commit ef25b6b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,22 @@ jobs:
TEST_NO_UI: 1
run: |
python -m pytest tests/ -n auto -v
- name: Build and upload wheel
if: ${{ github.event_name == 'release' && github.event.action == 'published' && !github.event.release.prerelease && !contains(matrix.os, 'ubuntu') }}
- name: Build wheel
run: |
echo "Building wheel and uploading"
echo "Building wheel"
pip install wheel twine
python setup.py sdist bdist_wheel
- name: Upload wheel
if: ${{ github.event_name == 'release' && github.event.action == 'published' && !github.event.release.prerelease && !contains(matrix.os, 'ubuntu') }}
run: |
echo "Uploading wheel"
python -m twine upload --non-interactive -u '__token__' -p ${{ secrets.PYPI_API_TOKEN }} dist/*.whl
echo "Uploading source code"
python -m twine upload --non-interactive --skip-existing -u '__token__' -p ${{ secrets.PYPI_API_TOKEN }} dist/*.tar.gz
- name: Build and upload wheel [TEST]
- name: Upload wheel [TEST]
if: ${{ github.event_name == 'release' && github.event.action == 'published' && github.event.release.prerelease && !contains(matrix.os, 'ubuntu') }}
run: |
echo "Building wheel and uploading"
pip install wheel twine
python setup.py sdist bdist_wheel
echo "Uploading wheel"
python -m twine upload --repository testpypi --non-interactive -u '__token__' -p ${{ secrets.PYPI_TEST_API_TOKEN }} dist/*.whl
echo "Uploading source code"
python -m twine upload --repository testpypi --non-interactive --skip-existing -u '__token__' -p ${{ secrets.PYPI_TEST_API_TOKEN }} dist/*.tar.gz
Expand Down Expand Up @@ -167,7 +168,7 @@ jobs:
chmod 777 -R . # Fix permissions to help cleaning up outside of Docker
echo "Dists built:"
ls dist/
ls -lah dist/
- name: Set up Python 3.8 (just for PyPi upload)
uses: actions/setup-python@v3
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def initialize_options(self):
src.split(".")[0].replace(os.sep, "."),
[src],
extra_compile_args=cflags,
extra_link_args=["-s", "-w"],
include_dirs=[np.get_include()],
), list(py_pxd_files)
)
Expand Down

0 comments on commit ef25b6b

Please sign in to comment.