Skip to content

Commit

Permalink
Merge pull request #14 from Bernardo-MG/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Bernardo-MG committed Jan 9, 2018
2 parents d6cab7c + dfd9d5c commit b8892fb
Show file tree
Hide file tree
Showing 16 changed files with 101 additions and 315 deletions.
30 changes: 30 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Auto detect text files and perform LF normalization
* text=auto

# Known text files
*.css text diff=css
*.js text
*.json text
*.htm text diff=html
*.html text diff=html
*.properties text
*.sh text
*.md text
*.txt text
*.xml text
*.yml text

# Known source files
*.pxd text diff=python
*.py text diff=python
*.py3 text diff=python
*.pyw text diff=python
*.pyx text diff=python

# Known binary files
*.db binary
*.p binary
*.pkl binary
*.pyc binary
*.pyd binary
*.pyo binary
7 changes: 2 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,13 @@ addons:

before_install:
# Gets scripts
- git clone -b v1.1.3 --single-branch https://github.com/Bernardo-MG/ci-shell-scripts.git ~/.scripts
- git clone -b v1.2.0 --single-branch https://github.com/Bernardo-MG/ci-shell-scripts.git ~/.scripts
# Sets scripts as executable
- chmod -R +x ~/.scripts/*
# Prepares CI environment
- source ~/.scripts/travis/load-travis-environment.sh
- source ~/.scripts/travis/load-travis-environment-python.sh
install:
# tox is required for the tests
- pip install tox
# sphinx is required for the docs
- pip install sphinx
# Dependencies
- pip install --upgrade -r requirements.txt
script:
Expand Down
2 changes: 0 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Miscellany files
include LICENSE
include README.rst
include Makefile
include make.bat
include tox.ini
include requirements.txt
include .coveragerc
Expand Down
89 changes: 0 additions & 89 deletions Makefile

This file was deleted.

24 changes: 18 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ The project has been tested in the following versions of the interpreter:
- Python 3.6

All other dependencies are indicated on the requirements.txt file.
The included makefile can install them with the command:

``$ make requirements``
These can be installed with:

``$ pip install --upgrade -r requirements.txt``

Installing
~~~~~~~~~~
Expand All @@ -67,11 +68,9 @@ to install it. For this use the following command;

``$ pip install dice-notation``

If manual installation is required, the project includes a setup.py file, along
a makefile allowing direct installation of the library, which can be done with
the following command:
If needed, manual installation is possible:

``$ make install``
``$ python setup.py install``

Usage
-----
Expand All @@ -94,6 +93,19 @@ needed, which will generate a new random value each time it is called::
print(dice.roll())
print(dice.roll())

Testing
-------

The tests included with the project can be run with:

``$ python setup.py test``

This will delegate the execution to tox.

It is possible to run just one of the test profiles, in this case the py36 profile:

``$ python setup.py test -p "py36"``

Collaborate
-----------

Expand Down
2 changes: 1 addition & 1 deletion dice_notation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
:license: MIT, see LICENSE for more details.
"""

__version__ = '1.0.3'
__version__ = '1.0.5'
__license__ = 'MIT'
2 changes: 1 addition & 1 deletion dice_notation/parser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

from dice_notation.parser.dice import DiceParser

__all__ = ['DiceParser']
__all__ = ['DiceParser']
2 changes: 1 addition & 1 deletion dice_notation/parser/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ def __init__(self, **kw):
tabmodule=self.tabmodule)

def parse(self, value):
return yacc.parse(value)
return yacc.parse(value)
2 changes: 1 addition & 1 deletion dice_notation/parser/dice.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ def p_error(self, p):
if p:
self._logger.error("Syntax error at '%s'", p.value)
else:
self._logger.error("Syntax error at EOF")
self._logger.error("Syntax error at EOF")
2 changes: 1 addition & 1 deletion dice_notation/parser/notation.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,4 +256,4 @@ def operate(self):
return result

def roll(self):
return self.operate()
return self.operate()
4 changes: 2 additions & 2 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-2018, Bernardo Martínez Garrido'
copyright = u'2016-%s, Bernardo Martínez Garrido' % datetime.datetime.now().year
authors = [u'Bernardo Martínez Garrido']

# The version info for the project.
Expand Down Expand Up @@ -102,7 +102,7 @@
'author_url': 'https://github.com/Bernardo-MG',
'twitter_id': '@BernardoMartG',
'publish_date': datetime.datetime.now().date(),
'years': '2016-2018',
'years': '2016-%s' % datetime.datetime.now().year,
'scm_name': 'Github',
'scm_url': 'https://github.com/Bernardo-MG/dice-notation-python',
'ci_name': 'Travis',
Expand Down
18 changes: 18 additions & 0 deletions docs/source/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,21 @@ needed, which will generate a new random value each time it is called::
print(dice.roll())
print(dice.roll())

-------
Testing
-------

The tests included with the project can be run with:

.. code::
$ python setup.py test
This will delegate the execution to tox.

It is possible to run just one of the test profiles, in this case the py36 profile:

.. code::
$ python setup.py test -p "py36"
Loading

0 comments on commit b8892fb

Please sign in to comment.