You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Standardize formatting with proper spacing and indentation
Fix trailing commas and line length violations
Remove unnecessary type annotation ignore rule
Diagram Walkthrough
flowchart LR
A["Ruff Linter Rules"] -->|Apply Formatting| B["Spacing & Indentation"]
A -->|Apply Formatting| C["Trailing Commas"]
A -->|Apply Formatting| D["Line Length"]
B --> E["Updated Files"]
C --> E
D --> E
F["Remove ANN101 Rule"] --> G["Config Update"]
The ANN101 rule, which requires type annotations for self, was enabled in .ruff.toml. However, the codebase lacks these annotations, which will cause new linting failures. It is suggested to either revert this change or add the missing annotations.
# .ruff.toml
[lint]
ignore= [
"ANN101", # Missing type annotation for `self` in method
...
]
# ims_envista/ims_envista.py# No changes to python files, only .ruff.toml is reverted.classIMSEnvista:
def__init__(self, token: UUID|str, session: ClientSession|None=None) ->None:
...
asyncdefget_latest_station_data(self, station_id: int, ...) ->StationMeteorologicalReadings:
...
Suggestion importance[1-10]: 9
__
Why: The suggestion correctly identifies that enabling the ANN101 linting rule without adding the required self type annotations will introduce numerous linting errors, contradicting the PR's goal of applying linter fixes.
High
Possible issue
Avoid incorrect double DST adjustment
Remove the redundant daylight saving time adjustment for the dt object to prevent a double adjustment that causes incorrect timestamps.
Why: The suggestion correctly identifies a critical bug where a datetime object is adjusted twice for daylight saving time, leading to incorrect data. The proposed fix is accurate and necessary.
The action failed during python3 -m unittest discover because 3 unit tests errored due to network timeouts when calling the external IMS Envista API. - tests/unit/test_ims_envista.py:71 (test_get_latest_station_data) raised ims_envista.commons.ImsEnvistaApiClientCommunicationError after aiohttp.client_exceptions.ConnectionTimeoutError connecting to https://api.ims.gov.il/v1/envista/stations/178/data/latest (originating from ims_envista/commons.py:67 -> commons.py:73 where the exception is wrapped and re-raised). - tests/unit/test_ims_envista.py:209 (test_get_monthly_station_data_with_channel) failed similarly with a connection timeout to https://api.ims.gov.il/v1/envista/stations/178/data/7/monthly/2026/02.
The test run ended with FAILED (errors=3) and the job exited with code 1. (The earlier setuptools/license messages are warnings and not the cause of the failure.)
Relevant error logs:
1: ##[group]Runner Image Provisioner2: Hosted Compute Agent
...
330: ********************************************************************************331: Please consider removing the following classifiers in favor of a SPDX license expression:332: License :: OSI Approved :: MIT License333: See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.334: ********************************************************************************335: !!336: self._finalize_license_expression()337: running install338: /opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/setuptools/_distutils/cmd.py:90: SetuptoolsDeprecationWarning: setup.py install is deprecated.339: !!340: ********************************************************************************341: Please avoid running ``setup.py`` directly.342: Instead, use pypa/build, pypa/installer or other343: standards-based tools.344: This deprecation is overdue, please update your project and remove deprecated345: calls to avoid build errors in the future.346: See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
...
422: ##[group]Run python3 -m unittest discover423: �[36;1mpython3 -m unittest discover�[0m424: shell: /usr/bin/bash -e {0}425: env:426: IMS_TOKEN: ***427: pythonLocation: /opt/hostedtoolcache/Python/3.13.11/x64428: PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.13.11/x64/lib/pkgconfig429: Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.13.11/x64430: Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.13.11/x64431: Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.13.11/x64432: LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.13.11/x64/lib433: ##[endgroup]434: ..Executing <Task finished name='Task-16' coro=<TestIMSEnvista.test_get_earliest_station_data() done, defined at /home/runner/work/py-ims-envista/py-ims-envista/tests/unit/test_ims_envista.py:91> result=None created at /opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/asyncio/runners.py:100> took 0.132 seconds435: ..E...E....E...436: ======================================================================437: ERROR: test_get_latest_station_data (tests.unit.test_ims_envista.TestIMSEnvista.test_get_latest_station_data)438: Test get_latest_station endpoint.
...
443: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^444: ...<6 lines>...445: )446: ^447: File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/aiohappyeyeballs/impl.py", line 73, in start_connection448: sock = await _connect_sock(449: ^^^^^^^^^^^^^^^^^^^^450: ...<6 lines>...451: )452: ^453: File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/aiohappyeyeballs/impl.py", line 208, in _connect_sock454: await loop.sock_connect(sock, address)455: File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/asyncio/selector_events.py", line 641, in sock_connect456: return await fut457: ^^^^^^^^^458: asyncio.exceptions.CancelledError459: The above exception was the direct cause of the following exception:
...
475: raise last_exc476: File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/aiohttp/connector.py", line 1580, in _create_direct_connection477: transp, proto = await self._wrap_create_connection(478: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^479: ...<7 lines>...480: )481: ^482: File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/aiohttp/connector.py", line 1295, in _wrap_create_connection483: async with ceil_timeout(484: ~~~~~~~~~~~~^485: timeout.sock_connect, ceil_threshold=timeout.ceil_threshold486: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^487: ):488: ^489: File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/asyncio/timeouts.py", line 116, in __aexit__490: raise TimeoutError from exc_val491: TimeoutError492: The above exception was the direct cause of the following exception:493: Traceback (most recent call last):494: File "/home/runner/work/py-ims-envista/py-ims-envista/ims_envista/commons.py", line 67, in get495: response = await session.get(url=url, headers=headers)496: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^497: File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/aiohttp/client.py", line 779, in _request498: resp = await handler(req)499: ^^^^^^^^^^^^^^^^^^500: File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/aiohttp/client.py", line 738, in _connect_and_send_request501: raise ConnectionTimeoutError(502: f"Connection timeout to host {req.url}"503: ) from exc504: aiohttp.client_exceptions.ConnectionTimeoutError: Connection timeout to host https://api.ims.gov.il/v1/envista/stations/178/data/latest505: The above exception was the direct cause of the following exception:506: Traceback (most recent call last):507: File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/asyncio/runners.py", line 118, in run508: return self._loop.run_until_complete(task)509: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^510: File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/asyncio/base_events.py", line 725, in run_until_complete511: return future.result()512: ~~~~~~~~~~~~~^^513: File "/home/runner/work/py-ims-envista/py-ims-envista/tests/unit/test_ims_envista.py", line 71, in test_get_latest_station_data514: station_data = await self.ims.get_latest_station_data(self.station_id)515: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^516: File "/home/runner/work/py-ims-envista/py-ims-envista/ims_envista/ims_envista.py", line 88, in get_latest_station_data517: await get(session=self._session, url=get_url, token=self._token)518: File "/home/runner/work/py-ims-envista/py-ims-envista/ims_envista/commons.py", line 73, in get519: raise ImsEnvistaApiClientCommunicationError(520: msg,521: ) from exception522: ims_envista.commons.ImsEnvistaApiClientCommunicationError: Timeout error fetching information from https://api.ims.gov.il/v1/envista/stations/178/data/latest - Connection timeout to host https://api.ims.gov.il/v1/envista/stations/178/data/latest523: ======================================================================524: ERROR: test_get_monthly_station_data_with_channel (tests.unit.test_ims_envista.TestIMSEnvista.test_get_monthly_station_data_with_channel)525: Test get_monthly_station_data endpoint with channel.
...
530: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^531: ...<6 lines>...532: )533: ^534: File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/aiohappyeyeballs/impl.py", line 73, in start_connection535: sock = await _connect_sock(536: ^^^^^^^^^^^^^^^^^^^^537: ...<6 lines>...538: )539: ^540: File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/aiohappyeyeballs/impl.py", line 208, in _connect_sock541: await loop.sock_connect(sock, address)542: File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/asyncio/selector_events.py", line 641, in sock_connect543: return await fut544: ^^^^^^^^^545: asyncio.exceptions.CancelledError546: The above exception was the direct cause of the following exception:
...
562: raise last_exc563: File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/aiohttp/connector.py", line 1580, in _create_direct_connection564: transp, proto = await self._wrap_create_connection(565: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^566: ...<7 lines>...567: )568: ^569: File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/aiohttp/connector.py", line 1295, in _wrap_create_connection570: async with ceil_timeout(571: ~~~~~~~~~~~~^572: timeout.sock_connect, ceil_threshold=timeout.ceil_threshold573: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^574: ):575: ^576: File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/asyncio/timeouts.py", line 116, in __aexit__577: raise TimeoutError from exc_val578: TimeoutError579: The above exception was the direct cause of the following exception:580: Traceback (most recent call last):581: File "/home/runner/work/py-ims-envista/py-ims-envista/ims_envista/commons.py", line 67, in get582: response = await session.get(url=url, headers=headers)583: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^584: File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/aiohttp/client.py", line 779, in _request585: resp = await handler(req)586: ^^^^^^^^^^^^^^^^^^587: File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/aiohttp/client.py", line 738, in _connect_and_send_request588: raise ConnectionTimeoutError(589: f"Connection timeout to host {req.url}"590: ) from exc591: aiohttp.client_exceptions.ConnectionTimeoutError: Connection timeout to host https://api.ims.gov.il/v1/envista/stations/178/data/7/monthly/2026/02592: The above exception was the direct cause of the following exception:
...
595: return self._loop.run_until_complete(task)596: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^597: File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/asyncio/base_events.py", line 725, in run_until_complete598: return future.result()599: ~~~~~~~~~~~~~^^600: File "/home/runner/work/py-ims-envista/py-ims-envista/tests/unit/test_ims_envista.py", line 209, in test_get_monthly_station_data_with_channel601: station_data = await self.ims.get_monthly_station_data(602: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^603: self.station_id, channel_id=self.channel_id, month=month, year=year604: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^605: )606: ^607: File "/home/runner/work/py-ims-envista/py-ims-envista/ims_envista/ims_envista.py", line 233, in get_monthly_station_data608: await get(session=self._session, url=get_url, token=self._token)609: File "/home/runner/work/py-ims-envista/py-ims-envista/ims_envista/commons.py", line 73, in get610: raise ImsEnvistaApiClientCommunicationError(611: msg,612: ) from exception613: ims_envista.commons.ImsEnvistaApiClientCommunicationError: Timeout error fetching information from https://api.ims.gov.il/v1/envista/stations/178/data/7/monthly/2026/02 - Connection timeout to host https://api.ims.gov.il/v1/envista/stations/178/data/7/monthly/2026/02614: ======================================================================615: ERROR: test_get_station_data_from_date_with_channel (tests.unit.test_ims_envista.TestIMSEnvista.test_get_station_data_from_date_with_channel)616: Test get_station_data_from_date endpoint with channel.
...
621: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^622: ...<6 lines>...623: )624: ^625: File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/aiohappyeyeballs/impl.py", line 73, in start_connection626: sock = await _connect_sock(627: ^^^^^^^^^^^^^^^^^^^^628: ...<6 lines>...629: )630: ^631: File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/aiohappyeyeballs/impl.py", line 208, in _connect_sock632: await loop.sock_connect(sock, address)633: File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/asyncio/selector_events.py", line 641, in sock_connect634: return await fut635: ^^^^^^^^^636: asyncio.exceptions.CancelledError637: The above exception was the direct cause of the following exception:
...
653: raise last_exc654: File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/aiohttp/connector.py", line 1580, in _create_direct_connection655: transp, proto = await self._wrap_create_connection(656: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^657: ...<7 lines>...658: )659: ^660: File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/aiohttp/connector.py", line 1295, in _wrap_create_connection661: async with ceil_timeout(662: ~~~~~~~~~~~~^663: timeout.sock_connect, ceil_threshold=timeout.ceil_threshold664: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^665: ):666: ^667: File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/asyncio/timeouts.py", line 116, in __aexit__668: raise TimeoutError from exc_val669: TimeoutError670: The above exception was the direct cause of the following exception:671: Traceback (most recent call last):672: File "/home/runner/work/py-ims-envista/py-ims-envista/ims_envista/commons.py", line 67, in get673: response = await session.get(url=url, headers=headers)674: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^675: File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/aiohttp/client.py", line 779, in _request676: resp = await handler(req)677: ^^^^^^^^^^^^^^^^^^678: File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/aiohttp/client.py", line 738, in _connect_and_send_request679: raise ConnectionTimeoutError(680: f"Connection timeout to host {req.url}"681: ) from exc682: aiohttp.client_exceptions.ConnectionTimeoutError: Connection timeout to host https://api.ims.gov.il/v1/envista/stations/178/data/7/daily/2026/2/4683: The above exception was the direct cause of the following exception:
...
686: return self._loop.run_until_complete(task)687: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^688: File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/asyncio/base_events.py", line 725, in run_until_complete689: return future.result()690: ~~~~~~~~~~~~~^^691: File "/home/runner/work/py-ims-envista/py-ims-envista/tests/unit/test_ims_envista.py", line 131, in test_get_station_data_from_date_with_channel692: station_data = await self.ims.get_station_data_from_date(693: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^694: self.station_id, self.tz.localize(datetime.now()), self.channel_id695: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^696: )697: ^698: File "/home/runner/work/py-ims-envista/py-ims-envista/ims_envista/ims_envista.py", line 139, in get_station_data_from_date699: await get(session=self._session, url=get_url, token=self._token)700: File "/home/runner/work/py-ims-envista/py-ims-envista/ims_envista/commons.py", line 73, in get701: raise ImsEnvistaApiClientCommunicationError(702: msg,703: ) from exception704: ims_envista.commons.ImsEnvistaApiClientCommunicationError: Timeout error fetching information from https://api.ims.gov.il/v1/envista/stations/178/data/7/daily/2026/2/4 - Connection timeout to host https://api.ims.gov.il/v1/envista/stations/178/data/7/daily/2026/2/4705: ----------------------------------------------------------------------706: Ran 17 tests in 119.052s707: FAILED (errors=3)708: ##[error]Process completed with exit code 1.709: Post job cleanup.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Type
Enhancement
Description
Apply ruff linter fixes across codebase
Standardize formatting with proper spacing and indentation
Fix trailing commas and line length violations
Remove unnecessary type annotation ignore rule
Diagram Walkthrough
File Walkthrough
10 files
Add blank line and trailing comma fixesAdd blank lines between functions and fix formattingFix method indentation and line length violationsFix string concatenation indentation and spacingAdd blank lines between function and class definitionsAdd blank lines after module docstringReformat setup call with proper indentationFix comment indentationRemove extra blank lines between test methodsAdd blank line after module docstring1 files
Remove unnecessary ANN101 ignore rule