envstack 0.6.1__tar.gz → 0.6.2__tar.gz

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.
Files changed (25) hide show
  1. {envstack-0.6.1/lib/envstack.egg-info → envstack-0.6.2}/PKG-INFO +16 -4
  2. {envstack-0.6.1 → envstack-0.6.2}/README.md +3 -3
  3. {envstack-0.6.1 → envstack-0.6.2}/dist.json +4 -0
  4. {envstack-0.6.1 → envstack-0.6.2}/lib/envstack/__init__.py +1 -1
  5. {envstack-0.6.1 → envstack-0.6.2}/lib/envstack/wrapper.py +18 -3
  6. {envstack-0.6.1 → envstack-0.6.2/lib/envstack.egg-info}/PKG-INFO +16 -4
  7. {envstack-0.6.1 → envstack-0.6.2}/setup.py +19 -1
  8. {envstack-0.6.1 → envstack-0.6.2}/LICENSE +0 -0
  9. {envstack-0.6.1 → envstack-0.6.2}/dev.env +0 -0
  10. {envstack-0.6.1 → envstack-0.6.2}/lib/envstack/cli.py +0 -0
  11. {envstack-0.6.1 → envstack-0.6.2}/lib/envstack/config.py +0 -0
  12. {envstack-0.6.1 → envstack-0.6.2}/lib/envstack/env.py +0 -0
  13. {envstack-0.6.1 → envstack-0.6.2}/lib/envstack/exceptions.py +0 -0
  14. {envstack-0.6.1 → envstack-0.6.2}/lib/envstack/logger.py +0 -0
  15. {envstack-0.6.1 → envstack-0.6.2}/lib/envstack/path.py +0 -0
  16. {envstack-0.6.1 → envstack-0.6.2}/lib/envstack.egg-info/SOURCES.txt +0 -0
  17. {envstack-0.6.1 → envstack-0.6.2}/lib/envstack.egg-info/dependency_links.txt +0 -0
  18. {envstack-0.6.1 → envstack-0.6.2}/lib/envstack.egg-info/entry_points.txt +0 -0
  19. {envstack-0.6.1 → envstack-0.6.2}/lib/envstack.egg-info/not-zip-safe +0 -0
  20. {envstack-0.6.1 → envstack-0.6.2}/lib/envstack.egg-info/requires.txt +0 -0
  21. {envstack-0.6.1 → envstack-0.6.2}/lib/envstack.egg-info/top_level.txt +0 -0
  22. {envstack-0.6.1 → envstack-0.6.2}/setup.cfg +0 -0
  23. {envstack-0.6.1 → envstack-0.6.2}/stack.env +0 -0
  24. {envstack-0.6.1 → envstack-0.6.2}/tests/test_env.py +0 -0
  25. {envstack-0.6.1 → envstack-0.6.2}/tests/test_path.py +0 -0
@@ -1,10 +1,22 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: envstack
3
- Version: 0.6.1
3
+ Version: 0.6.2
4
4
  Summary: Stacked environment variable management system
5
5
  Home-page: http://github.com/rsgalloway/envstack
6
6
  Author: Ryan Galloway
7
7
  Author-email: ryan@rsgalloway.com
8
+ License: BSD 3-Clause License
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Topic :: Software Development :: Libraries
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.6
14
+ Classifier: Programming Language :: Python :: 3.7
15
+ Classifier: Programming Language :: Python :: 3.8
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Requires-Python: >=3.6
8
20
  Description-Content-Type: text/markdown
9
21
  License-File: LICENSE
10
22
  Requires-Dist: PyYAML>=5.1.2
@@ -77,9 +89,9 @@ You can override anything in the environment stack by setting values in the
77
89
  local environment first:
78
90
 
79
91
  ```bash
80
- $ envstack -- echo \$HELLO
92
+ $ envstack -- echo {HELLO}
81
93
  world
82
- $ HELLO=goodbye envstack -- echo \$HELLO
94
+ $ HELLO=goodbye envstack -- echo {HELLO}
83
95
  goodbye
84
96
  ```
85
97
 
@@ -201,7 +213,7 @@ $ envstack [STACK] -- [COMMAND]
201
213
  For example:
202
214
 
203
215
  ```bash
204
- $ envstack -- echo \$HELLO
216
+ $ envstack -- echo {HELLO}
205
217
  world
206
218
  ```
207
219
 
@@ -66,9 +66,9 @@ You can override anything in the environment stack by setting values in the
66
66
  local environment first:
67
67
 
68
68
  ```bash
69
- $ envstack -- echo \$HELLO
69
+ $ envstack -- echo {HELLO}
70
70
  world
71
- $ HELLO=goodbye envstack -- echo \$HELLO
71
+ $ HELLO=goodbye envstack -- echo {HELLO}
72
72
  goodbye
73
73
  ```
74
74
 
@@ -190,7 +190,7 @@ $ envstack [STACK] -- [COMMAND]
190
190
  For example:
191
191
 
192
192
  ```bash
193
- $ envstack -- echo \$HELLO
193
+ $ envstack -- echo {HELLO}
194
194
  world
195
195
  ```
196
196
 
@@ -13,6 +13,10 @@
13
13
  "source": "bin/envstack",
14
14
  "destination": "{DEPLOY_ROOT}/bin/envstack"
15
15
  },
