envstack 0.2.2__tar.gz → 0.2.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: envstack
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: Stacked environment variable management system.
5
5
  Home-page: http://github.com/rsgalloway/envstack
6
6
  Author: Ryan Galloway
@@ -34,4 +34,4 @@ Stacked environment variable management system.
34
34
  """
35
35
 
36
36
  __prog__ = "envstack"
37
- __version__ = "0.2.2"
37
+ __version__ = "0.2.4"
@@ -35,13 +35,12 @@ Contains command line interface for envstack.
35
35
 
36
36
  import argparse
37
37
  import os
38
- import sys
39
38
  import pprint
39
+ import sys
40
40
  import traceback
41
41
 
42
- from envstack import __version__
43
- from envstack import config
44
- from envstack.env import expandvars, load_environ, trace_var, build_sources
42
+ from envstack import __version__, config
43
+ from envstack.env import build_sources, expandvars, load_environ, trace_var
45
44
  from envstack.wrapper import run_command
46
45
 
47
46
 
@@ -37,9 +37,7 @@ import os
37
37
  import re
38
38
  import string
39
39
 
40
- from envstack import config
41
- from envstack import path
42
- from envstack import logger
40
+ from envstack import config, logger, path
43
41
  from envstack.exceptions import *
44
42
 
45
43
  # named variable delimiter pattern
@@ -36,8 +36,7 @@ Contains pathing classes and functions.
36
36
  import os
37
37
  import re
38
38
 
39
- from envstack import logger
40
- from envstack import config
39
+ from envstack import config, logger
41
40
  from envstack.exceptions import *
42
41
 
43
42
  # template path field regex: extracts bracketed {keys}
@@ -38,7 +38,7 @@ import subprocess
38
38
  import traceback
39
39
 
40
40
  from envstack import logger
41
- from envstack.env import load_environ, expandvars
41
+ from envstack.env import expandvars, load_environ
42
42
 
43
43
 
44
44
  def decode_value(value):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: envstack
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: Stacked environment variable management system.
5
5
  Home-page: http://github.com/rsgalloway/envstack
6
6
  Author: Ryan Galloway
@@ -30,25 +30,38 @@
30
30
  #
31
31
 
32
32
  import os
33
- from setuptools import setup, find_packages
34
33
  import shutil
35
34
 
35
+ from setuptools import find_packages, setup
36
+ from setuptools.command.install import install
37
+
36
38
  here = os.path.abspath(os.path.dirname(__file__))
37
39
  with open(os.path.join(here, "README.md")) as f:
38
40
  long_description = f.read()
39
41
 
40
- try:
41
- source_file = os.path.join(here, "stack.env")
42
- destination_file = os.path.join(os.getcwd(), "stack.env")
43
- shutil.copy(source_file, destination_file)
44
- except FileNotFoundError:
45
- print(f"The file {source_file} was not found.")
46
- except Exception as e:
47
- print(f"Failed to copy {source_file}: {e}")
42
+
43
+ class PostInstallCommand(install):
44
+ """Custom post-installation for copying stack.env."""
45
+
46
+ def initialize_options(self):
47
+ install.initialize_options(self)
48
+ self.original_cwd = os.getcwd()
49
+
50
+ def run(self):
51
+ install.run(self)
52
+ print("Installing stack.env file to %s" % os.getcwd())
53
+ source = os.path.join(os.path.dirname(__file__), "stack.env")
54
+ destination = os.path.join(self.original_cwd, "stack.env")
55
+ if os.path.exists(source):
56
+ shutil.copy(source, destination)
57
+ print(f"Copied {source} to {destination}")
58
+ else:
59
+ print(f"{source} not found")
60
+
48
61
 
49
62
  setup(
50
63
  name="envstack",
51
- version="0.2.2",
64
+ version="0.2.4",
52
65
  description="Stacked environment variable management system.",
53
66
  long_description=long_description,
54
67
  long_description_content_type="text/markdown",
@@ -67,5 +80,6 @@ setup(
67
80
  "siteconf>=0.1.5",
68
81
  ],
69
82
  data_files=[(".", ["stack.env"])],
83
+ cmdclass={"install": PostInstallCommand},
70
84
  zip_safe=False,
71
85
  )
File without changes
@@ -34,8 +34,8 @@ Contains default configs and settings.
34
34
  """
35
35
 
36
36
  import os
37
- import sys
38
37
  import platform
38
+ import sys
39
39
 
40
40
  DEBUG = os.getenv("DEBUG")
41
41
  DEFAULT_NAMESPACE = "stack"
File without changes
File without changes