Skip to content

Commit 3ec4cba

Browse files
committed
wip deprecate things
1 parent eb607d9 commit 3ec4cba

32 files changed

Lines changed: 45 additions & 1408 deletions

CHANGELOG.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@ TODO add summary
88

99
## BREAKING CHANGES
1010

11-
* `Nextflow` runner: remove deprecated `map`, `mapId`, `mapData`, `mapPassthrough` and `renameKeys` (PR #792).
11+
* `Nextflow` runner: remove deprecated `map`, `mapId`, `mapData`, `mapPassthrough` and `renameKeys` arguments (PR #792).
1212

13-
* `Nextflow` runner: remove helper functions: `setWorkflowArguments`, `getWorkflowArguments`, `strictMap`, `passthroughMap`, `passthroughFlatMap` and `passthroughFilter` (PR #792).
13+
* `Nextflow` runner: remove helper functions: `setWorkflowArguments`, `getWorkflowArguments`, `strictMap`, `passthroughMap`, `passthroughFlatMap`, `passthroughFilter`, `channelFromParams`, `runComponents` (PRs #792, #811).
1414

15-
* `Nextflow` runner: `channelFromParams` is now deprecated (PR #792).
16-
17-
* `Nextflow` runner: remove deprecated `runComponents` (PR #811).
15+
* Deprecate `functionality` and `platforms`.
1816

1917
## BUG FIXES
2018

src/main/resources/io/viash/runners/nextflow/channel/channelFromParams.nf renamed to src/main/resources/io/viash/runners/nextflow/channel/_channelFromParams.nf

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -100,27 +100,3 @@ private _channelFromParams(Map params, Map config) {
100100
def processedParams = _paramsToParamSets(params, config)
101101
return Channel.fromList(processedParams)
102102
}
103-
104-
/**
105-
* Parse nextflow parameters based on settings defined in a viash config
106-
* and return a nextflow channel.
107-
*
108-
* @param params Input parameters. Can optionaly contain a 'param_list' key that
109-
* provides a list of arguments that can be split up into multiple events
110-
* in the output channel possible formats of param_lists are: a csv file,
111-
* json file, a yaml file or a yaml blob. Each parameters set (event) must
112-
* have a unique ID.
113-
* @param config A Map of the Viash configuration. This Map can be generated from the config file
114-
* using the readConfig() function.
115-
*
116-
* @return A nextflow Channel with events. Events are formatted as a tuple that contains
117-
* first contains the ID of the event and as second element holds a parameter map.
118-
*
119-
*
120-
*/
121-
def channelFromParams(Map params, Map config) {
122-
log.warn "channelFromParams is deprecated and will be removed in Viash 0.10.0. ",
123-
"Nextflow workflows can now be built into standalone components where parsed parameters ",
124-
"are automatically provided to the input channel."
125-
return _channelFromParams(params, config)
126-
}

src/main/scala/io/viash/Main.scala

Lines changed: 9 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -198,36 +198,6 @@ object Main extends Logging {
198198
}
199199
case _ =>
200200
}
201-
202-
// backwards compability for --platform
203-
cli.subcommands.lastOption match {
204-
case Some(x: ViashCommand) =>
205-
if (x.platform.isDefined) {
206-
if (x.runner.isDefined || x.engine.isDefined) {
207-
throw new IllegalArgumentException("Error: --platform cannot be used together with --runner or --engine.")
208-
}
209-
warn("Warning: --platform is deprecated in Viash 0.9.0, will be removed in Viash 0.10.0. Use --runner or --engine instead.")
210-
}
211-
case Some(x: ViashNs) =>
212-
if (x.platform.isDefined) {
213-
if (x.runner.isDefined || x.engine.isDefined) {
214-
throw new IllegalArgumentException("Error: --platform cannot be used together with --runner or --engine.")
215-
}
216-
warn("Warning: --platform is deprecated in Viash 0.9.0, will be removed in Viash 0.10.0. Use --runner or --engine instead.")
217-
}
218-
case _ =>
219-
}
220-
// backwards compability for --apply_platform
221-
cli.subcommands match {
222-
case List(cli.namespace, cli.namespace.exec) =>
223-
if (cli.namespace.exec.applyPlatform()) {
224-
if (cli.namespace.exec.applyRunner() || cli.namespace.exec.applyEngine()) {
225-
throw new IllegalArgumentException("Error: --platform cannot be used together with --runner or --engine.")
226-
}
227-
warn("Warning: --apply_platform is deprecated in Viash 0.9.0, will be removed in Viash 0.10.0n. Use --apply_runner or --apply_engine instead.")
228-
}
229-
case _ =>
230-
}
231201

232202
// see if there are package overrides passed to the viash command
233203
val packSrc = cli.subcommands.lastOption match {
@@ -337,8 +307,8 @@ object Main extends Logging {
337307
cli.namespace.list,
338308
packageConfig = pack1,
339309
addOptMainScript = false,
340-
applyRunner = cli.namespace.list.runner.isDefined || cli.namespace.list.platform.isDefined,
341-
applyEngine = cli.namespace.list.engine.isDefined || cli.namespace.list.platform.isDefined
310+
applyRunner = cli.namespace.list.runner.isDefined,
311+
applyEngine = cli.namespace.list.engine.isDefined
342312
)
343313
val configs2 = namespaceDependencies(configs, None, pack1.rootDir)
344314
ViashNamespace.list(
@@ -351,8 +321,8 @@ object Main extends Logging {
351321
val configs = readConfigs(
352322
cli.namespace.exec,
353323
packageConfig = pack1,
354-
applyRunner = cli.namespace.exec.applyRunner() || cli.namespace.exec.applyPlatform(),
355-
applyEngine = cli.namespace.exec.applyEngine() || cli.namespace.exec.applyPlatform()
324+
applyRunner = cli.namespace.exec.applyRunner(),
325+
applyEngine = cli.namespace.exec.applyEngine()
356326
)
357327
ViashNamespace.exec(
358328
configs = configs,
@@ -371,7 +341,7 @@ object Main extends Logging {
371341
cli.config.view,
372342
packageConfig = pack1,
373343
addOptMainScript = false,
374-
applyRunnerAndEngine = cli.config.view.platform.isDefined || cli.config.view.runner.isDefined || cli.config.view.engine.isDefined
344+
applyRunnerAndEngine = cli.config.view.runner.isDefined || cli.config.view.engine.isDefined
375345
)
376346
val config2 = DependencyResolver.modifyConfig(config.config, None, pack1.rootDir)
377347
ViashConfig.view(
@@ -480,11 +450,8 @@ object Main extends Logging {
480450
viashPackage = Some(packageConfig)
481451
)
482452
if (applyRunnerAndEngine) {
483-
val runnerStr = subcommand.runner.toOption orElse subcommand.platform.toOption
484-
val engineStr = subcommand.engine.toOption orElse subcommand.platform.toOption
485-
486-
val runner = config.findRunner(runnerStr)
487-
val engines = config.findEngines(engineStr)
453+
val runner = config.findRunner(subcommand.runner.toOption)
454+
val engines = config.findEngines(subcommand.engine.toOption)
488455

489456
processConfigWithRunnerAndEngine(
490457
appliedConfig = config,
@@ -509,8 +476,8 @@ object Main extends Logging {
509476
val queryNamespace = subcommand.query_namespace.toOption
510477
val queryName = subcommand.query_name.toOption
511478
val queryConfig = subcommand.query_config.toOption
512-
val runnerStr = subcommand.runner.toOption orElse subcommand.platform.toOption
513-
val engineStr = subcommand.engine.toOption orElse subcommand.platform.toOption
479+
val runnerStr = subcommand.runner.toOption
480+
val engineStr = subcommand.engine.toOption
514481
val configMods = packageConfig.config_mods
515482

516483
val configs0 = Config.readConfigs(

src/main/scala/io/viash/ViashExport.scala

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,7 @@ object ViashExport extends Logging {
7676
}
7777

7878
def exportResource(input: String, output: Option[Path]): Unit = {
79-
val input2 = if (input.startsWith("platforms/")) {
80-
warn("WARNING: The 'platforms/' prefix is deprecated. Please use 'runners/' instead.")
81-
input.replaceFirst("platforms/", "runners/")
82-
} else {
83-
input
84-
}
85-
val pth = getClass.getResource(s"/io/viash/$input2")
79+
val pth = getClass.getResource(s"/io/viash/$input")
8680
val str = IO.read(pth.toURI())
8781
if (output.isDefined) {
8882
Files.write(output.get, str.getBytes())

src/main/scala/io/viash/ViashNamespace.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ object ViashNamespace extends Logging {
9898
val funName = ac.config.name
9999
val ns = ac.config.namespace
100100
val runnerId = ac.runner.get.id
101-
// val engineId = ac.platform.get.id
102101
val out =
103102
if (flatten) {
104103
target

src/main/scala/io/viash/cli/CLIConf.scala

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,6 @@ import io.viash.helpers.Logging
2424

2525
trait ViashCommand {
2626
this: DocumentedSubcommand =>
27-
val platform = registerOpt[String](
28-
name = "platform",
29-
short = Some('p'),
30-
default = None,
31-
descr =
32-
"Deprecated. Use --runner and --engine instead. " +
33-
"Specifies which platform amongst those specified in the config to use. " +
34-
"If this is not provided, the first platform will be used. " +
35-
"If no platforms are defined in the config, the native platform will be used. " +
36-
"In addition, the path to a platform yaml file can also be specified.",
37-
required = false
38-
)
3927
val runner = registerOpt[String](
4028
name = "runner",
4129
default = None,
@@ -113,18 +101,6 @@ trait ViashNs {
113101
descr = "A source directory containing viash config files, possibly structured in a hierarchical folder structure. Default: src/.",
114102
default = None
115103
)
116-
val platform = registerOpt[String](
117-
name = "platform",
118-
short = Some('p'),
119-
descr =
120-
"Deprecated. Use --runner and --engine instead. " +
121-
"Acts as a regular expression to filter the platform ids specified in the found config files. " +
122-
"If this is not provided, all platforms will be used. " +
123-
"If no platforms are defined in a config, the native platform will be used. " +
124-
"In addition, the path to a platform yaml file can also be specified.",
125-
default = None,
126-
required = false
127-
)
128104
val runner = registerOpt[String](
129105
name = "runner",
130106
default = None,
@@ -440,7 +416,6 @@ class CLIConf(arguments: Seq[String]) extends ScallopConf(arguments) with Loggin
440416
| * `{main-script}`: path to the main script (if any)
441417
| * `{abs-main-script}`: absolute path to the main script (if any)
442418
| * `{name}`: name of the component
443-
| * `{functionality-name}`: name of the component (deprecated)
444419
| * `{namespace}`: namespace of the component
445420
| * `{runner}`: selected runner id (only when --apply_runner is used)
446421
| * `{engine}`: selected engine id (only when --apply_engine is used)
@@ -453,16 +428,6 @@ class CLIConf(arguments: Seq[String]) extends ScallopConf(arguments) with Loggin
453428
"""viash ns exec 'echo {path} \\;'
454429
|viash ns exec 'chmod +x {main-script} +'""".stripMargin
455430
)
456-
val applyPlatform = registerOpt[Boolean] (
457-
name = "apply_platform",
458-
short = Some('a'),
459-
default = Some(false),
460-
descr =
461-
"""Deprecated. Use --apply_runner and --apply_engine instead.
462-
|Fills in the {platform} and {output} field by applying each platform to the
463-
|config separately. Note that this results in the provided command being applied
464-
|once for every platform that matches the --platform regex.""".stripMargin
465-
)
466431
val applyRunner = registerOpt[Boolean] (
467432
name = "apply_runner",
468433
short = Some('r'),

src/main/scala/io/viash/config/Config.scala

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ import io.viash.config_mods.ConfigModParser
2121
import arguments._
2222
import resources._
2323
import dependencies._
24-
import io.viash.functionality.Functionality
25-
import io.viash.platforms.Platform
2624
import io.viash.helpers.{Git, GitInfo, IO, Logging}
2725
import io.viash.helpers.circe._
2826
import io.viash.helpers.{status => BuildStatus};
@@ -384,14 +382,6 @@ case class Config(
384382
@undocumented
385383
package_config: Option[PackageConfig] = None,
386384
) {
387-
@description(
388-
"""The @[functionality](functionality) describes the behaviour of the script in terms of arguments and resources.
389-
|By specifying a few restrictions (e.g. mandatory arguments) and adding some descriptions, Viash will automatically generate a stylish command-line interface for you.
390-
|""")
391-
@deprecated("Functionality level is deprecated, all functionality fields are now located on the top level of the config file.", "0.9.0", "0.10.0")
392-
@default("")
393-
private val functionality: Functionality = Functionality("foo")
394-
395385
@description(
396386
"""A list of @[arguments](argument) for this component. For each argument, a type and a name must be specified. Depending on the type of argument, different properties can be set. See these reference pages per type for more information:
397387
|
@@ -414,17 +404,6 @@ case class Config(
414404
@example("__merge__: ../api/common_interface.yaml", "yaml")
415405
@since("Viash 0.6.3")
416406
private val `__merge__`: Option[File] = None
417-
418-
@description(
419-
"""A list of platforms to generate target artifacts for.
420-
|
421-
| - @[Native](platform_native)
422-
| - @[Docker](platform_docker)
423-
| - @[Nextflow](platform_nextflow)
424-
|""")
425-
@default("Empty")
426-
@deprecated("Use 'engines' and 'runners' instead.", "0.9.0", "0.10.0")
427-
private val platforms: List[Platform] = Nil
428407

429408
/**
430409
* Find the runner

0 commit comments

Comments
 (0)