cumulusci-plus 5.0.21__py3-none-any.whl → 5.0.21.dev0__py3-none-any.whl

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.

Potentially problematic release.


This version of cumulusci-plus might be problematic. Click here for more details.

cumulusci/__about__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "5.0.21"
1
+ __version__ = "5.0.21.dev0"
cumulusci/cumulusci.yml CHANGED
@@ -749,6 +749,14 @@ tasks:
749
749
  options:
750
750
  level: info
751
751
  group: Utilities
752
+ copy_file:
753
+ description: "Copy a file for src to dest with environment variable support, Ex: &TMPDIR&/src resolves to /tmp/src on linux or %TMPDIR%/src on windows."
754
+ class_path: cumulusci.tasks.util.CopyFile
755
+ group: Utilities
756
+ load_dot_env:
757
+ description: "Log the contents of the .env file"
758
+ class_path: cumulusci.tasks.util.LoadDotEnv
759
+ group: Utilities
752
760
  configure_env:
753
761
  description: Get or set environment variables.
754
762
  class_path: cumulusci.tasks.utility.env_management.EnvManagement
@@ -182,6 +182,47 @@ class TestUtilTasks:
182
182
 
183
183
  assert os.path.exists(dest)
184
184
 
185
+ @pytest.mark.skipif(os.name == "posix", reason="Only run on POSIX systems")
186
+ def test_CopyFileVars(self):
187
+ src_expanded = os.path.expandvars(os.path.join("$TMPDIR", "src"))
188
+ with open(src_expanded, "w"):
189
+ pass
190
+
191
+ src = os.path.join("&TMPDIR&", "src")
192
+ dest = os.path.join("&TMPDIR&", "dest")
193
+
194
+ task_config = TaskConfig({"options": {"src": src, "dest": dest}})
195
+ task = util.CopyFile(self.project_config, task_config, self.org_config)
196
+ task()
197
+
198
+ assert os.path.exists(os.path.expandvars(os.path.join("$TMPDIR", "dest")))
199
+
200
+ def test_CopyFileVars_Windows(self):
201
+ """Test CopyFile environment variable replacement on Windows."""
202
+ with mock.patch("os.name", "nt"): # Mock Windows
203
+ src = os.path.join("&TMPDIR&", "src")
204
+ dest = os.path.join("&TMPDIR&", "dest")
205
+
206
+ task_config = TaskConfig({"options": {"src": src, "dest": dest}})
207
+ task = util.CopyFile(self.project_config, task_config, self.org_config)
208
+
209
+ # On Windows, &TMPDIR& should become %TMPDIR%
210
+ assert task.options["src"] == os.path.join("%TMPDIR%", "src")
211
+ assert task.options["dest"] == os.path.join("%TMPDIR%", "dest")
212
+
213
+ def test_CopyFileVars_POSIX(self):
214
+ """Test CopyFile environment variable replacement on POSIX."""
215
+ with mock.patch("os.name", "posix"): # Mock POSIX
216
+ src = os.path.join("&TMPDIR&", "src")
217
+ dest = os.path.join("&TMPDIR&", "dest")
218
+
219
+ task_config = TaskConfig({"options": {"src": src, "dest": dest}})
220
+ task = util.CopyFile(self.project_config, task_config, self.org_config)
221
+
222
+ # On POSIX, &TMPDIR& should become $TMPDIR
223
+ assert task.options["src"] == os.path.join("$TMPDIR", "src")
224
+ assert task.options["dest"] == os.path.join("$TMPDIR", "dest")
225
+
185
226
  def test_LogLine(self):
186
227
  task_config = TaskConfig({"options": {"level": "debug", "line": "test"}})
187
228
  task = util.LogLine(self.project_config, task_config, self.org_config)
cumulusci/tasks/util.py CHANGED
@@ -1,5 +1,6 @@
1
1
  import glob
2
2
  import os
3
+ import re
3
4
  import shutil
4
5
  import time
5
6
 
@@ -220,9 +221,44 @@ class CopyFile(BaseTask):
220
221
  },
221
222
  }
222
223
 
224
+ def _init_options(self, kwargs):
225
+ super(CopyFile, self)._init_options(kwargs)
226
+ self.options["src"] = self.replace_env_vars(self.options["src"])
227
+ self.options["dest"] = self.replace_env_vars(self.options["dest"])
228
+
223
229
  def _run_task(self):
224
230
  self.logger.info("Copying file {src} to {dest}".format(**self.options))
