Skip to content

Commit

Permalink
Merge pull request #566 from betcode-org/release/2.20.1
Browse files Browse the repository at this point in the history
Prevent race condition on snap when market cache has not finished pop…
  • Loading branch information
liampauling committed Mar 12, 2024
2 parents 221e20d + a798961 commit fb7a2ce
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 84 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install -r requirements-test.txt
- name: Black fmt
run: |
Expand Down Expand Up @@ -57,7 +56,6 @@ jobs:
run: |
pip install -r requirements.txt
pip install -r requirements-speed.txt
pip install -r requirements-test.txt
- name: Unittest
run: |
Expand All @@ -81,7 +79,6 @@ jobs:
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install -r requirements-test.txt
- name: Build package and docs
run: |
Expand Down
35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

12 changes: 12 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
Release History
---------------

2.20.1 (2024-03-12)
+++++++++++++++++++

**Improvements**

- toml improvements
- repo cleanup

**Bug Fixes**

- Prevent race condition on snap when market cache has not finished populating

2.20.0 (2024-03-11)
+++++++++++++++++++

Expand Down
9 changes: 0 additions & 9 deletions MANIFEST.in

This file was deleted.

19 changes: 0 additions & 19 deletions appveyor.yml

This file was deleted.

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/betcode-org/betfair"
__version__ = "2.20.0"
__version__ = "2.20.1"
__author__ = "Liam Pauling"
__license__ = "MIT"
1 change: 0 additions & 1 deletion betfairlightweight/streaming/betfairstream.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import socket
import ssl
import logging
import datetime
import collections
from typing import Optional

Expand Down
4 changes: 2 additions & 2 deletions betfairlightweight/streaming/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def __init__(
cumulative_runner_tv: bool,
):
super(MarketBookCache, self).__init__()
self.active = True
self.active = False
self.market_id = market_id
self.publish_time = publish_time
self.lightweight = lightweight
Expand Down Expand Up @@ -234,7 +234,6 @@ def __init__(
def update_cache(
self, market_change: dict, publish_time: int, active: bool
) -> None:
self.active = active
self.streaming_update = market_change
self.publish_time = publish_time

Expand Down Expand Up @@ -297,6 +296,7 @@ def update_cache(
),
2,
)
self.active = active

def refresh_cache(self) -> None:
for runner in self.runners:
Expand Down
1 change: 0 additions & 1 deletion betfairlightweight/streaming/stream.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import datetime
import logging
import time
from typing import Optional
Expand Down
10 changes: 9 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ test = [
"coverage",
"mkdocs",
"mkdocs-material",
"build",
"twine",
"wheel",
]

[project.urls]
Expand All @@ -48,3 +48,11 @@ Changelog = "https://github.com/betcode-org/betfair/blob/master/HISTORY.rst"

[tool.hatch.version]
path = "betfairlightweight/__version__.py"

[tool.hatch.build.targets.sdist]
include = [
"/betfairlightweight",
"/HISTORY.rst",
"/README.md",
"/tests",
]
11 changes: 0 additions & 11 deletions requirements-test.txt

This file was deleted.

12 changes: 12 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
requests<2.32.0

# Tests & Linting
black==24.2.0
coverage

# Documentation
mkdocs
mkdocs-material

# Packaging
build
twine
2 changes: 1 addition & 1 deletion tests/test_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def setUp(self):
self.market_book_cache = MarketBookCache("1.2345", 12345, True, False, False)

def test_init(self):
self.assertTrue(self.market_book_cache.active)
self.assertFalse(self.market_book_cache.active)
self.assertEqual(self.market_book_cache.market_id, "1.2345")
self.assertEqual(self.market_book_cache.publish_time, 12345)
self.assertTrue(self.market_book_cache.lightweight)
Expand Down

0 comments on commit fb7a2ce

Please sign in to comment.