Skip to content

Commit

Permalink
Merge pull request #306 from liampauling/release/2.4.0
Browse files Browse the repository at this point in the history
github actions added
  • Loading branch information
liampauling committed Jun 9, 2020
2 parents 53ade9c + fc16352 commit c7f76be
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 3 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: test

on: [push, deployment]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
pip install -r requirements.txt
pip install -r requirements-test.txt
- name: Black fmt
run: |
black . --check
- name: Unittest
run: |
python -m unittest discover -s tests
- name: Coverage
run: |
coverage run -m unittest discover
coverage report
deploy:
needs: test
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'

steps:
- uses: actions/checkout@v2

- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7

- name: Install dependencies
run: |
pip install -r requirements.txt
pip install -r requirements-test.txt
- name: Build package and docs
run: |
python setup.py sdist bdist_wheel
twine check dist/*
mkdocs build
- name: Publish
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "GitHub Action"
twine upload dist/*
mkdocs gh-deploy --force
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
15 changes: 15 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@
Release History
---------------

2.4.0 (2020-06-09)
+++++++++++++++++++

**Improvements**

- Github actions added

**Bug Fixes**

- #304 missing regulator auth code

**Dependencies**

- ujson upgraded from 2.0.3 to 3.0.0

2.3.1 (2020-05-12)
+++++++++++++++++++

Expand Down
2 changes: 1 addition & 1 deletion betfairlightweight/__version__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
__title__ = "betfairlightweight"
__description__ = "Lightweight python wrapper for Betfair API-NG"
__url__ = "https://github.com/liampauling/betfair"
__version__ = "2.3.1"
__version__ = "2.4.0"
__author__ = "Liam Pauling"
__license__ = "MIT"
3 changes: 3 additions & 0 deletions betfairlightweight/resources/bettingresources.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,7 @@ class CurrentOrder:
:type persistence_type: unicode
:type placed_date: datetime.datetime
:type price_size: PriceSize
:type regulator_auth_code: unicode
:type regulator_code: unicode
:type selection_id: int
:type side: unicode
Expand Down Expand Up @@ -645,6 +646,7 @@ def __init__(
matchedDate: str = None,
customerStrategyRef: str = None,
customerOrderRef: str = None,
regulatorAuthCode: str = None,
):
self.bet_id = betId
self.average_price_matched = averagePriceMatched
Expand All @@ -655,6 +657,7 @@ def __init__(
self.order_type = orderType
self.persistence_type = persistenceType
self.placed_date = BaseResource.strip_datetime(placedDate)
self.regulator_auth_code = regulatorAuthCode
self.regulator_code = regulatorCode
self.selection_id = selectionId
self.side = side
Expand Down
11 changes: 11 additions & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Tests & Linting
black==19.10b0
coverage

# Documentation
mkdocs
mkdocs-material

# Packaging
twine
wheel
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
requests<=2.23.0
ciso8601==2.1.3; sys_platform == 'darwin' or sys_platform == 'linux'
ujson==2.0.3; sys_platform == 'darwin' or sys_platform == 'linux'
ujson==3.0.0; sys_platform == 'darwin' or sys_platform == 'linux'
2 changes: 1 addition & 1 deletion tests/resources/list_current_orders.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"jsonrpc":"2.0","result":{"currentOrders":[{"betId":"71958694780","marketId":"1.125875592","selectionId":6412775,"handicap":0.0,"priceSize":{"price":1.22,"size":2.0},"bspLiability":0.0,"side":"LAY","status":"EXECUTION_COMPLETE","persistenceType":"LAPSE","orderType":"LIMIT","placedDate":"2016-07-30T16:21:49.000Z","matchedDate":"2016-07-30T16:21:50.000Z","averagePriceMatched":1.22,"sizeMatched":2.0,"sizeRemaining":0.0,"sizeLapsed":0.0,"sizeCancelled":0.0,"sizeVoided":0.0,"regulatorCode":"GIBRALTAR REGULATOR"}],"moreAvailable":false},"id":1}
{"jsonrpc":"2.0","result":{"currentOrders":[{"betId":"71958694780","marketId":"1.125875592","selectionId":6412775,"handicap":0.0,"priceSize":{"price":1.22,"size":2.0},"bspLiability":0.0,"side":"LAY","status":"EXECUTION_COMPLETE","persistenceType":"LAPSE","orderType":"LIMIT","placedDate":"2016-07-30T16:21:49.000Z","matchedDate":"2016-07-30T16:21:50.000Z","averagePriceMatched":1.22,"sizeMatched":2.0,"sizeRemaining":0.0,"sizeLapsed":0.0,"sizeCancelled":0.0,"sizeVoided":0.0,"regulatorCode":"GIBRALTAR REGULATOR","regulatorAuthCode":"bc000000000000000000"}],"moreAvailable":false},"id":1}

0 comments on commit c7f76be

Please sign in to comment.