-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from py3minepi/pytest
Introduce Pytest, Tox, Coverage
- Loading branch information
Showing
15 changed files
with
151 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[run] | ||
source = | ||
minecraft | ||
|
||
[report] | ||
exclude_lines = | ||
# Don't complain about missing debug-only code: | ||
def __repr__ | ||
if self\.debug | ||
|
||
# Don't complain if tests don't hit defensive assertion code: | ||
raise AssertionError | ||
raise NotImplementedError | ||
|
||
# Don't complain if non-runnable code isn't run: | ||
if 0: | ||
if __name__ == .__main__.: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
*.pyc | ||
*.swp | ||
.idea/ | ||
.cache/ | ||
.tox/ | ||
*.egg-info/ | ||
.coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
language: erlang | ||
|
||
env: | ||
- ARCH=arm | ||
|
||
- ARCH=arm TOXENV=py27 | ||
- ARCH=arm TOXENV=py32 | ||
- ARCH=arm TOXENV=cov | ||
matrix: | ||
allow_failures: | ||
- env: ARCH=arm TOXENV=cov | ||
script: | ||
- "bash -ex .travis-ci.sh" | ||
|
||
- bash -ex .travis-ci.sh |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
include README.rst AUTHORS.txt LICENSE.txt | ||
recursive-exclude * *.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
README | ||
====== | ||
|
||
.. image:: https://secure.travis-ci.org/py3minepi/py3minepi.png?branch=master | ||
:alt: Build status | ||
:target: https://travis-ci.org/py3minepi/py3minepi | ||
|
||
.. image:: https://coveralls.io/repos/py3minepi/py3minepi/badge.png?branch=master | ||
:alt: Coverage | ||
:target: https://coveralls.io/r/py3minepi/py3minepi | ||
|
||
|
||
`Minecraft: Pi Edition <http://pi.minecraft.net/>`__ is awesome. | ||
|
||
However it uses Python 2. We're moving it to Python 3 (without any official | ||
approval) and offering it for download here. | ||
|
||
We hope this makes people's lives easier. | ||
|
||
Goals | ||
----- | ||
|
||
- [x] Python 3 | ||
- [ ] TESTS (pytest, tox, flake8, coverage) | ||
- [ ] More intuitive API focusing on getting some mining done and hiding implementation details | ||
- [ ] Backwards compatibility with the existing codebase (with `__init__` foo) so existing scripts will continue to work | ||
- [ ] Connection backends (socket, in memory for testing) | ||
- [ ] Clever socket usage so disconnects can be dealt with | ||
- [ ] Make the code base more readable and thus maintainable | ||
- [ ] A CI test suite running an rPi emulator (with Travis) | ||
- [ ] Improve code documentation both in the code base and with a RTD page | ||
- [ ] Find missing functions that are in the java API but not described in the python API | ||
|
||
Links | ||
----- | ||
|
||
- `Raspberry Pi <http://www.raspberrypi.org/>`_ | ||
- `Minecraft Pi <http://pi.minecraft.net/>`_ | ||
- `Minecraft Pi Usage page <http://www.raspberrypi.org/documentation/usage/minecraft/>`_ | ||
- `Original API reference <http://www.stuffaboutcode.com/p/minecraft-api-reference.html>`_ | ||
- `Martin O'Hanlon GitHub <https://github.com/martinohanlon>`_ (useful test projects) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,5 +109,3 @@ class blockType(Enum): | |
FENCE_GATE = 107 | ||
GLOWING_OBSIDIAN = 246 | ||
NETHER_REACTOR_CORE = 247 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[pytest] | ||
addopts = --tb=short --doctest-glob='*.rst' --pep8 | ||
python_files = test_*.py | ||
norecursedirs = .* VIRTUAL build docs | ||
pep8ignore = | ||
*.py E126 E127 E128 | ||
setup.py ALL | ||
*/tests/* ALL | ||
*/docs/* ALL | ||
pep8maxlinelength = 99 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env python | ||
import io | ||
from setuptools import setup, find_packages | ||
|
||
with io.open('README.rst', mode='r', encoding='utf8') as f: | ||
readme = f.read() | ||
|
||
setup(name='py3minepi', | ||
version='0.0.1', | ||
description='A better minecraft pi library.', | ||
url='https://github.com/py3minepi/py3minepi', | ||
packages=find_packages(exclude=['*.tests', '*.tests.*', 'tests.*', 'tests']), | ||
zip_safe=True, | ||
include_package_data=True, | ||
keywords='minecraft raspberry pi mcpi py3minepi', | ||
long_description=readme, | ||
classifiers=[ | ||
'Development Status :: Development Status :: 3 - Alpha', | ||
'Environment :: X11 Applications', | ||
'Intended Audience :: Education', | ||
'Intended Audience :: Developers', | ||
'License :: OSI Approved :: Other/Proprietary License', # TODO fix | ||
'Operating System :: POSIX', | ||
'Operating System :: POSIX :: Linux', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.2', | ||
'Programming Language :: Python :: 3.3', | ||
'Programming Language :: Python :: 3.4', | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
############ Base configuration ############ | ||
[tox] | ||
envlist = | ||
py27,py32,py33,py34,cov | ||
|
||
[testenv] | ||
deps = | ||
pytest | ||
pytest-pep8 | ||
commands = | ||
pip install -e . | ||
py.test | ||
|
||
############ Special Cases ############ | ||
|
||
[testenv:cov] | ||
basepython=python3.2 | ||
deps = | ||
{[testenv]deps} | ||
coverage | ||
coveralls | ||
commands = | ||
pip install -e . | ||
coverage run --source minecraft -m py.test | ||
coverage report | ||
coveralls |