1. Sean Davis
  2. Snakemake

Commits

Johannes Köster  committed a6c3309 Merge

Merge branch 'master' of bitbucket.org:johanneskoester/snakemake

  • Participants
  • Parent commits afc2715, eb1a6f4
  • Branches master

Comments (0)

Files changed (6)

File snakemake/parser.py

View file
  • Ignore whitespace
 
 import tokenize
 import textwrap
+import os
 
 
 __author__ = "Johannes Köster"
         automaton = Python(snakefile)
         linemap = dict()
         compilation = list()
-        lines = 1
+        # add Snakefile directory to path
+        compilation.append("import sys; sys.path.insert(0, '{}')".format(os.path.dirname(os.path.abspath(path))))
+        compilation.append("\n")
+        lines = 2
         for t, orig_token in automaton.consume():
             l = lineno(orig_token)
             linemap.update(

File tests/test_local_import/Snakefile

View file
  • Ignore whitespace
+import bar
+import foo
+
+rule:
+	output: "test.out"
+	shell: "touch {output}"

File tests/test_local_import/bar.py

  • Ignore whitespace
Empty file added.

File tests/test_local_import/expected-results/test.out

  • Ignore whitespace
Empty file added.

File tests/test_local_import/foo/__init__.py

  • Ignore whitespace
Empty file added.

File tests/tests.py

View file
  • Ignore whitespace
 
 def test_globwildcards():
     run(dpath("test_globwildcards"))
+
+def test_local_import():
+    run(dpath("test_local_import"))