Skip to content

Commit

Permalink
Merge pull request #13 from Bernardo-MG/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Bernardo-MG authored Jan 2, 2018
2 parents 8411b91 + 0441af2 commit d6cab7c
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 33 deletions.
9 changes: 5 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# Using Python for the project
language: python
python:
- "2.7"
- "3.4"
- "3.5"
# Python 3.6 is set to test and deploy the docs in the configuration matrix
Expand All @@ -26,7 +25,7 @@ addons:

before_install:
# Gets scripts
- git clone -b v0.4.1 --single-branch https://github.com/Bernardo-MG/ci-shell-scripts.git ~/.scripts
- git clone -b v1.1.3 --single-branch https://github.com/Bernardo-MG/ci-shell-scripts.git ~/.scripts
# Sets scripts as executable
- chmod -R +x ~/.scripts/*
# Prepares CI environment
Expand All @@ -39,11 +38,13 @@ install:
# Dependencies
- pip install --upgrade -r requirements.txt
script:
# Tests are run
- ~/.scripts/python/run_tests.sh true $PYTHON_VERSION_TEST
# Documentation tests are run
- ~/.scripts/python/run_tests.sh $DO_TEST_DOCS docs
after_success:
# Documentation deployment
- ~/.scripts/sphinx/build-html.sh $DO_DEPLOY_DOCS docs
- cd ~/sphinx/build/html
- ~/.scripts/deploy/deploy-ssh.sh $DO_DEPLOY_DOCS_RELEASE $DEPLOY_USERNAME $DEPLOY_PASSWORD $DEPLOY_HOST $DEPLOY_PORT $DEPLOY_PATH_RELEASE
- ~/.scripts/deploy/deploy-ssh.sh $DO_DEPLOY_DOCS_DEVELOP $DEPLOY_USERNAME $DEPLOY_PASSWORD $DEPLOY_HOST $DEPLOY_PORT $DEPLOY_PATH_DEVELOP
- ~/.scripts/deploy/deploy-ssh.sh $DO_DEPLOY_DOCS_RELEASE $DEPLOY_DOCS_USERNAME $DEPLOY_DOCS_PASSWORD $DEPLOY_DOCS_HOST $DEPLOY_DOCS_PORT $DEPLOY_DOCS_PATH_RELEASE
- ~/.scripts/deploy/deploy-ssh.sh $DO_DEPLOY_DOCS_DEVELOP $DEPLOY_DOCS_USERNAME $DEPLOY_DOCS_PASSWORD $DEPLOY_DOCS_HOST $DEPLOY_DOCS_PORT $DEPLOY_DOCS_PATH_DEVELOP
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 Bernardo Martínez Garrido
Copyright (c) 2016-2018 Bernardo Martínez Garrido

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
11 changes: 4 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ operating with it on any Python application.
:alt: Dice Notation Tools for Python Pypi package page

.. image:: https://img.shields.io/badge/docs-release-blue.svg
:target: http://docs.wandrell.com/dice-notation-python
:target: http://docs.bernardomg.com/dice-notation-python
:alt: Dice Notation Tools for Python latest documentation
.. image:: https://img.shields.io/badge/docs-develop-blue.svg
:target: http://docs.wandrell.com/development/dice-notation-python
:target: http://docs.bernardomg.com/development/dice-notation-python
:alt: Dice Notation Tools for Python development documentation

Features
Expand Down Expand Up @@ -50,12 +50,9 @@ Prerequisites

The project has been tested in the following versions of the interpreter:

- Python 2.7
- Python 3.4
- Python 3.5
- Python 3.6
- Pypy
- Pypy 3

All other dependencies are indicated on the requirements.txt file.
The included makefile can install them with the command:
Expand Down Expand Up @@ -124,8 +121,8 @@ License
The project has been released under the `MIT License`_.

.. _GitHub project page: https://github.com/Bernardo-MG/dice-notation-python
.. _latest docs: http://docs.wandrell.com/dice-notation-python
.. _development docs: http://docs.wandrell.com/development/dice-notation-python
.. _latest docs: http://docs.bernardomg.com/dice-notation-python
.. _development docs: http://docs.bernardomg.com/development/dice-notation-python
.. _Pypi package: https://pypi.python.org/pypi/dice-notation
.. _MIT License: http://www.opensource.org/licenses/mit-license.php
.. _project issues tracker: https://github.com/Bernardo-MG/dice-notation-python/issues
Expand Down
4 changes: 2 additions & 2 deletions dice_notation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
Dice Notation Tools for Python
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dice notation tools
:copyright: (c) 2016 by Bernardo Martínez Garrido
:copyright: (c) 2016-2018 by Bernardo Martínez Garrido
:license: MIT, see LICENSE for more details.
"""

__version__ = '1.0.2'
__version__ = '1.0.3'
__license__ = 'MIT'
9 changes: 2 additions & 7 deletions dice_notation/dice.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-

import sys
from abc import ABCMeta, abstractmethod
from random import randint

Expand All @@ -20,11 +19,8 @@
__author__ = 'Benardo Martínez Garrido'
__license__ = 'MIT'

if sys.version_info[0] >= 3:
xrange = range


class Rollable(object):
class Rollable(object, metaclass=ABCMeta):
"""
Interface for rollable classes.
Expand All @@ -37,7 +33,6 @@ class Rollable(object):
As such, the value generated by rolling may be anything.
"""
__metaclass__ = ABCMeta

def __init__(self):
pass
Expand Down Expand Up @@ -132,7 +127,7 @@ def roll(self):
elif self.quantity is None or self.sides is None:
result = None
elif self.quantity > 0 and self.sides > 0:
for x in xrange(self.quantity):
for x in range(self.quantity):
result += randint(1, self.sides)
else:
result = None
Expand Down
6 changes: 2 additions & 4 deletions dice_notation/parser/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,14 @@
__license__ = 'MIT'


class Parser(object):
class Parser(object, metaclass=ABCMeta):
"""
Interface for implementing parsers.
It just contains a single method, 'parse', which will receive a value
and take care of parsing it into another.
"""

__metaclass__ = ABCMeta

def __init__(self):
pass

Expand All @@ -52,7 +50,7 @@ def __init__(self, **kw):
try:
modname = os.path.split(os.path.splitext(__file__)[0])[
1] + "_" + self.__class__.__name__
except:
except Exception:
modname = "parser" + "_" + self.__class__.__name__
self.debugfile = modname + ".dbg"
self.tabmodule = modname + "_" + "parsetab"
Expand Down
6 changes: 3 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
# General information about the project.
project = 'Dice Notation Tools for Python'
project_safe = project.replace(' ', '_')
copyright = u'2016, Bernardo Martínez Garrido'
copyright = u'2016-2018, Bernardo Martínez Garrido'
authors = [u'Bernardo Martínez Garrido']

# The version info for the project.
Expand Down Expand Up @@ -100,9 +100,9 @@
'keywords': 'dice, dice notation, parser, Python, RPG',
'author_name': ','.join(authors),
'author_url': 'https://github.com/Bernardo-MG',
'twitter_id': '@Wandrell_BMG',
'twitter_id': '@BernardoMartG',
'publish_date': datetime.datetime.now().date(),
'years': '2016',
'years': '2016-2018',
'scm_name': 'Github',
'scm_url': 'https://github.com/Bernardo-MG/dice-notation-python',
'ci_name': 'Travis',
Expand Down
5 changes: 1 addition & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def run_tests(self):
version=version_lib,
description='Dice notation tools',
author='Bernardo Martínez Garrido',
author_email='programming@wandrell.com',
author_email='programming@bernardomg.com',
license='MIT',
url='https://github.com/Bernardo-MG/dice-notation-python',
download_url='https://pypi.python.org/pypi/dice-notation',
Expand All @@ -74,13 +74,10 @@ def run_tests(self):
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Games/Entertainment :: Role-Playing'
],
long_description=read('README.rst'),
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist =
py{27,34,35,36},
py{34,35,36},
pypy{,3},
check,
docs,
Expand Down

0 comments on commit d6cab7c

Please sign in to comment.