16
+ "bat-envstack": {
17
+ "source": "bin/envstack.bat",
18
+ "destination": "{DEPLOY_ROOT}/bin/envstack.bat"
19
+ },
16
20
  "bin-hello": {
17
21
  "source": "bin/hello",
18
22
  "destination": "{DEPLOY_ROOT}/bin/hello"
@@ -34,6 +34,6 @@ Stacked environment variable management system.
34
34
  """
35
35
 
36
36
  __prog__ = "envstack"
37
- __version__ = "0.6.1"
37
+ __version__ = "0.6.2"
38
38
 
39
39
  from envstack.env import Env, getenv, init, load_file
@@ -49,6 +49,14 @@ def to_args(cmd):
49
49
  return shlex.split(cmd)
50
50
 
51
51
 
52
+ def shell_join(args):
53
+ """Joins a list of arguments into a single quoted shell string."""
54
+ try:
55
+ return shlex.join(args)
56
+ except AttributeError:
57
+ return " ".join(shlex.quote(arg) for arg in args)
58
+
59
+
52
60
  class Wrapper(object):
53
61
  """Wrapper class for executables. Subprocessed with preconfigured environment.
54
62
 
@@ -233,15 +241,22 @@ def run_command(command, namespace=config.DEFAULT_NAMESPACE):
233
241
 
234
242
  >>> run_command(['ls', '-l'], 'my-stack')
235
243
 
244
+ - Automatically detects the shell to use based on the config.SHELL value.
245
+ - Converts {VAR} to $VAR for bash, sh, zsh, and %VAR% for cmd.
246
+
236
247
  :param command: command to run as a list of arguments
237
248
  :param namespace: environment stack namespace (default: 'stack')
238
- :returns: exit code
249
+ :returns: command exit code
239
250
  """
240
251
  logger.setup_stream_handler()
241
252
  if config.SHELL in ["bash", "sh", "zsh"]:
242
- cmd = ShellWrapper(namespace, shlex.join(command))
253
+ # convert {VAR} to ${VAR}, e.g. 'echo {VAR}' -> 'echo ${VAR}'
254
+ command = re.sub(r"\{(\w+)\}", r"${\1}", shell_join(command))
255
+ cmd = ShellWrapper(namespace, command)
243
256
  elif config.SHELL in ["cmd"]:
244
- cmd = CmdWrapper(namespace, " ".join(command))
257
+ # convert {VAR} to %VAR%, e.g. 'echo {VAR}' -> 'echo %VAR%'
258
+ command = re.sub(r"\{(\w+)\}", r"%\1%", " ".join(command))
259
+ cmd = CmdWrapper(namespace, command)
245
260
  else:
246
261
  cmd = CommandWrapper(namespace, command)
247
262
  return cmd.launch()
@@ -1,10 +1,22 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: envstack
3
- Version: 0.6.1
3
+ Version: 0.6.2
4
4
  Summary: Stacked environment variable management system
5
5
  Home-page: http://github.com/rsgalloway/envstack
6
6
  Author: Ryan Galloway
7
7
  Author-email: ryan@rsgalloway.com
8
+ License: BSD 3-Clause License
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Topic :: Software Development :: Libraries
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.6
14
+ Classifier: Programming Language :: Python :: 3.7
15
+ Classifier: Programming Language :: Python :: 3.8
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Requires-Python: >=3.6
8
20
  Description-Content-Type: text/markdown
9
21
  License-File: LICENSE
10
22
  Requires-Dist: PyYAML>=5.1.2
@@ -77,9 +89,9 @@ You can override anything in the environment stack by setting values in the
77
89
  local environment first:
78
90
 
79
91
  ```bash
80
- $ envstack -- echo \$HELLO
92
+ $ envstack -- echo {HELLO}
81
93
  world
82
- $ HELLO=goodbye envstack -- echo \$HELLO
94
+ $ HELLO=goodbye envstack -- echo {HELLO}
83
95
  goodbye
84
96
  ```
85
97
 
@@ -201,7 +213,7 @@ $ envstack [STACK] -- [COMMAND]
201
213
  For example:
202
214
 
203
215
  ```bash
204
- $ envstack -- echo \$HELLO
216
+ $ envstack -- echo {HELLO}
205
217
  world
206
218
  ```
207
219
 
@@ -74,13 +74,30 @@ class PostInstallCommand(install):
74
74
 
75
75
  setup(
76
76
  name="envstack",
77
- version="0.6.1",
77
+ version="0.6.2",
78
78
  description="Stacked environment variable management system",
79
79
  long_description=long_description,
80
80
  long_description_content_type="text/markdown",
81
81
  author="Ryan Galloway",
82
82
  author_email="ryan@rsgalloway.com",
83
83
  url="http://github.com/rsgalloway/envstack",
84
+ license="BSD 3-Clause License",
85
+ classifiers=[
86
+ # How mature is this project? Common values are
87
+ # 3 - Alpha
88
+ # 4 - Beta
89
+ # 5 - Production/Stable
90
+ "Development Status :: 4 - Beta",
91
+ "Intended Audience :: Developers",
92
+ "Topic :: Software Development :: Libraries",
93
+ "Programming Language :: Python :: 3",
94
+ "Programming Language :: Python :: 3.6",
95
+ "Programming Language :: Python :: 3.7",
96
+ "Programming Language :: Python :: 3.8",
97
+ "Programming Language :: Python :: 3.9",
98
+ "Programming Language :: Python :: 3.10",
99
+ "Programming Language :: Python :: 3.11",
100
+ ],
84
101
  package_dir={"": "lib"},
85
102
  packages=find_packages("lib"),
86
103
  entry_points={
@@ -91,6 +108,7 @@ setup(
91
108
  install_requires=[
92
109
  "PyYAML>=5.1.2",
93
110
  ],
111
+ python_requires=">=3.6",
94
112
  data_files=[(".", ["stack.env", "dev.env", "dist.json"])],
95
113
  cmdclass={"install": PostInstallCommand},
96
114
  zip_safe=False,
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes