Skip to content

Commit

Permalink
Merge branch 'master' into feature/pokered
Browse files Browse the repository at this point in the history
  • Loading branch information
Baekalfen authored Jul 18, 2021
2 parents ba72073 + f678ba3 commit b1ede15
Show file tree
Hide file tree
Showing 138 changed files with 2,840 additions and 1,476 deletions.
2 changes: 1 addition & 1 deletion .deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fi
# "$PY" -m twine upload --non-interactive --repository-url https://test.pypi.org/legacy/ -u '__token__' -p $PYPI_TOKEN_TEST dist/*.whl --verbose

if [ "$PYPI_SOURCE" ]; then
# Pure source. We can only upload it once. It's randomly done from the manylinux platform
# Pure source. We can only upload it once. It's randomly done from the mac platform
"$PY" -m twine upload --non-interactive -u '__token__' -p $PYPI_TOKEN dist/*.tar.gz
# "$PY" -m twine upload --non-interactive --repository-url https://test.pypi.org/legacy/ -u '__token__' -p $PYPI_TOKEN_TEST dist/*.tar.gz

Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/test-ubuntu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: PyTest PyBoy

on:
push:
branches: [ $default-branch ]
pull_request:
branches: [ $default-branch ]
release:
types: [published]

jobs:
build:

runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# python-version: [3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v2
# with:
# python-version: ${{ matrix.python-version }}
- name: Install system dependencies
run: |
sudo apt update
sudo apt install -y libsdl2-dev build-essential python3 python3-pip python3-dev python3-setuptools
- name: Build PyBoy
run: |
make build
# - name: Install Python dependencies
# run: |
# python -m pip install --upgrade pip
# python -m pip install flake8 pytest
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run PyTest
run: |
TEST_CI=1 TEST_NO_UI=1 make test_cython
# - name: Publish package
# uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
# with:
# user: __token__
# password: ${{ secrets.PYPI_API_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ __pycache__/

# Distribution / packaging
.Python
.python-version
env/
venv/
build/
Expand Down Expand Up @@ -96,3 +97,5 @@ ci_secrets.tar

mooneye/
blargg/

pyboy/core/debug.pxi
105 changes: 72 additions & 33 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@ env:

jobs:
include:
#######################################
# Ubuntu 18.04 Bionic
- os: linux
dist: bionic
if: type != pull_request

- os: linux
dist: bionic
env: PYPY_TESTING=1 pypy_version=pypy3.6-v7.3.2-linux64

#######################################
# Manylinux build images 2010
- services: docker
env: MANYLINUX=manylinux2010_x86_64
PYTHON_VERSION=cp36-cp36m
Expand All @@ -25,47 +30,76 @@ jobs:
env: MANYLINUX=manylinux2010_x86_64
PYTHON_VERSION=cp37-cp37m
PYPI=1
if: type != pull_request

- services: docker
env: MANYLINUX=manylinux2010_x86_64
PYTHON_VERSION=cp38-cp38
PYPI=1
if: type != pull_request

- services: docker
env: MANYLINUX=manylinux2010_x86_64
PYTHON_VERSION=cp39-cp39
PYPI=1

#######################################
# Manylinux build images 2014
# - services: docker
# env: MANYLINUX=manylinux2014_x86_64
# PYTHON_VERSION=cp36-cp36m
# PYPI=1
# - services: docker
# env: MANYLINUX=manylinux2014_x86_64
# PYTHON_VERSION=cp37-cp37m
# PYPI=1
# - services: docker
# env: MANYLINUX=manylinux2014_x86_64
# PYTHON_VERSION=cp38-cp38
# PYPI=1

#######################################
# macOS
- os: osx
osx_image: xcode11.3
env: PYTHON_VERSION=3.6.10
PYPI=1
PYPI_SOURCE=1

if: type != pull_request
- os: osx
osx_image: xcode11.3
env: PYTHON_VERSION=3.7.7
PYPI=1
PYPI_SOURCE=1
if: type != pull_request

- os: osx
osx_image: xcode11.3
env: PYTHON_VERSION=3.8.2
PYPI=1
if: type != pull_request
- os: osx
osx_image: xcode11.3
env: PYTHON_VERSION=3.9.1
PYPI=1
if: type != pull_request

- os: osx
osx_image: xcode11.3
env: PYPY_TESTING=1
if: type != pull_request

#######################################
# Windows msys
- os: windows
env: MSYS=1
if: type != pull_request

#######################################
# Windows x64
- os: windows
env: PYPI=1
PYTHON_VERSION=3.6.8
PYTHON_ARCH=-amd64
PYTHON_PATH=36
SDL2_ARCH=x64

if: type != pull_request
- os: windows
env: PYPI=1
PYTHON_VERSION=3.7.6
Expand All @@ -74,13 +108,24 @@ jobs:
SDL2_ARCH=x64
if: type != pull_request
# TODO: SciPy: No lapack/blas resources found.
# - os: windows
# env: PYPI=1
# PYTHON_VERSION=3.8.2
# PYTHON_ARCH=-amd64
# PYTHON_PATH=38
# SDL2_ARCH=x64
# if: type != pull_request
- os: windows
env: PYPI=1
PYTHON_VERSION=3.8.2
PYTHON_ARCH=-amd64
PYTHON_PATH=38
SDL2_ARCH=x64
if: type != pull_request
- os: windows
env: PYPI=1
PYTHON_VERSION=3.9.1
PYTHON_ARCH=-amd64
PYTHON_PATH=39
SDL2_ARCH=x64
if: type != pull_request


#######################################
# Windows x86
- os: windows
env: PYPI=1
PYTHON_VERSION=3.6.8
Expand All @@ -97,26 +142,20 @@ jobs:
SDL2_ARCH=x86
if: type != pull_request
# TODO: SciPy: No lapack/blas resources found.
# - os: windows
# env: PYPI=1
# PYTHON_VERSION=3.8.2
# PYTHON_ARCH=
# PYTHON_PATH=38
# SDL2_ARCH=x86
# if: type != pull_request

# - services: docker
# env: MANYLINUX=manylinux2014_x86_64
# PYTHON_VERSION=cp36-cp36m
# PYPI=1
# - services: docker
# env: MANYLINUX=manylinux2014_x86_64
# PYTHON_VERSION=cp37-cp37m
# PYPI=1
# - services: docker
# env: MANYLINUX=manylinux2014_x86_64
# PYTHON_VERSION=cp38-cp38
# PYPI=1
- os: windows
env: PYPI=1
PYTHON_VERSION=3.8.2
PYTHON_ARCH=
PYTHON_PATH=38
SDL2_ARCH=x86
if: type != pull_request
- os: windows
env: PYPI=1
PYTHON_VERSION=3.9.1
PYTHON_ARCH=
PYTHON_PATH=39
SDL2_ARCH=x86
if: type != pull_request

before_install:
- |-
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ install: build
uninstall:
${PY} -m pip uninstall pyboy

test: export DEBUG=1
test: clean build test_cython test_pypy

test_cython:
Expand All @@ -82,6 +83,6 @@ docs: clean
rm -rf html

repackage_secrets:
tar cvf ci_secrets.tar $(shell ${PY} -c "import codecs, sys; print(codecs.encode('EBZf', 'rot13'), end='')")
tar cvf ci_secrets.tar $(shell ${PY} -c "import codecs; print(codecs.encode('EBZf', 'rot13'), end='')")
travis encrypt-file ci_secrets.tar --pro
rm ci_secrets.tar
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ __If you are looking to make a bot or AI__, you can find all the external compon
<p align="center">
<img src="https://github.com/Baekalfen/PyBoy/raw/master/README/1.gif" width="320">
<img src="https://github.com/Baekalfen/PyBoy/raw/master/README/2.gif" width="320"><br>
<img src="https://github.com/Baekalfen/PyBoy/raw/master/README/3.gif" width="320">
<img src="https://github.com/Baekalfen/PyBoy/raw/master/README/5.gif" width="320">
<img src="https://github.com/Baekalfen/PyBoy/raw/master/README/4.gif" width="320">
</p>

Expand All @@ -37,6 +37,18 @@ while not pyboy.tick():
pass
```

When the emulator is running, you can easily access [PyBoy's API](https://baekalfen.github.io/PyBoy/index.html):
```python
from pyboy import WindowEvent

pyboy.send_input(WindowEvent.PRESS_ARROW_DOWN)
pyboy.tick() # Process one frame to let the game register the input
pyboy.send_input(WindowEvent.RELEASE_ARROW_DOWN)

pil_image = pyboy.screen_image()
pil_image.save('screenshot.png')
```

If you need more details, or if you need to compile from source, check out the detailed [installation instructions](https://github.com/Baekalfen/PyBoy/wiki/Installation). We support: macOS, Raspberry Pi (Raspbian), Linux (Ubuntu), and Windows 10.

At the Wiki page, you will also find out how to interface with PyBoy from your own project: [Wiki](https://github.com/Baekalfen/PyBoy/wiki).
Expand Down Expand Up @@ -64,6 +76,7 @@ Student Projects

* __Rewind Time:__ Jacob Olsen - [JacobO1](https://github.com/JacobO1)
* __Link Cable:__ Jonas Flach-Jensen - [thejomas](https://github.com/thejomas)
* __Game Boy Color:__ Christian Marslev and Jonas Grønborg - [CKuke](https://github.com/CKuke) and [kaff3](https://github.com/kaff3)

Contribute
==========
Expand All @@ -76,4 +89,3 @@ For the more major features, there are the following that you can give a try. Th
* _(Experimental)_ Game Wrappers - make wrappers for popular games

If you want to implement something which is not on the list, feel free to do so anyway. If you want to merge it into our repo, then just send a pull request and we will have a look at it.

Binary file modified README/1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified README/2.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed README/3.gif
Binary file not shown.
Binary file modified README/4.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified README/5.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit b1ede15

Please sign in to comment.