225
- shutil.copyfile(src=self.options["src"], dst=self.options["dest"])
231
+ shutil.copyfile(
232
+ src=os.path.expandvars(self.options["src"]),
233
+ dst=os.path.expandvars(self.options["dest"]),
234
+ )
235
+
236
+ def replace_env_vars(self, text):
237
+ """
238
+ Environment variable replacement that handles:
239
+ - &VAR& -> $VAR (POSIX) or %VAR% (Windows)
240
+ """
241
+ if not text:
242
+ return text
243
+
244
+ pattern = r"\&([A-Za-z_][A-Za-z0-9_]*)\&"
245
+ if os.name == "posix":
246
+ # POSIX: Convert &VAR& to $VAR
247
+ replacement = r"$\1"
248
+ else:
249
+ # Windows: Convert &VAR$ to %VAR%
250
+ replacement = r"%\1%"
251
+
252
+ return re.sub(pattern, replacement, text)
253
+
254
+
255
+ class LoadDotEnv(BaseTask):
256
+ def _run_task(self):
257
+ from dotenv import load_dotenv
258
+
259
+ load_dotenv()
260
+
261
+ self.logger.info("Loaded .env file")
226
262
 
227
263
 
228
264
  class LogLine(BaseTask):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cumulusci-plus
3
- Version: 5.0.21
3
+ Version: 5.0.21.dev0
4
4
  Summary: Build and release tools for Salesforce developers
5
5
  Project-URL: Homepage, https://github.com/jorgesolebur/CumulusCI
6
6
  Project-URL: Changelog, https://cumulusci.readthedocs.io/en/stable/history.html
@@ -35,6 +35,7 @@ Requires-Dist: psutil
35
35
  Requires-Dist: pydantic<2
36
36
  Requires-Dist: pyjwt
37
37
  Requires-Dist: python-dateutil
38
+ Requires-Dist: python-dotenv
38
39
  Requires-Dist: pytz
39
40
  Requires-Dist: pyyaml
40
41
  Requires-Dist: requests
@@ -1,8 +1,8 @@
1
- cumulusci/__about__.py,sha256=GkhyUEGaKn6DXJU6Qo79adooo63Qsz8_lNr8trY06TE,23
1
+ cumulusci/__about__.py,sha256=i3WMS_7Fb8CAKGyU--F6gXeqPc104FDF2sr-0guxcIQ,28
2
2
  cumulusci/__init__.py,sha256=jdanFQ_i8vbdO7Eltsf4pOfvV4mwa_Osyc4gxWKJ8ng,764
3
3
  cumulusci/__main__.py,sha256=kgRH-n5AJrH_daCK_EJwH7azAUxdXEmpi-r-dPGMR6Y,43
4
4
  cumulusci/conftest.py,sha256=AIL98BDwNAQtdo8YFmLKwav0tmrQ5dpbw1cX2FyGouQ,5108
5
- cumulusci/cumulusci.yml,sha256=5w0fVZqfgWu-RkNN_uHt1HnZqpDM0f4WySCNxpcLjE4,73262
5
+ cumulusci/cumulusci.yml,sha256=qkUOhpQwa75QUL1fZZPHGqDS3UXkGnAi81mEYv0R92Y,73665
6
6
  cumulusci/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  cumulusci/cli/cci.py,sha256=yAq8jFoGde6g_1TeAAjzZYsk77itiONCQGBFe3g3nOs,11836
8
8
  cumulusci/cli/error.py,sha256=znj0YN8D2Grozm1u7mZAsJlmmdGebbuy0c1ofQluL4Q,4410
@@ -235,7 +235,7 @@ cumulusci/tasks/dx_convert_from.py,sha256=io-6S3Kfp86GR7CAsHyFhPAW6XEtVKWVeJdNO0
235
235
  cumulusci/tasks/metadeploy.py,sha256=33AX5701G2fyu42wNY9mitKAXq04Dxpg_WMIK59d4P8,15787
236
236
  cumulusci/tasks/metaxml.py,sha256=S71Q1a9ovt3kYNoMAJRO-f2UsYSROYUWt278tfFTeaU,3547
237
237
  cumulusci/tasks/sfdx.py,sha256=hZQls5HMG_NfeqgfkhfG-VcuzF3WSWVWZWKivVGAPgo,2627
238
- cumulusci/tasks/util.py,sha256=FqUhbW2AQ1-yS4ozpNoSI13TwY3lqTaf9Zfu5dqK2NE,8531
238
+ cumulusci/tasks/util.py,sha256=FDd4dl-P6fSwvg1jU0508hoV9G8eeDeu5aDQ_dwZQ5k,9534
239
239
  cumulusci/tasks/apex/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
240
240
  cumulusci/tasks/apex/anon.py,sha256=vlCD2E_jG9jwoQgsFs6RU8g8z1aN2g30edVYcZVshFE,5923
