Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix style issues #7

Merged
merged 4 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Publish Docker image

on:
push:
branches: [main]
release:
types: [published]
branches: [ignore]
# release:
# types: [published]

jobs:
push_to_registry:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
_version.py
.vscode
.DS_Store
.*.swp
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "hatchling.build"
name = "fmripost-template"
description = 'A template tool for postprocessing fMRIPrep derivatives'
readme = "README.md"
requires-python = ">=3.11"
requires-python = ">=3.10"
license = {file = "LICENSE"}
keywords = []
authors = [{name = "The NiPreps Developers", email = "[email protected]"}]
Expand Down
2 changes: 1 addition & 1 deletion src/fmripost_template/cli/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def main():

if sentry_sdk is not None and failed_reports:
sentry_sdk.capture_message(
'Report generation failed for %d subjects' % failed_reports,
f'Report generation failed for {failed_reports} subjects',
level='error',
)
sys.exit(int((errno + len(failed_reports)) > 0))
Expand Down
6 changes: 3 additions & 3 deletions src/fmripost_template/cli/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"""Version CLI helpers."""

from contextlib import suppress
from datetime import UTC, datetime
from datetime import datetime, timezone
from pathlib import Path

import requests
Expand All @@ -41,7 +41,7 @@
latest = None
date = None
outdated = None
now = datetime.now(tz=UTC)
now = datetime.now(tz=timezone.utc)

Check warning on line 44 in src/fmripost_template/cli/version.py

View check run for this annotation

Codecov / codecov/patch

src/fmripost_template/cli/version.py#L44

Added line #L44 was not covered by tests
cachefile = Path.home() / '.cache' / 'fmripost_template' / 'latest'
try:
cachefile.parent.mkdir(parents=True, exist_ok=True)
Expand All @@ -56,7 +56,7 @@
else:
try:
latest = Version(latest)
date = datetime.strptime(date, DATE_FMT).astimezone(UTC)
date = datetime.strptime(date, DATE_FMT).astimezone(timezone.utc)

Check warning on line 59 in src/fmripost_template/cli/version.py

View check run for this annotation

Codecov / codecov/patch

src/fmripost_template/cli/version.py#L59

Added line #L59 was not covered by tests
except (InvalidVersion, ValueError):
latest = None
else:
Expand Down
2 changes: 1 addition & 1 deletion src/fmripost_template/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
# Just get so analytics track one hit
from contextlib import suppress

from requests import ConnectionError, ReadTimeout
from requests import ConnectionError, ReadTimeout # noqa: A004
from requests import get as _get_url

with suppress((ConnectionError, ReadTimeout)):
Expand Down