Compare commits

...

3 Commits

Author SHA1 Message Date
Rory Flynn cbd41b2aff
Mark 2.5.3 release (#490) 2024-04-19 17:23:55 +02:00
Rory Flynn 0509eaa162
Use backwards-compatible datetime.timezone.utc (#488) 2024-04-19 17:22:10 +02:00
Rory Flynn 59e6dff1e1
Fail builds on test failure (#489)
* Fail builds on test failure

* Deliberately fail a build to test

* Revert "Deliberately fail a build to test"

This reverts commit 666140a954.
2024-04-19 17:18:27 +02:00
3 changed files with 8 additions and 9 deletions

View File

@ -40,7 +40,9 @@ jobs:
- name: Safety checks
run: safety check
- name: Test with pytest and coverage
run: pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=mvt tests/ | tee pytest-coverage.txt
run: |
set -o pipefail
pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=mvt tests/ | tee pytest-coverage.txt
- name: Pytest coverage comment
continue-on-error: true # Workflows running on a fork can't post comments
uses: MishaKav/pytest-coverage-comment@main

View File

@ -59,13 +59,10 @@ def convert_datetime_to_iso(date_time: datetime.datetime) -> str:
:rtype: str
"""
try:
if date_time.tzinfo:
# Timezone aware object - convert to UTC
date_time = date_time.astimezone(tz=datetime.UTC)
return date_time.strftime("%Y-%m-%d %H:%M:%S.%f")
except Exception:
return ""
if date_time.tzinfo:
# Timezone aware object - convert to UTC
date_time = date_time.astimezone(tz=datetime.timezone.utc)
return date_time.strftime("%Y-%m-%d %H:%M:%S.%f")
def convert_unix_to_utc_datetime(

View File

@ -3,4 +3,4 @@
# Use of this software is governed by the MVT License 1.1 that can be found at
# https://license.mvt.re/1.1/
MVT_VERSION = "2.5.2"
MVT_VERSION = "2.5.3"