Skip to content

Commit

Permalink
Use python build package to perform bdist and kivy-examples builds to…
Browse files Browse the repository at this point in the history
… keep build isolation
  • Loading branch information
misl6 committed Apr 20, 2024
1 parent e910b6e commit 6176f45
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 68 deletions.
3 changes: 1 addition & 2 deletions .ci/Dockerfile.armv7l
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ RUN [ "cross-build-start" ]
RUN /bin/bash -c 'source .ci/ubuntu_ci.sh && \
export PIP_EXTRA_INDEX_URL="https://www.piwheels.org/simple" && \
install_ubuntu_build_deps && \
DEBIAN_FRONTEND=noninteractive apt-get -y install xorg wget libxrender-dev lsb-release libraspberrypi-dev raspberrypi-kernel-headers && \
install_kivy_test_run_pip_deps'
DEBIAN_FRONTEND=noninteractive apt-get -y install xorg wget libxrender-dev lsb-release libraspberrypi-dev raspberrypi-kernel-headers'

# If we're on Debian buster, we need to install cmake from backports as the cmake version
# in buster is too old to build sdl2
Expand Down
26 changes: 4 additions & 22 deletions .ci/ubuntu_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,8 @@ update_version_metadata() {
}

generate_sdist() {
python3 -m pip install cython packaging setuptools
python3 setup.py sdist --formats=gztar
python3 -m pip uninstall cython -y
}


install_kivy_test_run_pip_deps() {
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py --user

python3 -m pip install --upgrade pip setuptools wheel
CYTHON_INSTALL=$(
KIVY_NO_CONSOLELOG=1 python3 -c \
"from kivy.tools.packaging.cython_cfg import get_cython_versions; print(get_cython_versions()[0])" \
--config "kivy:log_level:error"
)
python3 -m pip install -I "$CYTHON_INSTALL" coveralls
}

install_kivy_test_wheel_run_pip_deps() {
python3 -m pip install --upgrade pip setuptools wheel
python3 -m pip install build~=1.2.1
python3 -m build --sdist .
}