241
241
  cumulusci/tasks/apex/batch.py,sha256=TeDy3KeJBbtdzQXG8eoH0fcUCnRgU8XGAsePc3iXzT8,6779
@@ -612,7 +612,7 @@ cumulusci/tasks/tests/test_promote_package_version.py,sha256=6sitwrB8kUnnOH943em
612
612
  cumulusci/tasks/tests/test_pushfails.py,sha256=9JG9D0iD4dR-1fKheaRN7BEy3lzzuOKeRnQy03cwvZk,3214
613
613
  cumulusci/tasks/tests/test_salesforce.py,sha256=yCGtuHapxyAEmXQhuF2g2fh2naknTu7Md4OfEJQvGAA,2594
614
614
  cumulusci/tasks/tests/test_sfdx.py,sha256=oUbHo28d796m5RuskXMLitJw2rCLjjXIfxggzr4gsso,3545
615
- cumulusci/tasks/tests/test_util.py,sha256=D1T0QnvPTS0PHeZWo2xiVgE1jVTYcLzGTGHwEIoVmxk,7296
615
+ cumulusci/tasks/tests/test_util.py,sha256=qejX50N8RjHLg_qoF-TkqhAFlAgKHjJKrYMRw1DaXa4,9174
616
616
  cumulusci/tasks/utility/env_management.py,sha256=hJX6ySEiXD2oFW38JqbGQKMj89ucxdSBsPwytSdkgO8,6591
617
617
  cumulusci/tasks/utility/tests/test_env_management.py,sha256=fw34meWGOe1YYZO449MMCi2O7BgSaOA_I_wScrIr1Uk,8702
618
618
  cumulusci/tasks/vcs/__init__.py,sha256=ZzpMZnhooXZ6r_ywBVTS3UNw9uMcXW6h33LylRqTDK0,700
@@ -740,9 +740,9 @@ cumulusci/vcs/tests/dummy_service.py,sha256=RltOUpMIhSDNrfxk0LhLqlH4ppC0sK6NC2cO
740
740
  cumulusci/vcs/tests/test_vcs_base.py,sha256=9mp6uZ3lTxY4onjUNCucp9N9aB3UylKS7_2Zu_hdAZw,24331
741
741
  cumulusci/vcs/tests/test_vcs_bootstrap.py,sha256=N0NA48-rGNIIjY3Z7PtVnNwHObSlEGDk2K55TQGI8g4,27954
742
742
  cumulusci/vcs/utils/__init__.py,sha256=py4fEcHM7Vd0M0XWznOlywxaeCtG3nEVGmELmEKVGU8,869
743
- cumulusci_plus-5.0.21.dist-info/METADATA,sha256=UBDHG9IrjrryteDIlpuyX65BZsz44DcsjJCbMXm2-gs,5783
744
- cumulusci_plus-5.0.21.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
745
- cumulusci_plus-5.0.21.dist-info/entry_points.txt,sha256=nTtu04b9iLXhzADcTrb5PwmdXE6e2MTUAMh9OK6Z2pg,80
746
- cumulusci_plus-5.0.21.dist-info/licenses/AUTHORS.rst,sha256=PvewjKImdKPhhJ6xR2EEZ4T7GbpY2ZeAeyWm2aLtiMQ,676
747
- cumulusci_plus-5.0.21.dist-info/licenses/LICENSE,sha256=NFsF_s7RVXk2dU6tmRAN8wF45pnD98VZ5IwqOsyBcaU,1499
748
- cumulusci_plus-5.0.21.dist-info/RECORD,,
743
+ cumulusci_plus-5.0.21.dev0.dist-info/METADATA,sha256=wDMcEEuJ5nmE66hia9v48C7F7eXbt_CQaDgSthL6vCo,5817
744
+ cumulusci_plus-5.0.21.dev0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
745
+ cumulusci_plus-5.0.21.dev0.dist-info/entry_points.txt,sha256=nTtu04b9iLXhzADcTrb5PwmdXE6e2MTUAMh9OK6Z2pg,80
746
+ cumulusci_plus-5.0.21.dev0.dist-info/licenses/AUTHORS.rst,sha256=PvewjKImdKPhhJ6xR2EEZ4T7GbpY2ZeAeyWm2aLtiMQ,676
747
+ cumulusci_plus-5.0.21.dev0.dist-info/licenses/LICENSE,sha256=NFsF_s7RVXk2dU6tmRAN8wF45pnD98VZ5IwqOsyBcaU,1499
748
+ cumulusci_plus-5.0.21.dev0.dist-info/RECORD,,