Skip to content

Commit cecae82

Browse files
authored
Update ruff and address typing error (#498)
1 parent 2ef7b7f commit cecae82

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ repos:
3737
- id: black
3838

3939
- repo: https://github.com/charliermarsh/ruff-pre-commit
40-
rev: v0.0.242
40+
rev: v0.0.254
4141
hooks:
4242
- id: ruff
4343
args: ["--fix"]

jupyter_releaser/changelog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def format(changelog): # noqa
224224
return re.sub(r"\n\n+$", r"\n", changelog)
225225

226226

227-
def check_entry( # noqa
227+
def check_entry(
228228
ref,
229229
branch,
230230
repo,

jupyter_releaser/mock_github.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ async def upload_a_release_asset(owner: str, repo: str, release_id: int, request
193193
asset = Asset(
194194
id=asset_id,
195195
name=name,
196-
size=headers["content-length"],
196+
size=int(headers["content-length"]),
197197
url=url,
198198
content_type=headers["content-type"],
199199
)

jupyter_releaser/tee.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ async def _read_stream(stream: StreamReader, callback: Callable[..., Any]) -> No
5252
break
5353

5454

55-
async def _stream_subprocess(args: str, **kwargs: Any) -> CompletedProcess: # noqa
55+
async def _stream_subprocess(args: str, **kwargs: Any) -> CompletedProcess:
5656
platform_settings: Dict[str, Any] = {}
5757
if platform.system() == "Windows":
5858
platform_settings["env"] = os.environ

jupyter_releaser/util.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def create_release_commit(version, release_message=None, dist_dir="dist"):
226226
cmd += ' -m "SHA256 hashes:"'
227227

228228
for path in sorted(files):
229-
path = normalize_path(path)
229+
path = normalize_path(path) # noqa
230230
sha256 = compute_sha256(path)
231231
shas[path] = sha256
232232
name = osp.basename(path)
@@ -319,7 +319,7 @@ def bump_version(version_spec, *, changelog_path="", version_cmd=""): # noqa
319319

320320
else:
321321
# Handle dev version spec.
322-
if version_spec == "dev":
322+
if version_spec == "dev": # noqa
323323
if v.pre:
324324
version_spec = f"{v.major}.{v.minor}.{v.micro}.dev0"
325325
# Bump to next minor dev.
@@ -680,15 +680,15 @@ def get_gh_object(dry_run=False, **kwargs):
680680

681681
def get_remote_name(dry_run):
682682
"""Get the appropriate remote git name."""
683-
global _local_remote
683+
global _local_remote # noqa
684684
if not dry_run:
685685
return "origin"
686686

687687
if _local_remote:
688688
try:
689689
run(f"git remote add test {_local_remote}")
690-
except Exception:
691-
pass # noqa
690+
except Exception: # noqa
691+
pass
692692
return "test"
693693

694694
tfile = tempfile.NamedTemporaryFile(suffix=".git")
@@ -705,7 +705,7 @@ def get_mock_github_url():
705705
return f"http://127.0.0.1:{port}"
706706

707707

708-
def ensure_mock_github(): # noqa
708+
def ensure_mock_github():
709709
"""Check for or start a mock github server."""
710710
core.GH_HOST = host = get_mock_github_url()
711711
port = urlparse(host).port

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ dependencies = [
100100
"black==23.1.0",
101101
"mdformat>0.7",
102102
"mdformat-gfm>=0.3.5",
103-
"ruff==0.0.242"
103+
"ruff==0.0.254"
104104
]
105105
detached = true
106106
[tool.hatch.envs.lint.scripts]

0 commit comments

Comments
 (0)