Skip to content

Commit d6cab7c

Browse files
authored
Merge pull request #13 from Bernardo-MG/develop
Develop
2 parents 8411b91 + 0441af2 commit d6cab7c

9 files changed

Lines changed: 21 additions & 33 deletions

File tree

.travis.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# Using Python for the project
55
language: python
66
python:
7-
- "2.7"
87
- "3.4"
98
- "3.5"
109
# Python 3.6 is set to test and deploy the docs in the configuration matrix
@@ -26,7 +25,7 @@ addons:
2625

2726
before_install:
2827
# Gets scripts
29-
- git clone -b v0.4.1 --single-branch https://github.com/Bernardo-MG/ci-shell-scripts.git ~/.scripts
28+
- git clone -b v1.1.3 --single-branch https://github.com/Bernardo-MG/ci-shell-scripts.git ~/.scripts
3029
# Sets scripts as executable
3130
- chmod -R +x ~/.scripts/*
3231
# Prepares CI environment
@@ -39,11 +38,13 @@ install:
3938
# Dependencies
4039
- pip install --upgrade -r requirements.txt
4140
script:
41+
# Tests are run
42+
- ~/.scripts/python/run_tests.sh true $PYTHON_VERSION_TEST
4243
# Documentation tests are run
4344
- ~/.scripts/python/run_tests.sh $DO_TEST_DOCS docs
4445
after_success:
4546
# Documentation deployment
4647
- ~/.scripts/sphinx/build-html.sh $DO_DEPLOY_DOCS docs
4748
- cd ~/sphinx/build/html
48-
- ~/.scripts/deploy/deploy-ssh.sh $DO_DEPLOY_DOCS_RELEASE $DEPLOY_USERNAME $DEPLOY_PASSWORD $DEPLOY_HOST $DEPLOY_PORT $DEPLOY_PATH_RELEASE
49-
- ~/.scripts/deploy/deploy-ssh.sh $DO_DEPLOY_DOCS_DEVELOP $DEPLOY_USERNAME $DEPLOY_PASSWORD $DEPLOY_HOST $DEPLOY_PORT $DEPLOY_PATH_DEVELOP
49+
- ~/.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
50+
- ~/.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

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

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

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.rst

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ operating with it on any Python application.
1919
:alt: Dice Notation Tools for Python Pypi package page
2020

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

2828
Features
@@ -50,12 +50,9 @@ Prerequisites
5050

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

53-
- Python 2.7
5453
- Python 3.4
5554
- Python 3.5
5655
- Python 3.6
57-
- Pypy
58-
- Pypy 3
5956

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

126123
.. _GitHub project page: https://github.com/Bernardo-MG/dice-notation-python
127-
.. _latest docs: http://docs.wandrell.com/dice-notation-python
128-
.. _development docs: http://docs.wandrell.com/development/dice-notation-python
124+
.. _latest docs: http://docs.bernardomg.com/dice-notation-python
125+
.. _development docs: http://docs.bernardomg.com/development/dice-notation-python
129126
.. _Pypi package: https://pypi.python.org/pypi/dice-notation
130127
.. _MIT License: http://www.opensource.org/licenses/mit-license.php
131128
.. _project issues tracker: https://github.com/Bernardo-MG/dice-notation-python/issues

dice_notation/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
Dice Notation Tools for Python
44
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55
Dice notation tools
6-
:copyright: (c) 2016 by Bernardo Martínez Garrido
6+
:copyright: (c) 2016-2018 by Bernardo Martínez Garrido
77
:license: MIT, see LICENSE for more details.
88
"""
99

10-
__version__ = '1.0.2'
10+
__version__ = '1.0.3'
1111
__license__ = 'MIT'

dice_notation/dice.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: utf-8 -*-
22

3-
import sys
43
from abc import ABCMeta, abstractmethod
54
from random import randint
65

@@ -20,11 +19,8 @@
2019
__author__ = 'Benardo Martínez Garrido'
2120
__license__ = 'MIT'
2221

23-
if sys.version_info[0] >= 3:
24-
xrange = range
2522

26-
27-
class Rollable(object):
23+
class Rollable(object, metaclass=ABCMeta):
2824
"""
2925
Interface for rollable classes.
3026
@@ -37,7 +33,6 @@ class Rollable(object):
3733
3834
As such, the value generated by rolling may be anything.
3935
"""
40-
__metaclass__ = ABCMeta
4136

4237
def __init__(self):
4338
pass
@@ -132,7 +127,7 @@ def roll(self):
132127
elif self.quantity is None or self.sides is None:
133128
result = None
134129
elif self.quantity > 0 and self.sides > 0:
135-
for x in xrange(self.quantity):
130+
for x in range(self.quantity):
136131
result += randint(1, self.sides)
137132
else:
138133
result = None

dice_notation/parser/common.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,14 @@
1717
__license__ = 'MIT'
1818

1919

20-
class Parser(object):
20+
class Parser(object, metaclass=ABCMeta):
2121
"""
2222
Interface for implementing parsers.
2323
2424
It just contains a single method, 'parse', which will receive a value
2525
and take care of parsing it into another.
2626
"""
2727

28-
__metaclass__ = ABCMeta
29-
3028
def __init__(self):
3129
pass
3230

@@ -52,7 +50,7 @@ def __init__(self, **kw):
5250
try:
5351
modname = os.path.split(os.path.splitext(__file__)[0])[
5452
1] + "_" + self.__class__.__name__
55-
except:
53+
except Exception:
5654
modname = "parser" + "_" + self.__class__.__name__
5755
self.debugfile = modname + ".dbg"
5856
self.tabmodule = modname + "_" + "parsetab"

docs/source/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
# General information about the project.
6161
project = 'Dice Notation Tools for Python'
6262
project_safe = project.replace(' ', '_')
63-
copyright = u'2016, Bernardo Martínez Garrido'
63+
copyright = u'2016-2018, Bernardo Martínez Garrido'
6464
authors = [u'Bernardo Martínez Garrido']
6565

6666
# The version info for the project.
@@ -100,9 +100,9 @@
100100
'keywords': 'dice, dice notation, parser, Python, RPG',
101101
'author_name': ','.join(authors),
102102
'author_url': 'https://github.com/Bernardo-MG',
103-
'twitter_id': '@Wandrell_BMG',
103+
'twitter_id': '@BernardoMartG',
104104
'publish_date': datetime.datetime.now().date(),
105-
'years': '2016',
105+
'years': '2016-2018',
106106
'scm_name': 'Github',
107107
'scm_url': 'https://github.com/Bernardo-MG/dice-notation-python',
108108
'ci_name': 'Travis',

setup.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def run_tests(self):
6363
version=version_lib,
6464
description='Dice notation tools',
6565
author='Bernardo Martínez Garrido',
66-
author_email='programming@wandrell.com',
66+
author_email='programming@bernardomg.com',
6767
license='MIT',
6868
url='https://github.com/Bernardo-MG/dice-notation-python',
6969
download_url='https://pypi.python.org/pypi/dice-notation',
@@ -74,13 +74,10 @@ def run_tests(self):
7474
'Intended Audience :: Developers',
7575
'License :: OSI Approved :: MIT License',
7676
'Programming Language :: Python',
77-
'Programming Language :: Python :: 2',
78-
'Programming Language :: Python :: 2.7',
7977
'Programming Language :: Python :: 3',
8078
'Programming Language :: Python :: 3.3',
8179
'Programming Language :: Python :: 3.4',
8280
'Programming Language :: Python :: 3.5',
83-
'Programming Language :: Python :: Implementation :: PyPy',
8481
'Topic :: Games/Entertainment :: Role-Playing'
8582
],
8683
long_description=read('README.rst'),

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tox]
22
envlist =
3-
py{27,34,35,36},
3+
py{34,35,36},
44
pypy{,3},
55
check,
66
docs,

0 commit comments

Comments
 (0)