From a2d451480eca5414e3ef8e66a5bf82f828d9aafb Mon Sep 17 00:00:00 2001
From: Pau Andrio <andriopau@gmail.com>
Date: Mon, 19 Dec 2022 12:44:19 +0100
Subject: [PATCH] 2022.4

---
 README.md                                   | 4 ++--
 biobb_common/__init__.py                    | 2 +-
 biobb_common/command_wrapper/cmd_wrapper.py | 2 +-
 biobb_common/docs/source/conf.py            | 2 +-
 biobb_common/docs/source/readme.md          | 4 ++--
 biobb_common/docs/source/schema.html        | 2 +-
 biobb_common/generic/biobb_object.py        | 5 ++---
 biobb_common/json_schemas/biobb_common.json | 6 +++---
 setup.py                                    | 4 ++--
 9 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/README.md b/README.md
index 8365a26..96ef699 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
 [![](https://readthedocs.org/projects/biobb-common/badge/?version=latest)](https://biobb-common.readthedocs.io/en/latest/?badge=latest)
 [![](https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg?style=flat)](https://anaconda.org/bioconda/biobb_common)
 [![](https://img.shields.io/badge/docker-Quay.io-blue)](https://quay.io/repository/biocontainers/biobb_common?tab=tags)
-[![](https://img.shields.io/badge/singularity-GalaxyProject-blue)](https://depot.galaxyproject.org/singularity/biobb_common:3.8.1--pyhdfd78af_0)
+[![](https://img.shields.io/badge/singularity-GalaxyProject-blue)](https://depot.galaxyproject.org/singularity/biobb_common:3.9.0--pyhdfd78af_0)
 [![](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
 
 
@@ -17,7 +17,7 @@ The latest documentation of this package can be found in our readthedocs site:
 [latest API documentation](http://biobb_common.readthedocs.io/en/latest/).
 
 ### Version
-v3.8.1 2022.3
+v3.9.0 2022.4
 
 ### Copyright & Licensing
 This software has been developed in the [MMB group](http://mmb.irbbarcelona.org) at the [BSC](http://www.bsc.es/) & [IRB](https://www.irbbarcelona.org/) for the [European BioExcel](http://bioexcel.eu/), funded by the European Commission (EU H2020 [823830](http://cordis.europa.eu/projects/823830), EU H2020 [675728](http://cordis.europa.eu/projects/675728)).
diff --git a/biobb_common/__init__.py b/biobb_common/__init__.py
index 3fe3e64..539e658 100644
--- a/biobb_common/__init__.py
+++ b/biobb_common/__init__.py
@@ -1,2 +1,2 @@
 name = "biobb_common"
-__version__ = "3.8.1"
+__version__ = "3.9.0"
diff --git a/biobb_common/command_wrapper/cmd_wrapper.py b/biobb_common/command_wrapper/cmd_wrapper.py
index 1c098b3..087b909 100644
--- a/biobb_common/command_wrapper/cmd_wrapper.py
+++ b/biobb_common/command_wrapper/cmd_wrapper.py
@@ -29,7 +29,7 @@ class CmdWrapper:
         else:
             self.out_log.info(cmd + '\n')
 
-        new_env = self.env if self.env else os.environ.copy()
+        new_env = {**os.environ.copy(), **self.env} if self.env else os.environ.copy()
         process = subprocess.Popen(cmd,
                                    stdout=subprocess.PIPE,
                                    stderr=subprocess.PIPE,
diff --git a/biobb_common/docs/source/conf.py b/biobb_common/docs/source/conf.py
index 43039d5..923b1eb 100644
--- a/biobb_common/docs/source/conf.py
+++ b/biobb_common/docs/source/conf.py
@@ -75,7 +75,7 @@ author = u'Bioexcel Project'
 # built documents.
 #
 # The short X.Y version.
-version = u'3.8.1'
+version = u'3.9.0'
 # The full version, including alpha/beta/rc tags.
 release = u'2022.3'
 
diff --git a/biobb_common/docs/source/readme.md b/biobb_common/docs/source/readme.md
index 8365a26..96ef699 100644
--- a/biobb_common/docs/source/readme.md
+++ b/biobb_common/docs/source/readme.md
@@ -1,7 +1,7 @@
 [![](https://readthedocs.org/projects/biobb-common/badge/?version=latest)](https://biobb-common.readthedocs.io/en/latest/?badge=latest)
 [![](https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg?style=flat)](https://anaconda.org/bioconda/biobb_common)
 [![](https://img.shields.io/badge/docker-Quay.io-blue)](https://quay.io/repository/biocontainers/biobb_common?tab=tags)
-[![](https://img.shields.io/badge/singularity-GalaxyProject-blue)](https://depot.galaxyproject.org/singularity/biobb_common:3.8.1--pyhdfd78af_0)
+[![](https://img.shields.io/badge/singularity-GalaxyProject-blue)](https://depot.galaxyproject.org/singularity/biobb_common:3.9.0--pyhdfd78af_0)
 [![](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
 
 
@@ -17,7 +17,7 @@ The latest documentation of this package can be found in our readthedocs site:
 [latest API documentation](http://biobb_common.readthedocs.io/en/latest/).
 
 ### Version
-v3.8.1 2022.3
+v3.9.0 2022.4
 
 ### Copyright & Licensing
 This software has been developed in the [MMB group](http://mmb.irbbarcelona.org) at the [BSC](http://www.bsc.es/) & [IRB](https://www.irbbarcelona.org/) for the [European BioExcel](http://bioexcel.eu/), funded by the European Commission (EU H2020 [823830](http://cordis.europa.eu/projects/823830), EU H2020 [675728](http://cordis.europa.eu/projects/675728)).
diff --git a/biobb_common/docs/source/schema.html b/biobb_common/docs/source/schema.html
index 1a32b13..ffac064 100644
--- a/biobb_common/docs/source/schema.html
+++ b/biobb_common/docs/source/schema.html
@@ -10,7 +10,7 @@
   "applicationSubCategory": "http://www.edamontology.org/topic_3892",
   "citation": "https://www.nature.com/articles/s41597-019-0177-4",
   "license": "https://www.apache.org/licenses/LICENSE-2.0",
-  "softwareVersion": "3.8.1",
+  "softwareVersion": "3.9.0",
   "applicationSuite": "BioBB BioExcel Building Blocks",
   "codeRepository": "https://github.com/bioexcel/biobb_common",
   "isAccessibleForFree": "True",
diff --git a/biobb_common/generic/biobb_object.py b/biobb_common/generic/biobb_object.py
index 4f2d857..37e8204 100644
--- a/biobb_common/generic/biobb_object.py
+++ b/biobb_common/generic/biobb_object.py
@@ -63,10 +63,9 @@ class BiobbObject:
         self.remove_tmp = properties.get('remove_tmp', True)
         self.restart = properties.get('restart', False)
         self.cmd = []
-        self.environment = None
         self.return_code = None
         self.tmp_files = []
-        self.env_vars_dict: typing.Mapping = {}
+        self.env_vars_dict: typing.Mapping = properties.get('check_extensions', {})
 
         self.dev = properties.get('dev', None)
         self.check_extensions = properties.get('check_extensions', True)
@@ -258,7 +257,7 @@ class BiobbObject:
             # fu.log('Not using any container', self.out_log, self.global_log)
 
     def execute_command(self):
-        self.return_code = cmd_wrapper.CmdWrapper(self.cmd, self.out_log, self.err_log, self.global_log, self.environment).launch()
+        self.return_code = cmd_wrapper.CmdWrapper(self.cmd, self.out_log, self.err_log, self.global_log, self.env_vars_dict).launch()
 
     def copy_to_host(self):
         for file_ref, file_path in self.stage_io_dict["out"].items():
diff --git a/biobb_common/json_schemas/biobb_common.json b/biobb_common/json_schemas/biobb_common.json
index afbcd33..c033a2b 100644
--- a/biobb_common/json_schemas/biobb_common.json
+++ b/biobb_common/json_schemas/biobb_common.json
@@ -6,7 +6,7 @@
     "conda": "https://anaconda.org/bioconda/biobb_common",
     "docker": "https://quay.io/biocontainers/biobb_common:3.8.1--pyhdfd78af_0",
     "singularity": "https://depot.galaxyproject.org/singularity/biobb_common:3.8.1--pyhdfd78af_0",
-    "version": "3.8.1",
+    "version": "3.9.0",
     "tools" : [
         {
             "block" : "",
@@ -16,10 +16,10 @@
     ],
     "dep_pypi" : [
         "install_requires=['pyyaml', 'requests', 'biopython==1.79']",
-        "python_requires='>=3.7'"
+        "python_requires='>=3.7,<3.10'"
     ],
     "dep_conda" : [
-        "python >=3.7",
+        "python >=3.7,<3.10",
         "pyyaml",
         "requests",
         "biopython ==1.79"
diff --git a/setup.py b/setup.py
index 0cc69e2..ebf562c 100644
--- a/setup.py
+++ b/setup.py
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
 
 setuptools.setup(
     name="biobb_common",
-    version="3.8.1",
+    version="3.9.0",
     author="Biobb developers",
     author_email="pau.andrio@bsc.es",
     description="Biobb_common is the base package required to use the biobb packages.",
@@ -19,7 +19,7 @@ setuptools.setup(
     },
     packages=setuptools.find_packages(exclude=['docs']),
     install_requires=['pyyaml', 'requests', 'biopython==1.79'],
-    python_requires='>=3.7',
+    python_requires='>=3.7,<3.10',
     classifiers=(
         "Development Status :: 3 - Alpha",
         "Programming Language :: Python :: 3.7",
-- 
GitLab