Skip to content

Commit

Permalink
Update CI, setup.py and docs to use dev.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ankith26 committed Oct 23, 2024
1 parent c4aeac7 commit 1e2aa89
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 101 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/build-debian-multiarch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,11 @@ jobs:
install: ${{ env.INSTALL_CMD }}

# Build a wheel, install it for running unit tests.
# --no-build-isolation is passed so that preinstalled meson-python can be used
# (done for optimization reasons)
# pip does not know that ninja is installed, and tries to install it again.
# so pass --ignore-dep ninja explicitly
run: |
echo "\nBuilding pygame wheel\n"
pip3 wheel . --no-build-isolation --wheel-dir /artifacts -vvv
echo "\nInstalling wheel\n"
pip3 install --no-index --pre --break-system-packages --find-links /artifacts pygame-ce
echo "\nBuilding and installing pygame wheel\n"
PIP_BREAK_SYSTEM_PACKAGES=1 python3 dev.py --ignore-dep ninja build --wheel /artifacts --lax
echo "\nRunning tests\n"
export SDL_VIDEODRIVER=dummy
export SDL_AUDIODRIVER=disk
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/build-on-msys2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,10 @@ jobs:
# mingw-w64-${{ matrix.env }}-freetype
# mingw-w64-${{ matrix.env }}-portmidi

- name: Building pygame wheel
run: |
pip3 wheel . --wheel-dir /artifacts -vvv --no-build-isolation
- name: Installing wheel
run: pip3 install --no-index --pre --find-links /artifacts pygame-ce
# pip does not know that ninja is installed, and tries to install it again.
# so pass --ignore-dep ninja explicitly
- name: Build and install pygame wheel
run: python3 dev.py --ignore-dep ninja build --wheel /artifacts --lax

- name: Run tests
env:
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/build-sdl3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,8 @@ jobs:
cmake --build . --config Release --parallel
sudo cmake --install . --config Release
- name: Make sdist and install it
run: >
python3 -m pip install . -v -Csetup-args=-Dsdl_api=3
-Csetup-args=-Dimage=disabled
-Csetup-args=-Dmixer=disabled
-Csetup-args=-Dfont=disabled
- name: Build with SDL3
run: python3 dev.py build --sdl3

# - name: Run tests
# env:
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/build-ubuntu-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,17 @@ jobs:
- uses: actions/[email protected]

- name: Install deps
# install numpy from pip and not apt because the one from pip is newer,
# and has typestubs
# https://github.com/actions/runner-images/issues/7192
# https://github.com/orgs/community/discussions/47863
run: |
sudo apt-get update --fix-missing
sudo apt-get install lcov -y
sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libfreetype6-dev libportmidi-dev python3-dev -y
pip3 install --upgrade pip
pip3 install meson-python ninja cython "sphinx<=7.2.6" # because we are doing --no-build-isolation
pip3 install numpy>=1.21.0
- name: Build with coverage hooks and install
id: build
run: |
pip3 install -e . --no-build-isolation -Cbuild-dir=./.mesonpy-rel -Csetup-args=-Dcoverage=true
python3 dev.py build --coverage
- name: Run tests
env:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/build-ubuntu-sdist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
strategy:
fail-fast: false # if a particular matrix build fails, don't skip the rest
matrix:
os: [ubuntu-24.04, ubuntu-22.04]
os: [ubuntu-22.04]

env:
# Pip now forces us to either make a venv or set this flag, so we will do
Expand Down Expand Up @@ -89,7 +89,6 @@ jobs:
# We upload the generated files under github actions assets
- name: Upload sdist
if: matrix.os == 'ubuntu-24.04' # upload sdist only once
uses: actions/upload-artifact@v4
with:
name: pygame-wheels-sdist
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/dev-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: python3 dev.py all

# Run CI on changes to main branch, or any PR to main. Do not run CI on
# any other branch.
# Run on changes to all files.
on:
push:
branches: main

pull_request:
branches: main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-dev-check
cancel-in-progress: true

jobs:
dev-check:
runs-on: ubuntu-24.04

env:
# Pip now forces us to either make a venv or set this flag, so we will do
# this
PIP_BREAK_SYSTEM_PACKAGES: 1

# We are using dependencies installed from apt
PG_DEPS_FROM_SYSTEM: 1

# environment variables to set while testing
SDL_VIDEODRIVER: "dummy"
SDL_AUDIODRIVER: "disk"

steps:
- uses: actions/[email protected]

- name: Install deps
run: |
sudo apt-get update --fix-missing
sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libfreetype6-dev libportmidi-dev python3-dev
- name: Check dev.py all
run: python3 dev.py all
65 changes: 0 additions & 65 deletions .github/workflows/format-lint.yml

This file was deleted.

5 changes: 2 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ but the documentation can also be launched with `python -m pygame.docs`

Steps:

- Install Sphinx (`pip install Sphinx`)
- Fork the pygame-ce repository, download and navigate to it in the terminal
- Run `python -m buildconfig docs`
- Run `python dev.py docs`
- If you are using the legacy `python setup.py docs` (which is now deprecated):
- (Run `python -m pip install -U pip setuptools` first if `ModuleNotFoundError: No module named setuptools` occurs)

Expand All @@ -30,7 +29,7 @@ is useful when editing the theme CSS.


--- **INSTEAD USE** ---
There is also `python -m buildconfig docs full_generation` for regenerating
There is also `python dev.py docs --full` for regenerating
everything regardless of whether Sphinx thinks it should be regenerated. This
is useful when editing the theme CSS.

Expand Down
10 changes: 3 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -807,11 +807,9 @@ def run(self):
runs Sphinx to build the docs.
'''
import subprocess
command_line = [
sys.executable, "-m", "buildconfig", "docs"
]
command_line = [sys.executable, "dev.py", "docs"]
if self.fullgeneration:
command_line.append('full_generation')
command_line.append('--full')

print("WARNING: This command is deprecated and will be removed in the future.")
print(f"Please use the following replacement: `{' '.join(command_line)}`\n")
Expand All @@ -834,9 +832,7 @@ def run(self):
runs mypy to build the docs.
'''
import subprocess
command_line = [
sys.executable, os.path.join("buildconfig", "stubs", "stubcheck.py")
]
command_line = [sys.executable, "dev.py", "stubs"]
print("WARNING: This command is deprecated and will be removed in the future.")
print(f"Please use the following replacement: `{' '.join(command_line)}`\n")
result = subprocess.run(command_line)
Expand Down

0 comments on commit 1e2aa89

Please sign in to comment.