Skip to content

Commit

Permalink
GG-33: Make event handlers abstract interfaces (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
terrysimons authored Mar 17, 2024
1 parent 8564a4f commit 0281278
Show file tree
Hide file tree
Showing 70 changed files with 6,878 additions and 3,150 deletions.
87 changes: 56 additions & 31 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,20 @@
version: 2.1

# TODO: Turn hard coded version strings into variables

# parameters:
# action:
# type: enum
# enum: [build, report]
# default: build
parameters:
PYTHON_LATEST_VERSION:
type: string
default: "3.12.2"

orbs:
win: circleci/windows@5.0
macos: circleci/macos@2.3.6
jira: circleci/jira@1.3.1
macos: circleci/macos@2.4.1
jira: circleci/jira@2.1.0

# Define a job to be invoked later in a workflow.
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
Expand All @@ -17,7 +25,7 @@ jobs:
# Specify the execution environment. You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub.
# See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor
docker:
- image: cimg/python:3.11.5
- image: cimg/python:3.12.1
# Add steps to the job
# See: https://circleci.com/docs/2.0/configuration-reference/#steps

Expand All @@ -39,20 +47,23 @@ jobs:
curl -sSL https://install.python-poetry.org | POETRY_HOME=${HOME}/.poetry python3 -
echo 'PATH="$HOME/.poetry/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
cd /home/circleci/.pyenv/plugins/python-build/../.. && git pull && cd -
echo "Path: $PATH"
echo "Pyenv: "
echo $(which pyenv)
echo "Building Python 3.11.5, 3.10.13, 3.9.18"
echo "Building Python ${PYTHON_LATEST_VERSION}"
# PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install -f 3.11.5 3.10.13 3.9.18
# pyenv global 3.11.5 3.11.5 3.10.13 3.9.18
PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install -f 3.11.5
pyenv global 3.11.5 3.11.5
pyenv update
PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install -f << pipeline.parameters.PYTHON_LATEST_VERSION >>
pyenv global << pipeline.parameters.PYTHON_LATEST_VERSION >> << pipeline.parameters.PYTHON_LATEST_VERSION >>
python --version
pyenv versions
pip install nox nox-poetry ruff
pip install -e .
pip install "mkdocs" "mkdocstrings" "mkdocs-material" "mkdocs-gen-files" "mkdocs-literate-nav" "mkdocs-section-index" "pymdown-extensions" "mkdocs-autorefs" "mkdocs-macros-plugin" "mkdocstrings-python"
pip install "nox" "nox-poetry" "pytest" "ruff" "pre-commit" "poetry-plugin-export" "pyright"
cd ~/project
nox
Expand All @@ -69,25 +80,37 @@ jobs:
- run:
name: "Build and Test macOS"
command: |
rm -rf ~/.pyenv
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
# rm -rf ~/.pyenv
# git clone https://github.com/pyenv/pyenv.git ~/.pyenv
# echo 'PATH="$HOME/.poetry/bin:$PATH"' >> ~/.bashrc
# cd ~/.pyenv && src/configure && make -C src
# echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
# echo 'PATH="$HOME/.pyenv/shims:$HOME/.pyenv/bin:$PATH"' >> ~/.bashrc
# echo 'eval "$(pyenv init -)"' >> ~/.bashrc
# echo 'POETRY_HOME="$HOME/.poetry"' >> ~/.bashrc
# source ~/.bashrc
curl -sSL https://install.python-poetry.org | POETRY_HOME=${HOME}/.poetry python3 -
echo 'PATH="$HOME/.poetry/bin:$PATH"' >> ~/.bashrc
cd ~/.pyenv && src/configure && make -C src
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'PATH="$HOME/.pyenv/shims:$HOME/.pyenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
echo 'POETRY_HOME="$HOME/.poetry"' >> ~/.bashrc
source ~/.bashrc
# PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install -f 3.11.5 3.10.13 3.9.18 && pyenv global 3.11.5 3.11.5 3.10.13 3.9.18
PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install -f 3.11.5
# pyenv global 3.11.5 3.11.5 3.10.13 3.9.18
pyenv global 3.11.5 3.11.5
cd /home/circleci/.pyenv/plugins/python-build/../.. && git pull && cd -
echo "Path: $PATH"
echo "Pyenv: "
echo $(which pyenv)
echo "Building Python ${PYTHON_LATEST_VERSION}"
# pyenv update
brew update && brew upgrade pyenv
PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install -f << pipeline.parameters.PYTHON_LATEST_VERSION >>
pyenv global << pipeline.parameters.PYTHON_LATEST_VERSION >> << pipeline.parameters.PYTHON_LATEST_VERSION >>
python --version
pyenv versions
curl -sSL https://install.python-poetry.org | POETRY_HOME=${HOME}/.poetry python3 -
# curl -sSL https://install.python-poetry.org | POETRY_HOME=${HOME}/.poetry python3 -
pip install nox nox-poetry ruff
pip install -e .
pip install "mkdocs" "mkdocstrings" "mkdocs-material" "mkdocs-gen-files" "mkdocs-literate-nav" "mkdocs-section-index" "pymdown-extensions" "mkdocs-autorefs" "mkdocs-macros-plugin" "mkdocstrings-python"
pip install "nox" "nox-poetry" "pytest" "ruff" "pre-commit" "poetry-plugin-export" "pyright"
cd ~/project
nox
Expand All @@ -109,18 +132,20 @@ jobs:
command: |
# choco install -y python3 --version=3.11.5 --allow-multiple-versions
# choco install -y python3 --version=3.10.13 --allow-multiple-versions
# choco install -y python3 --version=3.9.18 --allow-multiple-versions
choco install pyenv-win --force -y
choco install -y python312
# choco install pyenv-win --force -y
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
refreshenv
# pyenv install -f 3.11.5 3.10.13 3.9.18
pyenv install -f 3.11.5
pyenv global 3.11.5 3.11.5
pyenv versions
# (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -
# pyenv update
# pyenv install -f << pipeline.parameters.PYTHON_LATEST_VERSION >>
# pyenv global << pipeline.parameters.PYTHON_LATEST_VERSION >> << pipeline.parameters.PYTHON_LATEST_VERSION >>
# pyenv versions
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -
set PATH=%PATH%;%USERPROFILE%\AppData\Roaming\pypoetry\venv\Scripts
refreshenv
pip install nox nox-poetry poetry ruff
pip install -e .
pip install "mkdocs" "mkdocstrings" "mkdocs-material" "mkdocs-gen-files" "mkdocs-literate-nav" "mkdocs-section-index" "pymdown-extensions" "mkdocs-autorefs" "mkdocs-macros-plugin" "mkdocstrings-python"
pip install "nox" "nox-poetry" "pytest" "ruff" "pre-commit" "poetry-plugin-export" "pyright"
nox
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,4 @@ cython_debug/

# macOS .DS_Store files
.DS_Store
site/
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,15 @@ repos:
types: [python]
# stages: [pre-commit, push]
pass_filenames: false

# We don't need to do this seperately, because nox will run the tests
# - repo: local
# hooks:
# - id: mkdocs
# name: mkdocs
# files: ^.*\.py$
# language: python
# entry: mkdocs build --strict
# types: [python]
# # stages: [pre-commit, push]
# pass_filenames: false
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
5 changes: 5 additions & 0 deletions docs/glitchygames/api/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
::: glitchygames.api
options:
heading_level: 2
inherited_members: true
show_submodules: true
5 changes: 5 additions & 0 deletions docs/glitchygames/color/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
::: glitchygames.color
options:
heading_level: 2
inherited_members: true
show_submodules: true
6 changes: 6 additions & 0 deletions docs/glitchygames/engine/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## ::: glitchygames.engine
options:
heading_level: 2
inherited_members: true
show_submodules: true
members: yes
60 changes: 60 additions & 0 deletions docs/glitchygames/events/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
## ::: glitchygames.events
options:
heading_level: 2
inherited_members: true
show_submodules: true
::: glitchygames.events.audio
options:
heading_level: 2
inherited_members: false
show_submodules: false




<!-- ::: glitchygames.events.audio.AudioManager
options:
allow_inspection: no
show_bases: no
show_source: no
show_root_heading: no
preload_modules: no
allow_inspection: no
show_bases: no
heading_level: 2
show_root_heading: no
show_root_toc_entry: no
show_root_full_path: no
show_root_members_full_path: no
show_object_full_path: no
show_category_heading: no
show_symbol_type_heading: no
show_symbol_type_toc: no
inherited_members: no
members: no
members_order: source
group_by_category: yes
show_submodules: no
summary: no
docstring_style: "google"
docstring_section_style: table
show_if_no_docstring: no
show_docstring_attributes: no
show_docstring_functions: no
show_docstring_classes: no
show_docstring_modules: no
show_docstring_description: no
show_docstring_examples: no
show_docstring_other_parameters: no
show_docstring_parameters: no
show_docstring_raises: no
show_docstring_receives: no
show_docstring_returns: no
show_docstring_yields: no
annotations_path: brief
line_length: 100
show_signature: no
show_signature_annotations: no
signature_crossrefs: no
separate_signature: no
unwrap_annotated: no -->
5 changes: 5 additions & 0 deletions docs/glitchygames/examples/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## ::: glitchygames.engine
options:
heading_level: 2
inherited_members: true
show_submodules: true
5 changes: 5 additions & 0 deletions docs/glitchygames/fonts/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## ::: glitchygames.engine
options:
heading_level: 2
inherited_members: true
show_submodules: true
5 changes: 5 additions & 0 deletions docs/glitchygames/game_objects/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## ::: glitchygames.engine
options:
heading_level: 2
inherited_members: true
show_submodules: true
Loading

0 comments on commit 0281278

Please sign in to comment.