File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
snakemake_interface_software_deployment_plugins Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ flake8 = "^4.0.1"
20
20
flake8-bugbear = " ^22.1.11"
21
21
pytest = " ^7.0"
22
22
snakemake = {git =" https://github.com/snakemake/snakemake.git" }
23
- snakemake-executor-plugin-cluster-generic = {git = " https://github.com/snakemake/snakemake-executor-plugin-cluster-generic.git" }
24
23
25
24
[tool .coverage .run ]
26
25
omit = [" .*" , " */site-packages/*" ]
Original file line number Diff line number Diff line change 6
6
from abc import ABC , abstractmethod
7
7
import hashlib
8
8
from pathlib import Path
9
+ import sys
9
10
from typing import List , Optional , Self
10
11
11
12
from snakemake_interface_software_deployment_plugins .settings import SoftwareDeploymentProviderSettingsBase
@@ -100,19 +101,24 @@ def __init__(
100
101
name : str ,
101
102
prefix : Path ,
102
103
settings : Optional [SoftwareDeploymentProviderSettingsBase ] = None ,
104
+ parent_env : Optional [EnvBase ] = None
103
105
):
104
106
self .settings = settings
105
107
self .deployment_path = prefix / name
106
108
self .archive_path = prefix / f"{ name } -archive"
109
+ self .parent_env = parent_env
107
110
self .__post_init__ ()
108
111
109
112
def __post_init__ (self ): # noqa B027
113
+ """Do stuff after object initialization, e.g. checking for availability of
114
+ commands.
115
+ """
110
116
pass
111
117
112
118
@classmethod
113
- @ abstractmethod
114
- def get_env_cls ( cls ) -> EnvBase :
115
- ...
119
+ def get_env_cls ( cls ):
120
+ provider = sys . modules [ cls . __module__ ] # get module of derived class
121
+ return provider . Env
116
122
117
123
def env (self , spec : EnvSpecBase ) -> EnvBase :
118
- return self .get_env_cls ()(self , spec )
124
+ return self .get_env_cls ()(provider = self , spec = spec , parent_env = self . parent_env )
You can’t perform that action at this time.
0 commit comments