[med-svn] [Git][med-team/q2cli][upstream] New upstream version 2024.5.0
Michael R. Crusoe (@crusoe)
gitlab at salsa.debian.org
Tue Jun 25 03:26:02 BST 2024
Michael R. Crusoe pushed to branch upstream at Debian Med / q2cli
Commits:
d9f39410 by Michael R. Crusoe at 2024-06-25T03:51:58+02:00
New upstream version 2024.5.0
- - - - -
4 changed files:
- q2cli/_version.py
- q2cli/tests/test_cache_cli.py
- q2cli/tests/test_core.py
- q2cli/util.py
Changes:
=====================================
q2cli/_version.py
=====================================
@@ -23,9 +23,9 @@ def get_keywords():
# setup.py/versioneer.py will grep for the variable names, so they must
# each be defined on a line of their own. _version.py will just call
# get_keywords().
- git_refnames = " (tag: 2024.2.0, Release-2024.2)"
- git_full = "722997ebe6be5973716cc5f3e9f0bbd4ce722095"
- git_date = "2024-02-16 21:49:58 +0000"
+ git_refnames = " (tag: 2024.5.0, Release-2024.5)"
+ git_full = "2bbd82625406a601add2182ad087aaeae0d1d701"
+ git_date = "2024-05-29 04:19:12 +0000"
keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
return keywords
=====================================
q2cli/tests/test_cache_cli.py
=====================================
@@ -730,8 +730,8 @@ class TestCacheCli(unittest.TestCase):
art2_path = str(self.cache.path) + ':art2'
art3_path = str(self.cache.path) + ':art3'
- out_path = str(self.cache.path) + ':not_valid_identifier$&;'
-
+ invalid = 'not_valid_identifier$&;'
+ out_path = str(self.cache.path) + ':' + invalid
result = self._run_command(
'concatenate-ints', '--i-ints1', art1_path, '--i-ints2', art2_path,
'--i-ints3', art3_path, '--p-int1', '9', '--p-int2', '10',
@@ -739,7 +739,7 @@ class TestCacheCli(unittest.TestCase):
)
self.assertEqual(result.exit_code, 1)
- self.assertIn('Keys must be valid Python identifiers',
+ self.assertIn(f"Key '{invalid}' is not a valid Python identifier",
str(result.exception))
def test_artifact_as_metadata_cache(self):
=====================================
q2cli/tests/test_core.py
=====================================
@@ -26,7 +26,7 @@ from qiime2.sdk import PluginManager
from qiime2.core.archive.provenance_lib import DummyArtifacts, ProvDAG
from qiime2.core.archive.provenance_lib.replay import (
ReplayConfig, param_is_metadata_column, dump_recorded_md_file,
- NamespaceCollections, build_import_usage, build_action_usage,
+ ReplayNamespaces, build_import_usage, build_action_usage,
ActionCollections, replay_provenance, replay_supplement
)
from qiime2.core.archive.provenance_lib.usage_drivers import ReplayPythonUsage
@@ -283,7 +283,7 @@ class ReplayCLIUsageTests(unittest.TestCase):
self.assertTrue(out_path2.is_file())
def test_build_import_usage_cli(self):
- ns = NamespaceCollections()
+ ns = ReplayNamespaces()
cfg = ReplayConfig(use=ReplayCLIUsage(),
use_recorded_metadata=False, pm=self.pm)
dag = self.das.concated_ints_v6.dag
@@ -293,12 +293,12 @@ class ReplayCLIUsageTests(unittest.TestCase):
unq_var_nm = c_to_s_type + '_0'
build_import_usage(import_node, ns, cfg)
rendered = cfg.use.render()
- vars = ns.usg_vars
- out_name = vars[import_uuid].to_interface_name()
+ usg_var = ns.get_usg_var_record(import_uuid).variable
+ out_name = usg_var.to_interface_name()
- self.assertIsInstance(vars[import_uuid], UsageVariable)
- self.assertEqual(vars[import_uuid].var_type, 'artifact')
- self.assertEqual(vars[import_uuid].name, unq_var_nm)
+ self.assertIsInstance(usg_var, UsageVariable)
+ self.assertEqual(usg_var.var_type, 'artifact')
+ self.assertEqual(usg_var.name, unq_var_nm)
self.assertRegex(rendered, r'qiime tools import \\')
self.assertRegex(rendered, f" --type '{import_node.type}'")
self.assertRegex(rendered, " --input-path <your data here>")
@@ -310,7 +310,7 @@ class ReplayCLIUsageTests(unittest.TestCase):
cfg = ReplayConfig(use=ReplayCLIUsage(),
use_recorded_metadata=False, pm=self.pm)
- ns = NamespaceCollections()
+ ns = ReplayNamespaces()
import_var_1 = CLIUsageVariable(
'imported_ints_0', lambda: None, 'artifact', cfg.use
)
@@ -319,10 +319,10 @@ class ReplayCLIUsageTests(unittest.TestCase):
)
import_uuid_1 = '8dea2f1a-2164-4a85-9f7d-e0641b1db22b'
import_uuid_2 = '7727c060-5384-445d-b007-b64b41a090ee'
- ns.usg_vars = {
- import_uuid_1: import_var_1,
- import_uuid_2: import_var_2
- }
+ ns.add_usg_var_record(import_uuid_1, 'imported_ints_0')
+ ns.update_usg_var_record(import_uuid_1, import_var_1)
+ ns.add_usg_var_record(import_uuid_2, 'imported_ints_1')
+ ns.update_usg_var_record(import_uuid_2, import_var_2)
dag = self.das.concated_ints_v6.dag
action_uuid = '5035a60e-6f9a-40d4-b412-48ae52255bb5'
@@ -334,12 +334,13 @@ class ReplayCLIUsageTests(unittest.TestCase):
unique_var_name = node.action.output_name + '_0'
build_action_usage(node, ns, actions.std_actions, action_uuid, cfg)
rendered = cfg.use.render()
- out_name = ns.usg_vars[node_uuid].to_interface_name()
- vars = ns.usg_vars
- self.assertIsInstance(vars[node_uuid], UsageVariable)
- self.assertEqual(vars[node_uuid].var_type, 'artifact')
- self.assertEqual(vars[node_uuid].name, unique_var_name)
+ usg_var = ns.get_usg_var_record(node_uuid).variable
+ out_name = usg_var.to_interface_name()
+
+ self.assertIsInstance(usg_var, UsageVariable)
+ self.assertEqual(usg_var.var_type, 'artifact')
+ self.assertEqual(usg_var.name, unique_var_name)
self.assertIn(f'qiime {plugin} {action}', rendered)
self.assertIn('--i-ints1 imported-ints-0.qza', rendered)
=====================================
q2cli/util.py
=====================================
@@ -107,14 +107,8 @@ def output_in_cache(fp):
try:
if Cache.is_cache(cache_path):
- if not key.isidentifier():
- raise ValueError(
- f"Key '{key}' is not a valid Python identifier. Keys must "
- "be valid Python identifiers. Python identifier rules may "
- "be found here https://www.askpython.com/python/"
- "python-identifiers-rules-best-practices")
- else:
- return True
+ Cache.validate_key(key)
+ return True
except FileNotFoundError as e:
# If cache_path doesn't exist, don't treat this as a cache output
if 'No such file or directory' in str(e):
View it on GitLab: https://salsa.debian.org/med-team/q2cli/-/commit/d9f39410059660a83a3a6ac948e59184d894c10d
--
This project does not include diff previews in email notifications.
View it on GitLab: https://salsa.debian.org/med-team/q2cli/-/commit/d9f39410059660a83a3a6ac948e59184d894c10d
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20240625/4a71ffad/attachment-0001.htm>
More information about the debian-med-commit
mailing list