Skip to content

Commit

Permalink
WARNING: This commit restructures the source tree. Support both PyPy …
Browse files Browse the repository at this point in the history
…and Cython in setup.py (#94)

* First few changes

* PyPy and Cython co-exists in setup.py. Restructured directories for pip and add 'pyboy' command line access

* Cleaned up root dir

* Improvements to tests

* Updated setup.py details for PyPi

* Ready for PyPi

* Ready for action!

* Improved coverage report and added more features to Makefile and setup.py

* Fixed issue with selecting Cython
  • Loading branch information
Baekalfen committed Dec 23, 2019
1 parent ae7af62 commit 1ddd381
Show file tree
Hide file tree
Showing 95 changed files with 190 additions and 188 deletions.
5 changes: 5 additions & 0 deletions .coveragerc
@@ -0,0 +1,5 @@
[report]
omit=
tests/*.py,
generator.py,
setup.py,
24 changes: 12 additions & 12 deletions .gitignore
Expand Up @@ -91,21 +91,21 @@ tmp.state
*.gb*.ram
*.gb*.rtc

Source/pyboy/**/*.c
Source/pyboy/**/*.h
Source/pyboy/**/*.html
Source/pyboy/**/*.so
/pyboy/**/*.c
/pyboy/**/*.h
/pyboy/**/*.html
/pyboy/**/*.so

/Source/recordings
/recordings

# Files from venv and dependencies
/Source/bin
/Source/include
/Source/lib-python
/Source/lib_pypy
/Source/pip-selfcheck.json
/Source/site-packages
/Source/share
/bin
/include
/lib-python
/lib_pypy
/pip-selfcheck.json
/site-packages
/share

/bin
/include
Expand Down
20 changes: 12 additions & 8 deletions Source/Makefile → Makefile
Expand Up @@ -10,11 +10,19 @@ else
CFLAGS='-w -DCYTHON_WITHOUT_ASSERTIONS'
endif

THREADS := 6
PY := python3
PYPY := pypy3
ROOT_DIR := $(shell git rev-parse --show-toplevel)

dist: clean build
${PY} setup.py sdist bdist_wheel
${PY} -m twine upload dist/pyboy-${version}*

codecov: clean
@echo "Finding code coverage..."
CFLAGS='-w -DCYTHON_TRACE=1' ${PY} setup.py build_ext --inplace --codecov-trace
${PY} setup.py test --codecov-trace

build:
@echo "Building..."
CFLAGS=$(CFLAGS) ${PY} setup.py build_ext --inplace
Expand All @@ -27,15 +35,11 @@ install:
CFLAGS=$(CFLAGS) ${PY} setup.py install build_ext

test: clean build
${PY} tetris_bot.py ${ROOT_DIR}/Source/ROMs/Tetris.gb --quiet
${PY} interface_example.py --quiet
${PY} -m pytest -n${THREADS} -v
${PYPY} tetris_bot.py ${ROOT_DIR}/Source/ROMs/Tetris.gb --quiet
${PYPY} interface_example.py --quiet
${PYPY} -m pytest -n${THREADS} -v
${PY} setup.py test
${PYPY} setup.py test

test_quick: clean build
${PY} -m pytest -n${THREADS} -v
${PY} setup.py test

docs: clean
pdoc --html --force pyboy
Expand Down
2 changes: 1 addition & 1 deletion README.md
@@ -1,5 +1,5 @@
<p align="center">
<img src="README/pyboy.svg" width="480">
<img src="https://github.com/Baekalfen/PyBoy/raw/master/README/pyboy.svg" width="480">
</p>

__If you have any questions, or just want to chat, [join us on Discord](https://discord.gg/Zrf2nyH).__
Expand Down
24 changes: 0 additions & 24 deletions Source/blargg.md

This file was deleted.

3 changes: 0 additions & 3 deletions Source/requirements.txt

This file was deleted.

8 changes: 0 additions & 8 deletions Source/requirements_all.txt

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions Source/pyboy/window/__init__.py → pyboy/window/__init__.py
Expand Up @@ -4,7 +4,7 @@
#

# Import sdl2 so Windows has SDL2.dll in memory
import sdl2 # NOQA:F401
import sdl2 # NOQA:F401

from .base_window import BaseWindow # NOQA:F401
from .window import getwindow # NOQA:F401
from .base_window import BaseWindow # NOQA:F401
from .window import getwindow # NOQA:F401
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 1ddd381

Please sign in to comment.