Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a .ci/cicd-requirements.txt file to handle CI/CD only dependencies #8716

Merged
merged 1 commit into from
May 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .ci/cicd-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cibuildwheel~=2.17.0
build~=1.2.1
coveralls~=4.0.0
twine~=5.0.0
flake8~=7.0.0
26 changes: 0 additions & 26 deletions .ci/ubuntu_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ update_version_metadata() {
fi
}

generate_sdist() {
python3 -m pip install build~=1.2.1
python3 -m build --sdist .
}

prepare_env_for_unittest() {
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background \
--exec /usr/bin/Xvfb -- :99 -screen 0 1280x720x24 -ac +extension GLX
Expand All @@ -32,12 +27,6 @@ install_kivy() {
python3 -m pip install -e "$(pwd)[$options]"
}


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

install_kivy_examples_wheel() {
options=${1:-full,dev}
root="$(pwd)"
Expand Down Expand Up @@ -91,16 +80,6 @@ EOF
KIVY_TEST_AUDIO=0 KIVY_NO_ARGS=1 python3 -m pytest --maxfail=10 --timeout=300 .
}

upload_coveralls() {
python3 -m pip install -U coveralls
python3 -m coveralls
}

validate_pep8() {
python3 -m pip install flake8
make style
}

generate_docs() {
make html
}
Expand Down Expand Up @@ -212,8 +191,3 @@ upload_file_to_server() {
echo -e "Host $ip\n\tStrictHostKeyChecking no\n" >>~/.ssh/config
rsync -avh -e "ssh -p 2458" --include="*/" --include="$file_pat" --exclude="*" "$file_path/" "root@$ip:/web/downloads/ci/$server_path"
}

upload_artifacts_to_pypi() {
python3 -m pip install twine
twine upload dist/*
}
5 changes: 0 additions & 5 deletions .ci/windows_ci.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,3 @@ function Test-kivy-installed {
echo "[run]`nplugins = kivy.tools.coverage`n" > .coveragerc
raise-only-error -Func {python -m pytest --timeout=400 .}
}

function Upload-artifacts-to-pypi {
python -m pip install twine
twine upload dist/*
}
25 changes: 17 additions & 8 deletions .github/workflows/manylinux_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install CI/CD Python requirements
run: |
python -m pip install -r .ci/cicd-requirements.txt
- name: Create wheel
run: |
source .ci/ubuntu_ci.sh
create_kivy_examples_wheel
KIVY_BUILD_EXAMPLES=1 python3 -m build --wheel .
- name: Upload kivy-examples wheel as artifact
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -57,6 +59,9 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install CI/CD Python requirements
run: |
python -m pip install -r .ci/cicd-requirements.txt
- name: Set up QEMU
if: ${{ matrix.cibw_archs == 'aarch64' }}
uses: docker/setup-qemu-action@v3
Expand All @@ -75,9 +80,9 @@ jobs:
run: |
source .ci/ubuntu_ci.sh
update_version_metadata
- name: Install cibuildwheel
- name: Install CI/CD Python requirements
run: |
python -m pip install cibuildwheel==2.17.0
python -m pip install -r .ci/cicd-requirements.txt
- name: Make wheels
run: |
python -m cibuildwheel --output-dir wheelhouse
Expand All @@ -97,6 +102,9 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install CI/CD Python requirements
run: |
python -m pip install -r .ci/cicd-requirements.txt
- uses: actions/download-artifact@v4
with:
pattern: manylinux_wheels-*
Expand Down Expand Up @@ -125,8 +133,7 @@ jobs:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.pypi_password }}
run: |
source .ci/ubuntu_ci.sh
upload_artifacts_to_pypi
twine upload dist/*

manylinux_wheel_test:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -188,10 +195,12 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install CI/CD Python requirements
run: |
python -m pip install -r .ci/cicd-requirements.txt
- name: Generate sdist
run: |
source .ci/ubuntu_ci.sh
generate_sdist
python -m build --sdist .
- name: Install dependencies
run: |
source .ci/ubuntu_ci.sh
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/osx_wheels_app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install CI/CD Python requirements
run: |
python -m pip install -r .ci/cicd-requirements.txt
- name: Create wheel
run: |
source .ci/ubuntu_ci.sh
create_kivy_examples_wheel
KIVY_BUILD_EXAMPLES=1 python3 -m build --wheel .
- name: Upload kivy-examples wheel as artifact
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -70,9 +72,9 @@ jobs:
- name: Build universal Kivy dependencies
run: |
./tools/build_macos_dependencies.sh
- name: Install cibuildwheel
- name: Install CI/CD Python requirements
run: |
python -m pip install cibuildwheel==2.17.0
python -m pip install -r .ci/cicd-requirements.txt
- name: Build wheels
run: |
export KIVY_DEPS_ROOT=$(pwd)/kivy-dependencies
Expand All @@ -95,6 +97,9 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install CI/CD Python requirements
run: |
python -m pip install -r .ci/cicd-requirements.txt
- uses: actions/download-artifact@v4
with:
name: osx_wheels
Expand Down Expand Up @@ -122,8 +127,7 @@ jobs:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.pypi_password }}
run: |
source .ci/ubuntu_ci.sh
upload_artifacts_to_pypi
twine upload dist/*

osx_wheel_test:
name: "osx_wheel_test (${{ matrix.runs_on }}, ${{ matrix.python }})"
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/test_ubuntu_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install CI/CD Python requirements
run: |
python -m pip install -r .ci/cicd-requirements.txt
- name: Validate PEP8
run: |
source .ci/ubuntu_ci.sh
validate_pep8
make style

unit_test:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -52,8 +54,7 @@ jobs:
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
source .ci/ubuntu_ci.sh
upload_coveralls
python -m coveralls
- name: Test Kivy benchmarks
run: |
source .ci/ubuntu_ci.sh
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/windows_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: 3.x
- run: |
python -m pip install -r .ci/cicd-requirements.txt
- uses: actions/download-artifact@v4
with:
pattern: windows_wheels-*-*
Expand Down Expand Up @@ -95,8 +97,7 @@ jobs:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.pypi_password }}
run: |
. .\.ci\windows_ci.ps1
Upload-artifacts-to-pypi
twine upload dist/*

windows_wheel_test:
runs-on: windows-latest
Expand Down