prepare_env_for_unittest() {
Expand All @@ -53,7 +34,8 @@ install_kivy() {


create_kivy_examples_wheel() {
KIVY_BUILD_EXAMPLES=1 python3 -m pip wheel . -w dist/
python3 -m pip install build~=1.2.1
KIVY_BUILD_EXAMPLES=1 python3 -m build --wheel .
}

install_kivy_examples_wheel() {
Expand Down
20 changes: 4 additions & 16 deletions .ci/windows_ci.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ function Update-version-metadata {
}

function Generate-sdist {
python -m pip install cython packaging
python setup.py sdist --formats=gztar
python setup.py bdist_wheel --build_examples --universal
python -m pip uninstall cython -y
python -m pip install -U build
python -m build --sdist .
$env:KIVY_BUILD_EXAMPLES = '1'
python -m build --wheel .
}

function Generate-windows-wheels {
Expand Down Expand Up @@ -77,14 +77,6 @@ function Upload-windows-wheels-to-server($ip) {
C:\tools\msys64\usr\bin\bash --login -c ".ci/windows-server-upload.sh $ip dist 'Kivy*' ci/win/kivy/"
}

function Install-kivy-test-run-win-deps {

}

function Install-kivy-test-run-pip-deps {
python -m pip install pip wheel setuptools --upgrade
}

function Install-kivy {
python -m pip install -e .[dev,full]
}
Expand All @@ -95,8 +87,6 @@ function Install-kivy-wheel {
ls $root/dist
cd "$HOME"

python -m pip install pip wheel setuptools --upgrade

$version=python -c "import sys; print('{}{}'.format(sys.version_info.major, sys.version_info.minor))"
$bitness=python -c "import sys; print('win_amd64' if sys.maxsize > 2**32 else 'win32')"
$kivy_fname=(ls $root/dist/Kivy-*$version*$bitness*.whl | Sort-Object -property @{Expression={$_.name.tostring().Length}} | Select-Object -First 1).name
Expand All @@ -109,8 +99,6 @@ function Install-kivy-sdist {
$root=(pwd).Path
cd "$HOME"

python -m pip install pip wheel setuptools --upgrade

$kivy_fname=(ls $root/dist/Kivy-*.tar.gz).name
python -m pip install "$root/dist/$kivy_fname[full,dev]"
}
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/manylinux_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install dependencies
run: |
source .ci/ubuntu_ci.sh
install_kivy_test_wheel_run_pip_deps
- name: Create wheel
run: |
source .ci/ubuntu_ci.sh
Expand Down Expand Up @@ -200,7 +196,6 @@ jobs:
source .ci/ubuntu_ci.sh
install_ubuntu_build_deps
./tools/build_linux_dependencies.sh
install_kivy_test_wheel_run_pip_deps
- name: Setup env
run: |
source .ci/ubuntu_ci.sh
Expand Down
10 changes: 0 additions & 10 deletions .github/workflows/osx_wheels_app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install dependencies
run: |
source .ci/ubuntu_ci.sh
install_kivy_test_wheel_run_pip_deps dev
- name: Create wheel
run: |
source .ci/ubuntu_ci.sh
Expand Down Expand Up @@ -155,10 +151,6 @@ jobs:
with:
name: osx_wheels
path: dist
- name: Install test dependencies
run: |
source .ci/ubuntu_ci.sh
install_kivy_test_wheel_run_pip_deps dev
- name: Install Kivy wheel
run: |
source .ci/ubuntu_ci.sh
Expand Down Expand Up @@ -204,7 +196,6 @@ jobs:
source .ci/ubuntu_ci.sh
source .ci/osx_ci.sh
install_platypus
install_kivy_test_run_pip_deps dev
- name: Make app bundle
run: |
source .ci/osx_ci.sh
Expand Down Expand Up @@ -265,7 +256,6 @@ jobs:
source .ci/osx_ci.sh
source .ci/ubuntu_ci.sh
activate_osx_app_venv
install_kivy_test_wheel_run_pip_deps dev
install_kivy_examples_wheel dev
- name: Test Kivy app
run: |
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/test_osx_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ jobs:
run: |
source .ci/ubuntu_ci.sh
./tools/build_macos_dependencies.sh
install_kivy_test_run_pip_deps
- name: Install Kivy
run: |
source .ci/ubuntu_ci.sh
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/test_ubuntu_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ jobs:
source .ci/ubuntu_ci.sh
install_ubuntu_build_deps
./tools/build_linux_dependencies.sh
install_kivy_test_run_pip_deps
- name: Setup env
run: |
source .ci/ubuntu_ci.sh
Expand Down Expand Up @@ -78,7 +77,6 @@ jobs:
source .ci/ubuntu_ci.sh
install_ubuntu_build_deps
./tools/build_linux_dependencies.sh
install_kivy_test_run_pip_deps
- name: Setup env
run: |
source .ci/ubuntu_ci.sh
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/test_windows_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ jobs:
with:
python-version: ${{ matrix.python }}
architecture: ${{ matrix.arch }}
- name: Install dependencies
run: |
. .\.ci\windows_ci.ps1
Install-kivy-test-run-win-deps
Install-kivy-test-run-pip-deps
- name: Install Kivy
run: |
. .\.ci\windows_ci.ps1
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/windows_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ jobs:
run: |
. .\.ci\windows_ci.ps1
Update-version-metadata
- name: Install dependencies
run: |
. .\.ci\windows_ci.ps1
Install-kivy-test-run-win-deps
Install-kivy-test-run-pip-deps
- name: Generate sdist/kivy-examples
if: matrix.arch == 'x64' && matrix.python == '3.8'
# only windows kivy-examples is uploaded
Expand Down

0 comments on commit 6176f45

Please sign in to comment.