Skip to content

Commit ae74231

Browse files
authored
Merge pull request #29 from Bernardo-MG/release
Release
2 parents a50e163 + 2cc8ea0 commit ae74231

12 files changed

Lines changed: 128 additions & 104 deletions

File tree

.coveragerc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[report]
22
omit =
33
*/python?.?/*
4-
*/site-packages/nose/*
54
*__init__*

.github/workflows/deploy.yml

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,9 @@ on:
66
- master
77

88
jobs:
9-
deploy_docs:
10-
11-
runs-on: ubuntu-latest
12-
13-
steps:
14-
- name: Check-out
15-
uses: actions/checkout@v2
16-
- name: Set up Python
17-
uses: actions/setup-python@v2
18-
with:
19-
python-version: 3.9
20-
- name: Install dependencies
21-
run: |
22-
python -m pip install --upgrade pip
23-
pip install flake8 pytest
24-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
25-
- name: Build distribution
26-
run: python setup.py sdist bdist_wheel
27-
- name: Deploy
28-
run: twine upload -r pypi dist/*
29-
env:
30-
TWINE_USERNAME: ${{ secrets.DEPLOY_USER }}
31-
TWINE_PASSWORD: ${{ secrets.DEPLOY_PASSWORD }}
9+
pypi:
10+
name: Pypi
11+
uses: Bernardo-MG/github-workflow/.github/workflows/python_deploy_pypi.yml@v1
12+
secrets:
13+
username: ${{ secrets.DEPLOY_USER }}
14+
password: ${{ secrets.DEPLOY_PASSWORD }}

.github/workflows/deploy_docs.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

.github/workflows/testing.yml

Lines changed: 66 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,80 @@
1-
name: Testing and validation
1+
name: Tests and docs
22

33
on: [push, pull_request]
44

55
jobs:
6-
test:
6+
tests:
7+
name: Tests
8+
uses: Bernardo-MG/github-workflow/.github/workflows/python_testing.yml@develop
79

10+
setup_docs:
11+
name: Doc deployment preparation
12+
needs: tests
13+
outputs:
14+
branchName: ${{ steps.extract_branch.outputs.branchName }}
815
runs-on: ubuntu-latest
9-
strategy:
10-
matrix:
11-
python-version: [3.6, 3.7, 3.8, 3.9]
1216

17+
steps:
18+
- name: Install sshpass
19+
run: sudo apt-get install sshpass
20+
- name: Extract branch name
21+
uses: bernardo-mg/extract-branch-name-action@v1
22+
id: extract_branch
23+
24+
deploy_docs:
25+
name: Deploy development docs
26+
environment: deployment_site
27+
needs: setup_docs
28+
runs-on: ubuntu-latest
29+
if: ${{ needs.setup_docs.outputs.branchName == 'master' }}
30+
steps:
31+
- name: Check-out
32+
uses: actions/checkout@v2
33+
- name: Set up Python
34+
uses: actions/setup-python@v2
35+
with:
36+
python-version: 3.9
37+
cache: 'pip'
38+
- name: Update pip
39+
run: python -m pip install --upgrade pip
40+
- name: Install dependencies
41+
run: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
42+
- name: Install sshpass
43+
run: sudo apt-get install sshpass
44+
- name: Tests docs
45+
run: python setup.py test -p docs
46+
- name: Build docs
47+
run: python setup.py build_docs
48+
- name: Deploy docs
49+
run: |
50+
cd ./build/sphinx/html
51+
sshpass -p ${{ secrets.DEPLOY_DOCS_PASSWORD }} scp -o StrictHostKeyChecking=no -P ${{ secrets.DEPLOY_DOCS_PORT }} -r ./* ${{ secrets.DEPLOY_DOCS_USER }}'@'${{ secrets.DEPLOY_DOCS_HOST }}':'${{ secrets.DEPLOY_DOCS_PATH }};
52+
53+
deploy_develop_docs:
54+
name: Deploy development docs
55+
environment: deployment_site
56+
needs: setup_docs
57+
runs-on: ubuntu-latest
58+
if: ${{ needs.setup_docs.outputs.branchName == 'develop' }}
1359
steps:
1460
- name: Check-out
1561
uses: actions/checkout@v2
16-
- name: Set up Python ${{ matrix.python-version }}
62+
- name: Set up Python
1763
uses: actions/setup-python@v2
1864
with:
19-
python-version: ${{ matrix.python-version }}
65+
python-version: 3.9
66+
cache: 'pip'
67+
- name: Update pip
68+
run: python -m pip install --upgrade pip
2069
- name: Install dependencies
70+
run: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
71+
- name: Install sshpass
72+
run: sudo apt-get install sshpass
73+
- name: Tests docs
74+
run: python setup.py test -p docs
75+
- name: Build docs
76+
run: python setup.py build_docs
77+
- name: Deploy docs
2178
run: |
22-
python -m pip install --upgrade pip
23-
pip install flake8 pytest
24-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
25-
- name: Run all tests
26-
run: python setup.py test -p py${{ matrix.python-version }}
79+
cd ./build/sphinx/html
80+
sshpass -p ${{ secrets.DEPLOY_DOCS_DEVELOP_PASSWORD }} scp -o StrictHostKeyChecking=no -P ${{ secrets.DEPLOY_DOCS_PORT }} -r ./* ${{ secrets.DEPLOY_DOCS_DEVELOP_USER }}'@'${{ secrets.DEPLOY_DOCS_HOST }}':'${{ secrets.DEPLOY_DOCS_DEVELOP_PATH }};

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ htmlcov/
4242
.tox/
4343
.coverage
4444
.cache
45-
nosetests.xml
4645
coverage.xml
4746

4847
# Translations

README.rst

Lines changed: 6 additions & 6 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.bernardomg.com/dice-notation-python
22+
:target: https://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.bernardomg.com/development/dice-notation-python
25+
:target: https://docs.bernardomg.com/development/dice-notation-python
2626
:alt: Dice Notation Tools for Python development documentation
2727

2828
Features
@@ -146,9 +146,9 @@ License
146146
The project has been released under the `MIT License`_.
147147

148148
.. _GitHub project page: https://github.com/Bernardo-MG/dice-notation-python
149-
.. _latest docs: http://docs.bernardomg.com/dice-notation-python
150-
.. _development docs: http://docs.bernardomg.com/development/dice-notation-python
149+
.. _latest docs: https://docs.bernardomg.com/dice-notation-python
150+
.. _development docs: https://docs.bernardomg.com/development/dice-notation-python
151151
.. _Pypi package: https://pypi.python.org/pypi/dice-notation
152-
.. _MIT License: http://www.opensource.org/licenses/mit-license.php
152+
.. _MIT License: https://opensource.org/licenses/mit-license.php
153153
.. _project issues tracker: https://github.com/Bernardo-MG/dice-notation-python/issues
154-
.. _Sphinx: http://sphinx-doc.org/
154+
.. _Sphinx: https://www.sphinx-doc.org

dice_notation/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
:license: MIT, see LICENSE for more details.
88
"""
99

10-
__version__ = '1.2.0'
10+
__version__ = '1.2.1'
1111
__license__ = 'MIT'

dice_notation/parser/DiceNotationListener.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from antlr4 import *
33

44
import logging
5-
from dice_notation.dice import Dice
5+
from dice_notation.dice import RollableDice
66
from dice_notation.algebra import BinaryOperation, Number
77

88
# This class defines a complete listener for a parse tree produced by DiceNotationParser.
@@ -125,7 +125,7 @@ def exitDice(self, ctx):
125125

126126
sides = int(next(digits).getText())
127127

128-
dice = Dice(quantity, sides)
128+
dice = RollableDice(quantity, sides)
129129
self._nodes.append(dice)
130130

131131

docs/source/conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@
9393
html_theme_path = sphinx_docs_theme.get_html_theme_path()
9494

9595
# Removes permalink markers
96-
html_add_permalinks = ''
96+
html_permalinks = False
97+
html_permalinks_icon = ''
9798

9899
# Theme options.
99100
html_theme_options = {

requirements.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# Installation and deployment
2-
setuptools==54.2.0
3-
wheel==0.36.2
4-
twine==3.4.1
5-
bernardomg.tox-test-command==1.1.6
6-
bernardomg.version-extractor==1.0.3
2+
setuptools==59.6.0
3+
wheel==0.37.1
4+
twine==3.8.0
5+
bernardomg.tox-test-command==1.2.0
6+
bernardomg.version-extractor==1.1.0
77

88
# Testing
9-
tox==3.23.0
9+
tox==3.24.5
1010

1111
# Documentation
12-
Sphinx==3.5.3
12+
Sphinx==4.4.0
1313
sphinx-docs-theme==1.0.7
14-
Pygments==2.8.1
14+
Pygments==2.11.2
1515

1616
# Parsing
17-
antlr4-python3-runtime==4.7.2
17+
antlr4-python3-runtime==4.9.3

0 commit comments

Comments
 (0)