Skip to content

Commit

Permalink
Upgrade ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdsellers committed Feb 18, 2024
1 parent e447621 commit a1a0f6d
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ repos:
exclude: "docs/_pygments/monokai.py"

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.1
rev: v0.2.2
hooks:
- id: ruff
args: ["--fix"]
Expand Down
21 changes: 11 additions & 10 deletions nautilus_core/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions nautilus_trader/common/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ def __init__(self, config: InstrumentProviderConfig | None = None) -> None:
self._loaded = False
self._loading = False

self._tasks: set[asyncio.Task] = set()

self._log.info("READY.")

@property
Expand Down Expand Up @@ -172,7 +174,8 @@ def load_all(self, filters: dict | None = None) -> None:
"""
loop = asyncio.get_event_loop()
if loop.is_running():
loop.create_task(self.load_all_async(filters))
task = loop.create_task(self.load_all_async(filters))
self._tasks.add(task)
else:
loop.run_until_complete(self.load_all_async(filters))

Expand All @@ -197,7 +200,8 @@ def load_ids(

loop = asyncio.get_event_loop()
if loop.is_running():
loop.create_task(self.load_ids_async(instrument_ids, filters))
task = loop.create_task(self.load_ids_async(instrument_ids, filters))
self._tasks.add(task)
else:
loop.run_until_complete(self.load_ids_async(instrument_ids, filters))

Expand All @@ -222,7 +226,8 @@ def load(

loop = asyncio.get_event_loop()
if loop.is_running():
loop.create_task(self.load_async(instrument_id, filters))
task = loop.create_task(self.load_async(instrument_id, filters))
self._tasks.add(task)
else:
loop.run_until_complete(self.load_async(instrument_id, filters))

Expand Down
50 changes: 25 additions & 25 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ docformatter = "^1.7.5"
mypy = "^1.8.0"
pandas-stubs = "^2.1.4"
pre-commit = "^3.6.1"
ruff = "^0.2.1"
ruff = "^0.2.2"
types-pytz = "^2023.3"
types-requests = "^2.31"
types-toml = "^0.10.2"
Expand Down

0 comments on commit a1a0f6d

Please sign in to comment.