scout-rig 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,47 @@
1
+ require File.expand_path(__FILE__).sub(%r(/test/.*), '/test/test_helper.rb')
2
+ require File.expand_path(__FILE__).sub(%r(.*/test/), '').sub(/test_(.*)\.rb/,'\1')
3
+
4
+ class TestPythonWorkflow < Test::Unit::TestCase
5
+ def test_file
6
+ sss 0
7
+
8
+ code =<<-EOF
9
+ import scout
10
+ from typing import List, Optional
11
+
12
+ def hello(name: str, excited: bool = False) -> str:
13
+ """
14
+ Greet a user.
15
+
16
+ Parameters
17
+ ----------
18
+ name : str
19
+ The name of the person to greet.
20
+ excited : bool, optional
21
+ Whether to add an exclamation mark, by default False.
22
+
23
+ Returns
24
+ -------
25
+ str
26
+ A greeting message.
27
+ """
28
+ return f"Hello, {name}{'!' if excited else ''}"
29
+
30
+ scout.task(hello)
31
+ EOF
32
+ TmpFile.with_file code do |script|
33
+ wf = Module.new do
34
+ extend Workflow
35
+ extend PythonWorkflow
36
+
37
+ self.name = 'Greet'
38
+
39
+ python_task :hello, file: script
40
+ end
41
+
42
+ job = wf.job(:hello, name: 'Miguel')
43
+ assert_equal 'Hello, Miguel', job.run.strip
44
+ end
45
+ end
46
+ end
47
+
data/test/test_helper.rb CHANGED
@@ -2,4 +2,54 @@ require 'test/unit'
2
2
  $LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib')))
3
3
  $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__)))
4
4
 
5
- require 'scout-gear'
5
+ require 'scout'
6
+
7
+ class Test::Unit::TestCase
8
+
9
+ def assert_equal_path(path1, path2)
10
+ assert_equal File.expand_path(path1), File.expand_path(path2)
11
+ end
12
+
13
+ def self.tmpdir
14
+ @@tmpdir ||= Path.setup('tmp/test_tmpdir').find
15
+ end
16
+
17
+ def tmpdir
18
+ @tmpdir ||= Test::Unit::TestCase.tmpdir
19
+ end
20
+
21
+ setup do
22
+ Open.rm_rf tmpdir
23
+ TmpFile.tmpdir = tmpdir.tmpfiles
24
+ Log::ProgressBar.default_severity = 0
25
+ Persist.cache_dir = tmpdir.var.cache
26
+ Persist::MEMORY_CACHE.clear
27
+ Open.remote_cache_dir = tmpdir.var.cache
28
+ Workflow.directory = tmpdir.var.jobs
29
+ Workflow.workflows.each{|wf| wf.directory = Workflow.directory[wf.name] }
30
+ Entity.entity_property_cache = tmpdir.entity_properties if defined?(Entity)
31
+ Workflow.job_cache.clear
32
+ SchedulerJob.batch_base_dir = tmpdir.batch
33
+ end
34
+
35
+ teardown do
36
+ Open.rm_rf tmpdir
37
+ end
38
+
39
+ def self.datadir_test
40
+ Path.setup(File.join(File.dirname(__FILE__), 'data'))
41
+ end
42
+
43
+ def self.datafile_test(file)
44
+ datadir_test[file.to_s]
45
+ end
46
+
47
+ def datadir_test
48
+ Test::Unit::TestCase.datadir_test
49
+ end
50
+
51
+ def datafile_test(file)
52
+ Test::Unit::TestCase.datafile_test(file)
53
+ end
54
+ end
55
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scout-rig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
@@ -43,30 +43,36 @@ executables: []
43
43
  extensions: []
44
44
  extra_rdoc_files:
45
45
  - LICENSE.txt
46
- - README.rdoc
46
+ - README.md
47
47
  files:
48
48
  - ".document"
49
49
  - ".vimproject"
50
50
  - LICENSE.txt
51
- - README.rdoc
51
+ - README.md
52
52
  - Rakefile
53
53
  - VERSION
54
+ - doc/Python.md
54
55
  - lib/scout-rig.rb
55
56
  - lib/scout/python.rb
56
57
  - lib/scout/python/paths.rb
57
58
  - lib/scout/python/run.rb
58
59
  - lib/scout/python/script.rb
59
60
  - lib/scout/python/util.rb
61
+ - lib/scout/workflow/python.rb
62
+ - lib/scout/workflow/python/inputs.rb
63
+ - lib/scout/workflow/python/task.rb
60
64
  - python/scout/__init__.py
61
- - python/scout/__pycache__/__init__.cpython-310.pyc
62
- - python/scout/__pycache__/workflow.cpython-310.pyc
65
+ - python/scout/runner.py
63
66
  - python/scout/workflow.py
64
67
  - python/scout/workflow/remote.py
65
68
  - python/test.py
66
69
  - scout-rig.gemspec
70
+ - test/scout/python/test_run.rb
67
71
  - test/scout/python/test_script.rb
68
72
  - test/scout/python/test_util.rb
69
73
  - test/scout/test_python.rb
74
+ - test/scout/workflow/python/test_task.rb
75
+ - test/scout/workflow/test_python.rb
70
76
  - test/test_helper.rb
71
77
  homepage: http://github.com/mikisvaz/scout-rig
72
78
  licenses:
@@ -86,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
92
  - !ruby/object:Gem::Version
87
93
  version: '0'
88
94
  requirements: []
89
- rubygems_version: 3.6.8
95
+ rubygems_version: 3.7.0.dev
90
96
  specification_version: 4
91
97
  summary: Scouts rigging things together
92
98
  test_files: []
data/README.rdoc DELETED
@@ -1,18 +0,0 @@
1
- = scout-rig
2
-
3
- Description goes here.
4
-
5
- == Contributing to scout-rig
6
-
7
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
8
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
9
- * Fork the project.
10
- * Start a feature/bugfix branch.
11
- * Commit and push until you are happy with your contribution.
12
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
-
15
- == Copyright
16
-
17
- Copyright (c) 2025 Miguel Vazquez. See LICENSE.txt for
18
- further details.