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: fixed code change detection when using modules #1264

Merged
merged 4 commits into from Nov 17, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/conventional-prs.yml
Expand Up @@ -13,4 +13,6 @@ jobs:
steps:
- uses: amannn/action-semantic-pull-request@v3.4.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
validateSingleCommit: true
16 changes: 9 additions & 7 deletions snakemake/jobs.py
Expand Up @@ -244,13 +244,15 @@ def outputs_older_than_script_or_notebook(self):
return
if self.rule.basedir:
# needed if rule is included from another subdirectory
path = os.path.relpath(os.path.join(self.rule.basedir, path))
assert os.path.exists(path), "cannot find {0}".format(path)
script_mtime = os.lstat(path).st_mtime
for f in self.expanded_output:
if f.exists:
if not f.is_newer(script_mtime):
yield f
path = self.rule.basedir.join(path).get_path_or_uri()
if is_local_file(path):
assert os.path.exists(path), "cannot find {0}".format(path)
script_mtime = os.lstat(path).st_mtime
for f in self.expanded_output:
if f.exists:
if not f.is_newer(script_mtime):
yield f
# TODO also handle remote file case here.

@property
def threads(self):
Expand Down
6 changes: 4 additions & 2 deletions snakemake/sourcecache.py
Expand Up @@ -150,12 +150,14 @@ class HostingProviderFile(SourceFile):

def __init__(
self,
repo: str,
path: str,
repo: str = None,
path: str = None,
tag: str = None,
branch: str = None,
commit: str = None,
):
if repo is None:
raise SourceFileError("repo must be given")
if not self.__class__.valid_repo.match(repo):
raise SourceFileError(
"repo {} is not a valid repo specification (must be given as owner/name)."
Expand Down