Skip to content
Open
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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies = [
"pygithub>=2.6.1",
"pyyaml>=6.0.2",
"requests>=2.32.4",
"reretry>=0.11.8",
"tenacity>=9.1.2",
"toml>=0.10.2",
]

Expand Down
7 changes: 3 additions & 4 deletions snakedeploy/prs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
import os
import re
from typing import Optional
from reretry import retry
from tenacity import retry, stop_after_attempt, wait_exponential
from urllib3.util.retry import Retry

import github
from github import Github, GithubException

from snakedeploy.exceptions import UserError
Expand Down Expand Up @@ -57,7 +56,7 @@ def __init__(
def add_file(self, filepath, content, is_updated, msg):
self.files.append(File(str(filepath), content, is_updated, msg))

@retry(tries=2, delay=60)
@retry(stop=stop_after_attempt(2), wait=wait_exponential(multiplier=2, min=60))
def create(self):
if not self.files:
logger.info("No files to commit.")
Expand All @@ -83,7 +82,7 @@ def create(self):
try:
# try to get sha if file exists
sha = self.repo.get_contents(file.path, self.branch).sha
except github.GithubException.UnknownObjectException as e:
except GithubException.UnknownObjectException as e:
if e.status != 404:
raise e
elif file.is_updated:
Expand Down
7 changes: 7 additions & 0 deletions snakedeploy/snakemake_wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,13 @@ def update_spec(matchobj):

if create_prs:
assert pr is not None
pr.add_file(
snakefile,
snakefile_content,
is_updated=True,
msg=f"perf: update {snakefile}.",
)

pr.create()

if create_prs and not per_snakefile_prs:
Expand Down
Loading