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 Nov 3, 2024
1 parent 06866f4 commit a44143c
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 88 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/build-sdl3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,7 @@ jobs:
sudo cmake --install . --config Release
- name: Build with SDL3
run: >
python3 -m pip install . -v -Csetup-args=-Dsdl_api=3
-Csetup-args=-Dimage=disabled
-Csetup-args=-Dmixer=disabled
-Csetup-args=-Dfont=disabled
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 a44143c

Please sign in to comment.