diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 331c7bb2..3050a4ae 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,7 +24,6 @@ jobs: - name: Install dependencies run: | pip install -r requirements.txt - pip install -r requirements-test.txt - name: Black fmt run: | @@ -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: | @@ -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: | diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 070c4b50..00000000 --- a/.travis.yml +++ /dev/null @@ -1,35 +0,0 @@ -language: python - -sudo: false - -install: - - travis_retry python setup.py install - - pip install coveralls - -jobs: - include: - - name: "Tests: python 3.7" - python: 3.7 - dist: xenial - script: - - coverage run --source=betfairlightweight setup.py test - - name: "Tests: python 3.8" - python: 3.8 - dist: xenial - script: - - coverage run --source=betfairlightweight setup.py test - - name: "Tests: python 3.9" - python: 3.9 - dist: xenial - script: - - coverage run --source=betfairlightweight setup.py test - - name: "Lint: python 3.7" - python: 3.7 - dist: xenial - install: - - pip install black - script: - - black --check --diff . - -after_success: - coveralls diff --git a/HISTORY.rst b/HISTORY.rst index e99559a5..d2ff5658 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -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) +++++++++++++++++++ diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 07fd50c7..00000000 --- a/MANIFEST.in +++ /dev/null @@ -1,9 +0,0 @@ -include LICENSE -include README.md -include requirements.txt -include requirements-speed.txt -include HISTORY.rst - -graft tests - -global-exclude *.py[co] .DS_Store diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 01f8dfb9..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,19 +0,0 @@ -build: off - -environment: - matrix: - - PYTHON: "C:\\Python37" - PYTHON_VERSION: "3.7.x" - -# - PYTHON: "C:\\Python38" -# PYTHON_VERSION: "3.8.x" - -init: - - "ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%" - -install: - - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" - - "python setup.py install" - -test_script: - - "python setup.py test" diff --git a/betfairlightweight/__version__.py b/betfairlightweight/__version__.py index d4b3f53a..14e2edb0 100644 --- a/betfairlightweight/__version__.py +++ b/betfairlightweight/__version__.py @@ -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" diff --git a/betfairlightweight/streaming/betfairstream.py b/betfairlightweight/streaming/betfairstream.py index 5ba5e0ce..9f71e0bf 100644 --- a/betfairlightweight/streaming/betfairstream.py +++ b/betfairlightweight/streaming/betfairstream.py @@ -1,7 +1,6 @@ import socket import ssl import logging -import datetime import collections from typing import Optional diff --git a/betfairlightweight/streaming/cache.py b/betfairlightweight/streaming/cache.py index 54468820..55f6de6e 100644 --- a/betfairlightweight/streaming/cache.py +++ b/betfairlightweight/streaming/cache.py @@ -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 @@ -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 @@ -297,6 +296,7 @@ def update_cache( ), 2, ) + self.active = active def refresh_cache(self) -> None: for runner in self.runners: diff --git a/betfairlightweight/streaming/stream.py b/betfairlightweight/streaming/stream.py index 7460a7da..33c07037 100644 --- a/betfairlightweight/streaming/stream.py +++ b/betfairlightweight/streaming/stream.py @@ -1,4 +1,3 @@ -import datetime import logging import time from typing import Optional diff --git a/pyproject.toml b/pyproject.toml index a5a74328..7fd9efff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,8 +35,8 @@ test = [ "coverage", "mkdocs", "mkdocs-material", + "build", "twine", - "wheel", ] [project.urls] @@ -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", +] diff --git a/requirements-test.txt b/requirements-test.txt deleted file mode 100644 index d87e8004..00000000 --- a/requirements-test.txt +++ /dev/null @@ -1,11 +0,0 @@ -# Tests & Linting -black==24.2.0 -coverage - -# Documentation -mkdocs -mkdocs-material - -# Packaging -build -twine diff --git a/requirements.txt b/requirements.txt index 753a6db2..05c4e28c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,13 @@ requests<2.32.0 + +# Tests & Linting +black==24.2.0 +coverage + +# Documentation +mkdocs +mkdocs-material + +# Packaging +build +twine diff --git a/tests/test_cache.py b/tests/test_cache.py index f6575134..f549e40e 100644 --- a/tests/test_cache.py +++ b/tests/test_cache.py @@ -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)