From 0fca5c6df097ca76968bbf3e34684e274c08b59f Mon Sep 17 00:00:00 2001 From: Gabriel Pickard Date: Wed, 7 Aug 2019 20:49:02 +0200 Subject: [PATCH 01/87] Integrate paging in python --- bin/diffenv | 9 -- bin/diffenv-nopaging | 192 +++++++++++++++++++++++++------------------ 2 files changed, 110 insertions(+), 91 deletions(-) delete mode 100755 bin/diffenv diff --git a/bin/diffenv b/bin/diffenv deleted file mode 100755 index cf2ae45..0000000 --- a/bin/diffenv +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -# suppress colors if we are not outputting to terminal -if [ -t 1 ] -then - diffenv-nopaging "$@" | less -FRX -else - diffenv-nopaging --no-color "$@" | less -FRX -fi diff --git a/bin/diffenv-nopaging b/bin/diffenv-nopaging index 1608d82..b93f422 100755 --- a/bin/diffenv-nopaging +++ b/bin/diffenv-nopaging @@ -7,6 +7,7 @@ from shutil import copyfile, copystat import requests from io import StringIO from signal import signal, SIGPIPE, SIG_DFL +import subprocess from diffenv import main, diffviewer, editor @@ -38,92 +39,119 @@ parser.add_argument('--ignore-config', parser.add_argument('--no-color', action='store_true', help="Don't color diff output") +parser.add_argument('--no-paging', + action='store_true', + help="Don't use less for paging output") args = parser.parse_args() if args.output or args.share: - args.no_color = True + args.no_color = True # Handle outputting to file or stdout -outfilestream = sys.stdout if args.output is None else open(args.output, 'w') -signal(SIGPIPE, SIG_DFL) - -# Determine what config to use -default_config = {'facets': None} -if args.config: - # User specificed a config file - config = main.load_config_file(args.config) -elif args.ignore_config: - # User has elected to ignore config (use all facets) - config = default_config -else: - # Find config file in ./diffenv of git repo or user directory - try: - git_config = main.load_config_file( - os.path.join(main.git_toplevel, '.diffenv/config.yaml')) - except: - git_config = None - try: - user_config = main.load_config_file( - os.path.expanduser('~/.diffenv/config.yaml')) - except: - user_config = None - config = (git_config or user_config or default_config) -facets = main.get_all_facets() -whitelist = config['facets'] - - -if args.add_hooks: - # --add-hooks : Install git hooks - if main.git_toplevel is None: - sys.stderr.write("ERROR: Not in a git repot, so cannot add git hooks.") - exit(1) - - hooks_dst = os.path.join(main.git_toplevel, '.git', 'hooks', 'post-commit') - dirname = os.path.split(os.path.abspath(__file__))[0] - # Find hooks dir relative to this file - hooks_src = os.path.join(dirname, '..', 'hooks', 'post-commit') - # Copy the hook - copyfile(hooks_src, hooks_dst) - # Make executable - copystat(hooks_src, hooks_dst) - print("virtualenv: Installed git post-commit hook to %s" % hooks_dst) - -elif args.compare is not None: - # --compare : compare with file or url - local_env = main.collect_env(facets, whitelist) - compare_env = main.read_file_or_url(args.compare) - try: - diff = diffviewer.diff(local_env, - compare_env, - not args.no_color) - outfilestream.writelines(diff) - except BrokenPipeError as e: - # TODO (Gabe) : We should comment why we ignore this error. - pass +try: + if args.output: + outfilestream = open(args.output, 'w') + elif args.no_paging: + outfilestream = sys.stdout + else: + # args stolen fron git source, see `man less` + pager = subprocess.Popen(['less', '-F', '-R', '-S', '-X', '-K'], + stdin=subprocess.PIPE, + stdout=sys.stdout) + + outfilestream = pager.stdin + + + signal(SIGPIPE, SIG_DFL) + + # Determine what config to use + default_config = {'facets': None} + if args.config: + # User specificed a config file + config = main.load_config_file(args.config) + elif args.ignore_config: + # User has elected to ignore config (use all facets) + config = default_config + else: + # Find config file in ./diffenv of git repo or user directory + try: + git_config = main.load_config_file( + os.path.join(main.git_toplevel, '.diffenv/config.yaml')) + except: + git_config = None + try: + user_config = main.load_config_file( + os.path.expanduser('~/.diffenv/config.yaml')) + except: + user_config = None + config = (git_config or user_config or default_config) + facets = main.get_all_facets() + whitelist = config['facets'] + + + if args.add_hooks: + # --add-hooks : Install git hooks + if main.git_toplevel is None: + sys.stderr.write("ERROR: Not in a git repot, so cannot add git hooks.") + exit(1) + + hooks_dst = os.path.join(main.git_toplevel, '.git', 'hooks', 'post-commit') + dirname = os.path.split(os.path.abspath(__file__))[0] + # Find hooks dir relative to this file + hooks_src = os.path.join(dirname, '..', 'hooks', 'post-commit') + # Copy the hook + copyfile(hooks_src, hooks_dst) + # Make executable + copystat(hooks_src, hooks_dst) + print("virtualenv: Installed git post-commit hook to %s" % hooks_dst) + + elif args.compare is not None: + # --compare : compare with file or url + local_env = main.collect_env(facets, whitelist) + compare_env = main.read_file_or_url(args.compare) + try: + diff = diffviewer.diff(local_env, + compare_env, + not args.no_color) + outfilestream.writelines(diff) + except BrokenPipeError as e: + # TODO (Gabe) : We should comment why we ignore this error. + pass + + elif args.share: + # --share : Get a shareable link + sys.stderr.write("Collecting env...\r") + env = main.collect_env(facets, whitelist) + yaml_stream = StringIO() + main.yaml.dump(env, yaml_stream) + + env_string = editor.raw_input_editor(default=yaml_stream.getvalue()) + + upload_url = args.post + sys.stderr.write("\033[K") + sys.stderr.write("Uploading...\r") + r = requests.post(upload_url, files={'env.yaml': env_string}) + sys.stderr.write("\033[K") + print('Run the following line on comparison environment:') + print() + print('diffenv --compare ' + r.text) + print() + + else: + # Simply output current env + env = main.collect_env(facets, whitelist) + try: + main.yaml.dump(env, outfilestream) + except BrokenPipeError as e: + pass -elif args.share: - # --share : Get a shareable link - sys.stderr.write("Collecting env...\r") - env = main.collect_env(facets, whitelist) - yaml_stream = StringIO() - main.yaml.dump(env, yaml_stream) - - env_string = editor.raw_input_editor(default=yaml_stream.getvalue()) - - upload_url = args.post - sys.stderr.write("\033[K") - sys.stderr.write("Uploading...\r") - r = requests.post(upload_url, files={'env.yaml': env_string}) - sys.stderr.write("\033[K") - print('Run the following line on comparison environment:') - print() - print('diffenv --compare ' + r.text) - print() - -else: - # Simply output current env - env = main.collect_env(facets, whitelist) - try: - main.yaml.dump(env, outfilestream) - except BrokenPipeError as e: + if not args.output and not args.no_paging: + pager.stdin.close() + pager.wait() +except KeyboardInterrupt as e: + if args.output or args.no_paging: + # we are not paging, so just exit on keyboard interrupt + sys.exit(0) + else: + # if paging let less handle this, -K will exit cleanly pass From 6f7817c59c38c279ab1a69dd321b614679635057 Mon Sep 17 00:00:00 2001 From: Gabriel Pickard Date: Wed, 7 Aug 2019 20:57:59 +0200 Subject: [PATCH 02/87] Completely replace shell script with python --- bin/{diffenv-nopaging => diffenv} | 7 ++++++- setup.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) rename bin/{diffenv-nopaging => diffenv} (97%) diff --git a/bin/diffenv-nopaging b/bin/diffenv similarity index 97% rename from bin/diffenv-nopaging rename to bin/diffenv index b93f422..a1546bb 100755 --- a/bin/diffenv-nopaging +++ b/bin/diffenv @@ -47,7 +47,12 @@ args = parser.parse_args() if args.output or args.share: args.no_color = True -# Handle outputting to file or stdout +if not sys.stdout.isatty(): + # We're being piped or redirected, don't page + args.no_paging = True + + +# Handle outputting to file, pager or stdout try: if args.output: outfilestream = open(args.output, 'w') diff --git a/setup.py b/setup.py index 276f424..25b44e7 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ def readme(): description='Compare development environments', long_description=readme(), long_description_content_type='text/markdown', - scripts=['bin/diffenv', 'bin/diffenv-nopaging'], + scripts=['bin/diffenv'], license='MIT', packages=['diffenv'], install_requires=[ From eb0c11a2cf6f10580c9d7c1ffef874b740f5e4c0 Mon Sep 17 00:00:00 2001 From: Stan James Date: Wed, 7 Aug 2019 23:03:28 +0200 Subject: [PATCH 03/87] captitalization consistancy --- bin/diffenv | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bin/diffenv b/bin/diffenv index a1546bb..62808b9 100755 --- a/bin/diffenv +++ b/bin/diffenv @@ -38,10 +38,10 @@ parser.add_argument('--ignore-config', help='ignore configs and run all facets') parser.add_argument('--no-color', action='store_true', - help="Don't color diff output") + help="don't color diff output") parser.add_argument('--no-paging', action='store_true', - help="Don't use less for paging output") + help="don't use less for paging output") args = parser.parse_args() if args.output or args.share: @@ -129,9 +129,8 @@ try: env = main.collect_env(facets, whitelist) yaml_stream = StringIO() main.yaml.dump(env, yaml_stream) - + # Open user's editor for proofreading before sending env_string = editor.raw_input_editor(default=yaml_stream.getvalue()) - upload_url = args.post sys.stderr.write("\033[K") sys.stderr.write("Uploading...\r") From c7df1a934d900d75b675b15548fa159dfe4aaf04 Mon Sep 17 00:00:00 2001 From: Gabriel Pickard Date: Thu, 8 Aug 2019 09:19:13 +0200 Subject: [PATCH 04/87] Add signal / SIGPIPE comment --- bin/diffenv | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/diffenv b/bin/diffenv index 62808b9..f481d0d 100755 --- a/bin/diffenv +++ b/bin/diffenv @@ -66,7 +66,8 @@ try: outfilestream = pager.stdin - + # handle situations where our output is piped to another program which then + # unexpectedly hangs up signal(SIGPIPE, SIG_DFL) # Determine what config to use From 10798d01404442ecc60bd62e8b0695ba735f05ed Mon Sep 17 00:00:00 2001 From: Stan James Date: Thu, 8 Aug 2019 09:31:47 +0200 Subject: [PATCH 05/87] Tidy comment formatting Consistent capitalization, move comment to same indent as what it covers --- bin/diffenv | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bin/diffenv b/bin/diffenv index f481d0d..19f59e6 100755 --- a/bin/diffenv +++ b/bin/diffenv @@ -52,8 +52,8 @@ if not sys.stdout.isatty(): args.no_paging = True -# Handle outputting to file, pager or stdout try: + # Handle outputting to file, pager or stdout if args.output: outfilestream = open(args.output, 'w') elif args.no_paging: @@ -63,10 +63,9 @@ try: pager = subprocess.Popen(['less', '-F', '-R', '-S', '-X', '-K'], stdin=subprocess.PIPE, stdout=sys.stdout) - outfilestream = pager.stdin - # handle situations where our output is piped to another program which then + # Handle situations where our output is piped to another program which then # unexpectedly hangs up signal(SIGPIPE, SIG_DFL) @@ -155,8 +154,8 @@ try: pager.wait() except KeyboardInterrupt as e: if args.output or args.no_paging: - # we are not paging, so just exit on keyboard interrupt + # We are not paging, so just exit on keyboard interrupt sys.exit(0) else: - # if paging let less handle this, -K will exit cleanly + # If paging let less handle this, -K will exit cleanly pass From bd14dda033a1435bf947fc3d764e0c7901d89036 Mon Sep 17 00:00:00 2001 From: Gabriel Pickard Date: Thu, 8 Aug 2019 15:34:15 +0200 Subject: [PATCH 06/87] Fix version and listing facet --- bin/diffenv | 9 +++++++++ facets/diffenv-version | 2 +- facets/directory/listing | 17 ++++++++--------- setup.py | 4 +++- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/bin/diffenv b/bin/diffenv index 19f59e6..6974bb8 100755 --- a/bin/diffenv +++ b/bin/diffenv @@ -8,6 +8,7 @@ import requests from io import StringIO from signal import signal, SIGPIPE, SIG_DFL import subprocess +import importlib_metadata from diffenv import main, diffviewer, editor @@ -42,8 +43,16 @@ parser.add_argument('--no-color', parser.add_argument('--no-paging', action='store_true', help="don't use less for paging output") +parser.add_argument('--version', + action='store_true', + help="display version and exit") args = parser.parse_args() + +if args.version: + print(importlib_metadata.version('diffenv')) + sys.exit(0) + if args.output or args.share: args.no_color = True diff --git a/facets/diffenv-version b/facets/diffenv-version index 773f0b8..f5cff77 100755 --- a/facets/diffenv-version +++ b/facets/diffenv-version @@ -1,3 +1,3 @@ #!/bin/bash -pip show diffenv | grep Version +diffenv --version diff --git a/facets/directory/listing b/facets/directory/listing index 142da97..a343dee 100755 --- a/facets/directory/listing +++ b/facets/directory/listing @@ -23,19 +23,18 @@ def md5(fname): def file_info(path): + filepath = str(path.absolute()) + file_size_bytes = os.path.getsize(filepath) + file_mod_time = os.path.getmtime(filepath) if path.is_dir(): - return collect_dir_info(path) + return ', '.join([str(file_size_bytes), + str(file_mod_time), 'DIR']) else: - filepath = str(path.absolute()) - file_size_bytes = os.path.getsize(filepath) - file_mod_time = os.path.getmtime(filepath) - file_hash = ( - "-" * - 32) if ( - file_size_bytes > MAX_FILE_SIZE_HASH) else md5(filepath) + file_hash = ("-" * 32) if ( + file_size_bytes > MAX_FILE_SIZE_HASH) else md5(filepath) return ', '.join( - [str(file_size_bytes), str(file_mod_time)[:16], file_hash]) + [str(file_size_bytes), str(file_mod_time)[:16], file_hash]) def collect_dir_info(path): diff --git a/setup.py b/setup.py index 25b44e7..97463c5 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,9 @@ def readme(): 'colorama', 'requests', 'ruamel.yaml', - 'gitpython' + 'gitpython', + 'psutil', + 'importlib_metadata', ], zip_safe=False, From 4112feb71b16ac140de88e53e1f759508528b739 Mon Sep 17 00:00:00 2001 From: Stan James Date: Thu, 8 Aug 2019 16:23:33 +0200 Subject: [PATCH 07/87] Fix writing to `less` subprocess Key was `universal_newlines=True` which somehow does the enoding. Not sure if the `pager.encoding = "utf-8"` line is needed. See: https://stackoverflow.com/questions/15374211/why-does-popen-communicate-return-bhi-n-instead-of-hi --- bin/diffenv | 4 +++- diffenv/diffviewer.py | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/bin/diffenv b/bin/diffenv index 6974bb8..5a95d6e 100755 --- a/bin/diffenv +++ b/bin/diffenv @@ -71,7 +71,9 @@ try: # args stolen fron git source, see `man less` pager = subprocess.Popen(['less', '-F', '-R', '-S', '-X', '-K'], stdin=subprocess.PIPE, - stdout=sys.stdout) + stdout=sys.stdout, + universal_newlines=True) + pager.encoding = "utf-8" outfilestream = pager.stdin # Handle situations where our output is piped to another program which then diff --git a/diffenv/diffviewer.py b/diffenv/diffviewer.py index 56a26aa..e906f3d 100644 --- a/diffenv/diffviewer.py +++ b/diffenv/diffviewer.py @@ -19,12 +19,13 @@ B_MARKER_TXT = '++>' -def diff(fromfile, tofile, do_color:bool): +def diff(fromfile, tofile, do_color: bool) -> typing.List[str]: """ Primary funciton. Display diff between two YAML files. - fromfile: YAML structrue - tofile: YAML structrue + fromfile: ordereddict (YAML structrue) + tofile: ordereddict (YAML structrue) do_color: Boolean indicating whether to colorize output + returns: Array of lines """ buf = StringIO() yaml.dump(diff_nested(fromfile, tofile), buf) From 5b422f62200e08f3dc09a7e0b00a20dd5d41c6c0 Mon Sep 17 00:00:00 2001 From: Stan James Date: Thu, 8 Aug 2019 16:26:50 +0200 Subject: [PATCH 08/87] Clear line before priting share message if long error occured before, long bits would still be visible on line. --- bin/diffenv | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/diffenv b/bin/diffenv index 5a95d6e..da5ac46 100755 --- a/bin/diffenv +++ b/bin/diffenv @@ -147,6 +147,7 @@ try: sys.stderr.write("Uploading...\r") r = requests.post(upload_url, files={'env.yaml': env_string}) sys.stderr.write("\033[K") + print("\033[K") print('Run the following line on comparison environment:') print() print('diffenv --compare ' + r.text) From 9bcd2095b5d65765dbad87b09735b2a934a1f8d7 Mon Sep 17 00:00:00 2001 From: Stan James Date: Thu, 8 Aug 2019 16:33:21 +0200 Subject: [PATCH 09/87] Change of verbiage when sharing. Whatdaya think? --- bin/diffenv | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/diffenv b/bin/diffenv index da5ac46..5d586a2 100755 --- a/bin/diffenv +++ b/bin/diffenv @@ -123,6 +123,7 @@ try: elif args.compare is not None: # --compare : compare with file or url + sys.stderr.write("Collecting env...\r") local_env = main.collect_env(facets, whitelist) compare_env = main.read_file_or_url(args.compare) try: @@ -146,11 +147,14 @@ try: sys.stderr.write("\033[K") sys.stderr.write("Uploading...\r") r = requests.post(upload_url, files={'env.yaml': env_string}) + share_url = r.text sys.stderr.write("\033[K") print("\033[K") + print('Your env was uploaded to: ' + share_url) + print() print('Run the following line on comparison environment:') print() - print('diffenv --compare ' + r.text) + print('diffenv --compare ' + share_url) print() else: From e3db60d50a036b1460ffe3860663869bd1367213 Mon Sep 17 00:00:00 2001 From: Gabriel Pickard Date: Thu, 8 Aug 2019 16:29:48 +0200 Subject: [PATCH 10/87] Filter out weird characters for diff --- diffenv/main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/diffenv/main.py b/diffenv/main.py index 4822723..6eb558b 100644 --- a/diffenv/main.py +++ b/diffenv/main.py @@ -11,7 +11,9 @@ import pathlib import json import git +import string +printable = set(string.printable) yaml = YAML() # Get absolute path of current git repo, if we're in one. @@ -159,7 +161,9 @@ def read_file_or_url(name: str): raise Exception( name + ' yielded 404 status code. Your upload may have expired.') else: - return yaml.load(r.text) + # filter out weird characters + file_text = ''.join(filter(lambda x: x in printable, r.text)) + return yaml.load(file_text) else: with open(name) as file: return yaml.load(file) From a385a5f3b4a504b31c8cb7a018104d2b96b3d1ee Mon Sep 17 00:00:00 2001 From: Gabriel Pickard Date: Thu, 8 Aug 2019 16:37:22 +0200 Subject: [PATCH 11/87] autopep8 --- diffenv/diffviewer.py | 3 +-- diffenv/editor.py | 4 +++- diffenv/main.py | 5 +++-- tests/tests.py | 10 +++------- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/diffenv/diffviewer.py b/diffenv/diffviewer.py index e906f3d..b1a7001 100644 --- a/diffenv/diffviewer.py +++ b/diffenv/diffviewer.py @@ -31,7 +31,7 @@ def diff(fromfile, tofile, do_color: bool) -> typing.List[str]: yaml.dump(diff_nested(fromfile, tofile), buf) difflines = buf.getvalue().splitlines(True) if do_color: - difflines = colorize_diff(difflines) + difflines = colorize_diff(difflines) return difflines @@ -151,4 +151,3 @@ def diff_nested(m1, m2): # Some other kind of type compared directly return CommentedMap([(A_MARKER, m1), (B_MARKER, m2)]) - diff --git a/diffenv/editor.py b/diffenv/editor.py index 1cf0dce..9f57f38 100644 --- a/diffenv/editor.py +++ b/diffenv/editor.py @@ -2,7 +2,9 @@ import subprocess import os -# From: https://chase-seibert.github.io/blog/2012/10/31/python-fork-exec-vim-raw-input.html +# From: +# https://chase-seibert.github.io/blog/2012/10/31/python-fork-exec-vim-raw-input.html + def raw_input_editor(default=None, editor=None): ''' like the built-in raw_input(), except that it uses a visual diff --git a/diffenv/main.py b/diffenv/main.py index 6eb558b..707276a 100644 --- a/diffenv/main.py +++ b/diffenv/main.py @@ -31,7 +31,8 @@ def run_facet(path): sys.stderr.write("ERROR: Facet is not executable: %s" % path) return "WARNING: Skipping non-executable facet: %s" % path try: - process = subprocess.Popen([path], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + process = subprocess.Popen( + [path], stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = process.communicate() out_decoded = out.decode("utf-8").strip() if err: @@ -115,7 +116,7 @@ def get_all_facets(): return facet_map -def load_config_file(path:str): +def load_config_file(path: str): """ Load a config file formatted in YAML """ diff --git a/tests/tests.py b/tests/tests.py index ada882e..47d9e08 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -7,8 +7,8 @@ # To run: # python3 -m unittest tests.py -class TestStringMethods(unittest.TestCase): +class TestStringMethods(unittest.TestCase): def test_non_git(self): """ Test running in a non-git repo """ @@ -16,17 +16,16 @@ def test_non_git(self): # self.assertEqual('foo'.upper(), 'FOO') pass - def test_plain(self): """ Test running with no params """ # TODO # self.assertEqual('foo'.upper(), 'FOO') pass - def test_sharing(self): """ Test sharing env """ - process = subprocess.Popen(['diffenv','--share'], stdout=subprocess.PIPE) + process = subprocess.Popen( + ['diffenv', '--share'], stdout=subprocess.PIPE) out, err = process.communicate() if err: sys.stderr.write(err) @@ -47,21 +46,18 @@ def test_sharing(self): # Should show that env is identical self.assertEqual(result_lines, "{}\n") - def test_compare_http(self): """ Test comparing with remote env """ # TODO # self.assertEqual('foo'.upper(), 'FOO') pass - def test_compare_file(self): """ Test comparing with a file """ # TODO # self.assertEqual('foo'.upper(), 'FOO') pass - def test_passed_config(self): """ Test with passing in a cofig file """ # TODO From 041ddf8c60ac4b1824e409c518144d7f53d7b31b Mon Sep 17 00:00:00 2001 From: Stan James Date: Thu, 8 Aug 2019 16:39:17 +0200 Subject: [PATCH 12/87] clarify comment. remove constant that's only used once. --- diffenv/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/diffenv/main.py b/diffenv/main.py index 707276a..1d76ad1 100644 --- a/diffenv/main.py +++ b/diffenv/main.py @@ -13,7 +13,6 @@ import git import string -printable = set(string.printable) yaml = YAML() # Get absolute path of current git repo, if we're in one. @@ -162,8 +161,9 @@ def read_file_or_url(name: str): raise Exception( name + ' yielded 404 status code. Your upload may have expired.') else: - # filter out weird characters - file_text = ''.join(filter(lambda x: x in printable, r.text)) + # Filter out non-printable characters (They break the diff) + file_text = ''.join( + filter(lambda x: x in string.printable, r.text)) return yaml.load(file_text) else: with open(name) as file: From 8f553cf58d5595fa9b4238215787baac6520bd6b Mon Sep 17 00:00:00 2001 From: Stan James Date: Thu, 8 Aug 2019 16:56:57 +0200 Subject: [PATCH 13/87] Fanciness around uploading. suffix for temp file. --- bin/diffenv | 13 ++++++++++++- diffenv/editor.py | 4 ++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/bin/diffenv b/bin/diffenv index 5d586a2..0c04643 100755 --- a/bin/diffenv +++ b/bin/diffenv @@ -141,8 +141,19 @@ try: env = main.collect_env(facets, whitelist) yaml_stream = StringIO() main.yaml.dump(env, yaml_stream) + top_text = "# Below is your collected env. You can edit it before sharing.\n# When you are finished, save and exit your editor.\n\n" # Open user's editor for proofreading before sending - env_string = editor.raw_input_editor(default=yaml_stream.getvalue()) + sys.stderr.write("Editing env in editor...\r") + env_string = editor.raw_input_editor( + default=top_text + yaml_stream.getvalue(), + prefix='diffenv-', + suffix='.yaml') + sys.stderr.write("\033[K") + env_string = env_string.replace(top_text, '') # Remove instructions + if not env_string.strip(): + # User deleted everything, ie cancelled. + print("Cancelled upload.") + exit(1) upload_url = args.post sys.stderr.write("\033[K") sys.stderr.write("Uploading...\r") diff --git a/diffenv/editor.py b/diffenv/editor.py index 9f57f38..e0a6f2d 100644 --- a/diffenv/editor.py +++ b/diffenv/editor.py @@ -6,11 +6,11 @@ # https://chase-seibert.github.io/blog/2012/10/31/python-fork-exec-vim-raw-input.html -def raw_input_editor(default=None, editor=None): +def raw_input_editor(default=None, editor=None, prefix=None, suffix=None): ''' like the built-in raw_input(), except that it uses a visual text editor for ease of editing. Unline raw_input() it can also take a default value. ''' - with tempfile.NamedTemporaryFile(mode='r+') as tmpfile: + with tempfile.NamedTemporaryFile(mode='r+', prefix=prefix, suffix=suffix) as tmpfile: if default: tmpfile.write(default) tmpfile.flush() From 7f16ea2044b2ba12a036a11d365807db54cfbeed Mon Sep 17 00:00:00 2001 From: Stan James Date: Thu, 8 Aug 2019 21:16:51 +0200 Subject: [PATCH 14/87] Add link and credit to top of shared diff file. --- bin/diffenv | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/diffenv b/bin/diffenv index 0c04643..84dac1c 100755 --- a/bin/diffenv +++ b/bin/diffenv @@ -142,10 +142,11 @@ try: yaml_stream = StringIO() main.yaml.dump(env, yaml_stream) top_text = "# Below is your collected env. You can edit it before sharing.\n# When you are finished, save and exit your editor.\n\n" + credit_text = "# Generated by diffenv. https://github.com/error-central/diffenv\n" # Open user's editor for proofreading before sending sys.stderr.write("Editing env in editor...\r") env_string = editor.raw_input_editor( - default=top_text + yaml_stream.getvalue(), + default=top_text + credit_text + yaml_stream.getvalue(), prefix='diffenv-', suffix='.yaml') sys.stderr.write("\033[K") From a0b4431a3a63f21b17ad85877182178e41f68599 Mon Sep 17 00:00:00 2001 From: Stan James Date: Thu, 8 Aug 2019 21:26:33 +0200 Subject: [PATCH 15/87] Fix vscode debug config --- .vscode/launch.json | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 542e82c..dc77987 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -10,14 +10,14 @@ "name": "Python: diffenv", "type": "python", "request": "launch", - "program": "${workspaceFolder}/bin/diffenv-nopaging", + "program": "${workspaceFolder}/bin/diffenv", "console": "integratedTerminal" }, { "name": "Python: diffenv in non-git dir", "type": "python", "request": "launch", - "program": "${workspaceFolder}/bin/diffenv-nopaging", + "program": "${workspaceFolder}/bin/diffenv", "console": "integratedTerminal", "cwd": "~/Downloads/nogit" }, @@ -26,7 +26,7 @@ "type": "python", "request": "launch", "args": ["--config", "${workspaceFolder}/examples/config-small.yaml"], - "program": "${workspaceFolder}/bin/diffenv-nopaging", + "program": "${workspaceFolder}/bin/diffenv", "console": "integratedTerminal" }, { @@ -37,7 +37,17 @@ "--compare", "https://transfer.sh/7PQpR/diff" ], - "program": "${workspaceFolder}/bin/diffenv-nopaging", + "program": "${workspaceFolder}/bin/diffenv", + "console": "integratedTerminal" + }, + { + "name": "Python: diffenv --share", + "type": "python", + "request": "launch", + "args": [ + "--share" + ], + "program": "${workspaceFolder}/bin/diffenv", "console": "integratedTerminal" }, { From 4a34c3b14e315ce94c43660fbad9ad28e3977891 Mon Sep 17 00:00:00 2001 From: Stan James Date: Thu, 8 Aug 2019 21:27:36 +0200 Subject: [PATCH 16/87] facet: git remote -v --- facets/git/git-remote | 2 ++ 1 file changed, 2 insertions(+) create mode 100755 facets/git/git-remote diff --git a/facets/git/git-remote b/facets/git/git-remote new file mode 100755 index 0000000..1a6784b --- /dev/null +++ b/facets/git/git-remote @@ -0,0 +1,2 @@ +#!/bin/bash +git remote -v From ff3693ebf47521d786ff12557c4b43eb03994c51 Mon Sep 17 00:00:00 2001 From: Gabriel Pickard Date: Fri, 9 Aug 2019 23:32:40 +0200 Subject: [PATCH 17/87] Correct color output to not only do first line of a diff block --- diffenv/diffviewer.py | 42 ++++++++++++++++-------------------------- 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/diffenv/diffviewer.py b/diffenv/diffviewer.py index b1a7001..237fc47 100644 --- a/diffenv/diffviewer.py +++ b/diffenv/diffviewer.py @@ -51,34 +51,24 @@ def colorize_diff(diff: typing.List[str]): """ Add terminal colors to a diff """ - marking = False + marking = '' col = 0 for line in diff: - if not marking and A_MARKER in line: - if B_MARKER in line: - # Handle single-line case (if applicable?) - i = line.index(B_MARKER) - yield Fore.GREEN + line[:i] + Fore.RESET + Fore.RED + line[i:] + Fore.RESET - else: - marking = True - yield Fore.GREEN + line - - elif marking and B_MARKER in line: - col = line.index(B_MARKER) - yield Fore.RESET + Fore.RED + line - - elif marking and len(line) - len(line.lstrip()) < col: - # deindented - marking = False - yield Fore.RESET + line - - elif not marking and A_MARKER_TXT in line: - yield Fore.GREEN + line + Fore.RESET - elif not marking and B_MARKER_TXT in line: - yield Fore.RED + line + Fore.RESET - - else: - yield line + if A_MARKER in line or A_MARKER_TXT in line: + marking = Fore.GREEN + elif B_MARKER in line or B_MARKER_TXT in line: + marking = Fore.RED + elif len(line) - len(line.lstrip()) < col: + # in case of unindent reset marking color + marking = '' + + # keep track of leading whitespace to catch unindent + col = len(line) - len(line.lstrip()) + line = marking + line + Fore.RESET + if A_MARKER_TXT in line or B_MARKER_TXT in line: + # reset because text lines are marked individually + marking = '' + yield line def diff_nested(m1, m2): From 0dc00314a1061ecdb05bcabac99ba14cef0c0e10 Mon Sep 17 00:00:00 2001 From: Gabriel Pickard Date: Sat, 10 Aug 2019 09:03:16 +0200 Subject: [PATCH 18/87] Actually sort facet output --- diffenv/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/diffenv/main.py b/diffenv/main.py index 1d76ad1..ff8eff9 100644 --- a/diffenv/main.py +++ b/diffenv/main.py @@ -78,7 +78,7 @@ def extract_facet_dir(dirpath, structure, depth=0): """ p = pathlib.Path(dirpath) if p.exists(): - for item in p.iterdir(): + for item in sorted(p.iterdir()): if item.is_dir(): structure[item.name] = extract_facet_dir( item, @@ -134,7 +134,7 @@ def collect_env(facets, whitelist): # Actually run the facet and return the results return run_facet(facets) elif whitelist is None or isinstance(whitelist, str): - for subdir in sorted(list(facets.keys())): + for subdir in list(facets.keys()): facets[subdir] = collect_env(facets[subdir], whitelist) return facets else: From 630df76abab4257f51502ae4cb3cbc1f44f6fd91 Mon Sep 17 00:00:00 2001 From: Stan James Date: Sun, 11 Aug 2019 14:12:58 +0200 Subject: [PATCH 19/87] bump version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 97463c5..35272a2 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ def readme(): setup( name='diffenv', - version='0.1.1', + version='0.2.0', author='Stan James, Gabriel Pickard', author_email='wanderingstan@gmail.com, wergomat@gmail.com', url='http://github.com/error-central/diffenv', From 8bd3ce7b5e8f7832ba2c66a1e35f90187e8cbf50 Mon Sep 17 00:00:00 2001 From: Stan James Date: Sun, 11 Aug 2019 14:30:23 +0200 Subject: [PATCH 20/87] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..2d93ef7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,30 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: bug +assignees: '' + +--- + +**Environment** +In the root directory of this repo, run `diffenv` and paste the results below, showing your environmennt. (Install with `pip install diffenv`.) + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Additional context** +Add any other context about the problem here. From e9e6b975c626467d9fd4f6b098fd123c61465833 Mon Sep 17 00:00:00 2001 From: Gabriel Pickard Date: Sun, 11 Aug 2019 14:31:06 +0200 Subject: [PATCH 21/87] Add newer example env file --- README.md | 6 +- examples/gabe_env.yaml | 243 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 246 insertions(+), 3 deletions(-) create mode 100644 examples/gabe_env.yaml diff --git a/README.md b/README.md index 5487dea..4d3cfa5 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ os: version: Darwin 18.7.0 x86_64 ``` -[Full example output](https://raw.githubusercontent.com/error-central/diffenv/master/examples/stan-diffenv.yaml). +[Full example output](https://raw.githubusercontent.com/error-central/diffenv/master/examples/gabe_env.yaml). ## Installation @@ -52,9 +52,9 @@ To output your current development environment to stderr: diffenv ``` -To compare your environment with @wanderingstan: +To compare your environment with @werg: ```bash -diffenv -c https://raw.githubusercontent.com/error-central/diffenv/master/examples/stan-diffenv.yaml +diffenv -c https://raw.githubusercontent.com/error-central/diffenv/master/examples/gabe_env.yaml ``` To share your environment with a coworker for comparison: diff --git a/examples/gabe_env.yaml b/examples/gabe_env.yaml new file mode 100644 index 0000000..7b2e071 --- /dev/null +++ b/examples/gabe_env.yaml @@ -0,0 +1,243 @@ +# ============================================================ +diffenv-version: 0.1.1 +# ============================================================ +directory: + # ========================================================== + listing: + tests: 16, 1565204570.8450534, DIR + setup.py: 702, 1565525741.15975, 752c6e59b0f7928af9769429eeca1562 + package-lock.json: 114506, 1564653686.24037, 64f37e02b3664df0e4e2a678bb47f67a + one_file: 15536, 1564093095.70077, df022ea5044b656b6e331716cb2ceedd + node_modules: 5498, 1564653685.9953773, DIR + hooks: 22, 1564500687.6707716, DIR + foo.out: 17891, 1565108241.48152, 9b13a5af78f553f48f7a49a5424e12cd + fancy_config.scratch: 495, 1564653646.79637, 5f3d2337b65aac2dac3283d5d897811e + facets: 106, 1565270605.6594026, DIR + examples: 94, 1565526167.0057552, DIR + example_config.yaml: 45, 1564669916.36737, 759eab2b0f2d79bd2c0991820fa76787 + dist: 192, 1564664507.1473775, DIR + diffenv.egg-info: 152, 1564668288.1023774, DIR + diffenv: 102, 1565420539.5817554, DIR + build: 64, 1564136267.3167715, DIR + bin: 14, 1565383417.4157553, DIR + another_file: 6731, 1564093115.72677, 7735e11dba9b18a36ccf637a7ab1a8bb + __pycache__: 50, 1564094049.7107716, DIR + README.md: 1912, 1564942876.19017, 5fd490e55ed5265b93ec5d47acc89acb + LICENSE: 1070, 1563972140.01077, bbd2cb1a41f404058e170e74a725bb18 + .vscode: 48, 1565383417.4147553, DIR + .gitignore: 1221, 1564153052.76277, 3b1c12c1ca4e89f3c929c73c4427f846 + .git: 204, 1565526169.1517553, DIR + .diffenv: 60, 1564907663.1230297, DIR + # ========================================================== + path: /home/turpentine/projects/diffenv +# ============================================================ +git: + # ========================================================== + git-remote: |- + origin git@github.com:error-central/diffenv.git (fetch) + origin git@github.com:error-central/diffenv.git (push) + # ========================================================== + git-status: |- + On branch master + Your branch is up-to-date with 'origin/master'. + Untracked files: + (use "git add ..." to include in what will be committed) + + .diffenv/#config.yaml# + another_file + examples/gabe_env.yaml + fancy_config.scratch + foo.out + node_modules/ + one_file + package-lock.json + + nothing added to commit but untracked files present (use "git add" to track) + # ========================================================== + git-user-email: wergomat@gmail.com + # ========================================================== + git-user-name: Gabriel Pickard + # ========================================================== + version: git version 2.11.0 +# ============================================================ +os: + # ========================================================== + timezone: 0200 + # ========================================================== + version: Linux 4.19.34-04457-g5b63d4390e96 x86_64 +# ============================================================ +python: + # ========================================================== + pip-packages: + astroid: 1.4.9 + autopep8: 1.4.4 + backports.functools-lru-cache: 1.3 + backports.shutil-get-terminal-size: 1.0.0 + certifi: 2019.6.16 + chardet: 3.0.4 + colorama: 0.4.1 + cryptography: 1.7.1 + decorator: 4.0.11 + enum34: 1.1.6 + idna: 2.8 + ipaddress: 1.0.17 + ipython: 5.1.0 + ipython-genutils: 0.1.0 + isort: 4.2.5 + jedi: 0.14.1 + keyring: 10.1 + keyrings.alt: 1.3 + lazy-object-proxy: 1.2.2 + meld: 3.16.4 + parso: 0.5.1 + pathlib2: 2.1.0 + pep8: 1.7.0 + pexpect: 4.2.1 + pickleshare: 0.7.4 + pip: 9.0.1 + prompt-toolkit: 1.0.9 + psutil: 5.6.3 + ptyprocess: 0.5.1 + pyasn1: 0.1.9 + pycodestyle: 2.5.0 + pycrypto: 2.6.1 + pyflakes: 1.3.0 + Pygments: 2.2.0 + pygobject: 3.22.0 + pylint: 1.6.5 + pyxdg: 0.25 + requests: 2.22.0 + ruamel.ordereddict: 0.4.14 + ruamel.yaml: 0.16.0 + ruamel.yaml.clib: 0.1.0 + SecretStorage: 2.3.1 + setuptools: 33.1.1 + simplegeneric: 0.8.1 + six: 1.10.0 + traitlets: 4.3.1 + urllib3: 1.25.3 + wcwidth: 0.1.7 + wheel: 0.29.0 + wrapt: 1.9.0 + yapf: 0.28.0 + # ========================================================== + pip3-packages: + astroid: 1.4.9 + autopep8: 1.4.4 + bleach: 3.1.0 + certifi: 2019.6.16 + chardet: 3.0.4 + colorama: 0.4.1 + cryptography: 1.7.1 + decorator: 4.0.11 + diffenv: 0.1.1 + docutils: 0.15.1 + entrypoints: 0.3 + flake8: 3.7.8 + gitdb2: 2.0.5 + GitPython: 2.1.13 + idna: 2.8 + importlib-metadata: 0.19 + ipython: 5.1.0 + ipython-genutils: 0.1.0 + isort: 4.2.5 + jedi: 0.14.1 + keyring: 10.1 + keyrings.alt: 1.3 + lazy-object-proxy: 1.2.2 + mccabe: 0.6.1 + parso: 0.5.1 + pexpect: 4.2.1 + pickleshare: 0.7.4 + pip: 9.0.1 + pkginfo: 1.5.0.1 + prompt-toolkit: 1.0.9 + psutil: 5.6.3 + ptyprocess: 0.5.1 + pyasn1: 0.1.9 + pycodestyle: 2.5.0 + pycrypto: 2.6.1 + pycurl: 7.43.0 + pyflakes: 2.1.1 + Pygments: 2.4.2 + pygobject: 3.22.0 + pylint: 1.6.5 + python-apt: 1.4.0b3 + pyxdg: 0.25 + readme-renderer: 24.0 + requests: 2.22.0 + requests-toolbelt: 0.9.1 + ruamel.yaml: 0.16.0 + ruamel.yaml.clib: 0.1.0 + SecretStorage: 2.3.1 + setuptools: 41.0.1 + simplegeneric: 0.8.1 + six: 1.12.0 + smmap2: 2.0.5 + termcolor: 1.1.0 + tqdm: 4.32.2 + traitlets: 4.3.1 + twine: 1.13.0 + unattended-upgrades: 0.1 + urllib3: 1.25.3 + wcwidth: 0.1.7 + webencodings: 0.5.1 + wheel: 0.33.4 + wrapt: 1.9.0 + yapf: 0.28.0 + zipp: 0.5.2 + # ========================================================== + python-version: Python 2.7.13 + # ========================================================== + python3-version: Python 3.5.3 + # ========================================================== + virtualenv: | + # ========================================================== + which-python: /usr/bin/python + # ========================================================== + which-python3: /usr/bin/python3 +# ============================================================ +shell: + # ========================================================== + envvars: + BROWSER: /usr/bin/garcon-url-handler + COLORTERM: truecolor + DBUS_SESSION_BUS_ADDRESS: unix:path=/run/user/1000/bus + DISPLAY: :0 + DISPLAY_LOW_DENSITY: :1 + HOME: /home/turpentine + INVOCATION_ID: a8dac9746d134d95afcf38290076dbd5 + JOURNAL_STREAM: 9:6237 + LANG: en_US.UTF-8 + LOGNAME: turpentine + MANAGERPID: '116' + PATH: /usr/local/sbin:/usr/local/bin:/usr/local/games:/usr/sbin:/usr/bin:/usr/games:/sbin:/bin + PWD: /home/turpentine/projects/diffenv + QT_AUTO_SCREEN_SCALE_FACTOR: '1' + QT_QPA_PLATFORMTHEME: gtk2 + SHELL: /bin/bash + SHLVL: '1' + SOMMELIER_VERSION: '0.20' + TERM: xterm-256color + TERMINATOR_DBUS_NAME: net.tenshu.Terminator20x20309d54defed5d4 + TERMINATOR_DBUS_PATH: /net/tenshu/Terminator2 + TERMINATOR_UUID: urn:uuid:983e4f1d-7c08-405e-ad39-70b3b591fa6c + USER: tixelbook + VTE_VERSION: '4601' + WAYLAND_DISPLAY: wayland-0 + WAYLAND_DISPLAY_LOW_DENSITY: wayland-1 + XCURSOR_SIZE: '48' + XCURSOR_SIZE_LOW_DENSITY: '24' + XCURSOR_THEME: Adwaita + XDG_CONFIG_HOME: /home/turpentine/.config + XDG_DATA_DIRS: /home/turpentine/.local/share:/home/turpentine/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share + XDG_RUNTIME_DIR: /run/user/1000 + _: /usr/local/bin/diffenv + # ========================================================== + shell-version: |- + GNU bash, version 4.4.12(1)-release (x86_64-pc-linux-gnu) + Copyright (C) 2016 Free Software Foundation, Inc. + License GPLv3+: GNU GPL version 3 or later + + This is free software; you are free to change and redistribute it. + There is NO WARRANTY, to the extent permitted by law. From 22c027c6bb6f80fb88bc00f2ae7a1c0557226951 Mon Sep 17 00:00:00 2001 From: Stan James Date: Sun, 11 Aug 2019 14:35:23 +0200 Subject: [PATCH 22/87] make it fancy --- .github/ISSUE_TEMPLATE/bug_report.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 2d93ef7..0d0b96b 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -10,6 +10,14 @@ assignees: '' **Environment** In the root directory of this repo, run `diffenv` and paste the results below, showing your environmennt. (Install with `pip install diffenv`.) +
Environment + +```yaml +Paste `diffenv` output here +``` + +
+ **Describe the bug** A clear and concise description of what the bug is. From 706712b3488bb94036883d67ef1f871bb48c72b6 Mon Sep 17 00:00:00 2001 From: Stan James Date: Sun, 11 Aug 2019 15:46:07 +0200 Subject: [PATCH 23/87] remove '====' --- diffenv/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diffenv/main.py b/diffenv/main.py index ff8eff9..e5bcfa0 100644 --- a/diffenv/main.py +++ b/diffenv/main.py @@ -65,7 +65,7 @@ def yaml_format_item(structure, key, depth): Attach bars and blank lines """ structure.yaml_set_comment_before_after_key( - key, ('=' * (60 - depth * 2)), indent=depth * 2) + key, '\n', indent=depth * 2) def extract_facet_dir(dirpath, structure, depth=0): From a0df09003bd434753c30b1ce103d5ce742d58f91 Mon Sep 17 00:00:00 2001 From: Gabriel Pickard Date: Sun, 11 Aug 2019 15:57:35 +0200 Subject: [PATCH 24/87] Add use cases to readme --- README.md | 49 ++++++++++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 4d3cfa5..34fc0fb 100644 --- a/README.md +++ b/README.md @@ -3,16 +3,16 @@ Output and compare all facets of development environments. ## Overview -diffenv gathers and compares runtime environment metadata, intended to remedy the common developer situation of "But it works on my machine! What's different about your environment?" +diffenv gathers and compares runtime environment metadata. A standard way of capturing a complete picture of a development environment. -Simplified example usage: +### Simplified example ```bash $ diffenv python: python-version: Python 3.7.3 shell: envvars: - EDITOR: sublw + EDITOR: sublw GIT_EDITOR: subl -w API_ENDPOINT: http://api.lvh.me:4000 PRISMA_ENDPOINT: http://prisma:4466 @@ -23,27 +23,17 @@ os: [Full example output](https://raw.githubusercontent.com/error-central/diffenv/master/examples/gabe_env.yaml). +### Use cases +* Add environment data to bug reports in a _standardized format_. +* Diagnose what subtle difference is making things fail on your coworker's machine. +* Compare your current environment against past recorded state when things still worked. ## Installation -### Standard -To install normally: - ```bash -pip3 install diffenv +python3 -m pip install diffenv ``` - -### Development - -If you are developing locally, do _not_ install as above, and instead run the following in the repo root directory: - -```bash -# depending on your setup you may have to prefix sudo to this command -pip install --editable . -``` - -Now `diffenv` will always point to your local repo, including any changes. - +Currently diffenv only supports Python 3. ## Use @@ -61,6 +51,12 @@ To share your environment with a coworker for comparison: ```bash diffenv --share ``` + +For a complete list of command line options run: +```bash +diffenv --help +``` + ## Customization diffenv can be customized for a user or for a repo. Customizations are put in a directory named `.diffenv` in the user's home directory or the git repos top directory. @@ -76,3 +72,18 @@ The facet file itself needs to be excutable (`chmod +x `). You can limit which facets are run with a yaml file saved in `.diffenv/config.yaml` See `example_config.yaml` for more information. + +## Contributing to diffenv + +### Development install + +If you are developing locally, do _not_ install as above, and instead run the following in the repo root directory: + +```bash +# depending on your setup you may have to prefix sudo to this command +pip install --editable . +``` + +Now `diffenv` will always point to your local repo, including any changes. + + From f9450b43df1255ccce70946c6d195a7750e2cd46 Mon Sep 17 00:00:00 2001 From: Gabriel Pickard Date: Sun, 11 Aug 2019 16:37:14 +0200 Subject: [PATCH 25/87] Handle case when less is missing --- bin/diffenv | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/bin/diffenv b/bin/diffenv index 84dac1c..33f655a 100755 --- a/bin/diffenv +++ b/bin/diffenv @@ -68,13 +68,17 @@ try: elif args.no_paging: outfilestream = sys.stdout else: - # args stolen fron git source, see `man less` - pager = subprocess.Popen(['less', '-F', '-R', '-S', '-X', '-K'], - stdin=subprocess.PIPE, - stdout=sys.stdout, - universal_newlines=True) - pager.encoding = "utf-8" - outfilestream = pager.stdin + try: + # args stolen fron git source, see `man less` + pager = subprocess.Popen(['less', '-F', '-R', '-S', '-X', '-K'], + stdin=subprocess.PIPE, + stdout=sys.stdout, + universal_newlines=True) + pager.encoding = "utf-8" + outfilestream = pager.stdin + except FileNotFoundError as e: + # Presumably less is not installd + outfilestream = sys.stdout # Handle situations where our output is piped to another program which then # unexpectedly hangs up From 4aa003da1b50916d227bd200c6bd3ff8f3e0309f Mon Sep 17 00:00:00 2001 From: Gabriel Pickard Date: Sun, 11 Aug 2019 16:39:59 +0200 Subject: [PATCH 26/87] Really handle case where there's no less --- bin/diffenv | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/diffenv b/bin/diffenv index 33f655a..e467ec7 100755 --- a/bin/diffenv +++ b/bin/diffenv @@ -79,6 +79,7 @@ try: except FileNotFoundError as e: # Presumably less is not installd outfilestream = sys.stdout + args.no_paging = True # Handle situations where our output is piped to another program which then # unexpectedly hangs up From 473b001ebe2283f410f1e827e118abee1ed50d58 Mon Sep 17 00:00:00 2001 From: Gabriel Pickard Date: Sun, 11 Aug 2019 16:56:07 +0200 Subject: [PATCH 27/87] Handle missing vi --- diffenv/editor.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/diffenv/editor.py b/diffenv/editor.py index e0a6f2d..3320e02 100644 --- a/diffenv/editor.py +++ b/diffenv/editor.py @@ -14,9 +14,12 @@ def raw_input_editor(default=None, editor=None, prefix=None, suffix=None): if default: tmpfile.write(default) tmpfile.flush() - subprocess.check_call([editor or get_editor(), tmpfile.name]) - tmpfile.seek(0) - return tmpfile.read().strip() + try: + subprocess.check_call([editor or get_editor(), tmpfile.name]) + tmpfile.seek(0) + return tmpfile.read().strip() + except FileNotFoundError: + return default def get_editor(): From c1328517e9ba6050b8ed547bca6913e2664396b3 Mon Sep 17 00:00:00 2001 From: Gabriel Pickard Date: Sun, 11 Aug 2019 17:22:01 +0200 Subject: [PATCH 28/87] Ignore hidden files in facet directory --- diffenv/main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/diffenv/main.py b/diffenv/main.py index e5bcfa0..a31f482 100644 --- a/diffenv/main.py +++ b/diffenv/main.py @@ -79,6 +79,9 @@ def extract_facet_dir(dirpath, structure, depth=0): p = pathlib.Path(dirpath) if p.exists(): for item in sorted(p.iterdir()): + if str(item).startswith('.'): + # Ignore hidden files + continue if item.is_dir(): structure[item.name] = extract_facet_dir( item, From b74274fd7f6bd85bb7f2b1e5baf4129701f3400e Mon Sep 17 00:00:00 2001 From: Stan James Date: Sun, 11 Aug 2019 17:29:39 +0200 Subject: [PATCH 29/87] issue option --- bin/diffenv | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/bin/diffenv b/bin/diffenv index 84dac1c..f64da54 100755 --- a/bin/diffenv +++ b/bin/diffenv @@ -9,6 +9,7 @@ from io import StringIO from signal import signal, SIGPIPE, SIG_DFL import subprocess import importlib_metadata +import webbrowser from diffenv import main, diffviewer, editor @@ -29,6 +30,11 @@ parser.add_argument( '--share', action='store_true', help='store current env and return URL that can be shared') +parser.add_argument( + '--issue', + action='store_true', + help='create github issue') + parser.add_argument( '--post', default='https://transfer.sh', @@ -169,6 +175,39 @@ try: print('diffenv --compare ' + share_url) print() + elif args.issue: + # --share : Get a shareable link + sys.stderr.write("Collecting env...\r") + env = main.collect_env(facets, whitelist) + yaml_stream = StringIO() + main.yaml.dump(env, yaml_stream) + top_text = "# Below is your collected env. You can edit it before sharing.\n# When you are finished, save and exit your editor.\n\n" + credit_text = "# Generated by diffenv. https://github.com/error-central/diffenv\n" + # Open user's editor for proofreading before sending + sys.stderr.write("Editing env in editor...\r") + env_string = editor.raw_input_editor( + default=top_text + credit_text + yaml_stream.getvalue(), + prefix='diffenv-', + suffix='.yaml') + sys.stderr.write("\033[K") + env_string = env_string.replace(top_text, '') # Remove instructions + if not env_string.strip(): + # User deleted everything, ie cancelled. + print("Cancelled upload.") + exit(1) + + with open(os.path.join(main.git_toplevel, '.github/ISSUE_TEMPLATE/bug_report.md'), "r") as issue_template_file: + issue_template=issue_template_file.read() + issue_template = issue_template.replace( + 'Paste `diffenv` output here', env_string[:4000-len(issue_template)]) + params = {'Bug': '', 'title': 'Issue', 'body': issue_template[:4000]} + base_url = 'https://github.com/error-central/diffenv/issues/new' + filled_url = requests.Request( + 'GET', base_url, params=params).prepare().url + + webbrowser.open(filled_url) + + else: # Simply output current env env = main.collect_env(facets, whitelist) From 1a17de8cf1c123631f9e34b427fd2373cd0d294b Mon Sep 17 00:00:00 2001 From: Stan James Date: Sun, 11 Aug 2019 17:49:03 +0200 Subject: [PATCH 30/87] =?UTF-8?q?=C2=A0=F0=9F=90=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 34fc0fb..48041b4 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,9 @@ Output and compare all facets of development environments. diffenv gathers and compares runtime environment metadata. A standard way of capturing a complete picture of a development environment. +![output](https://user-images.githubusercontent.com/673455/62836101-182d1200-bc60-11e9-95c7-1f52dfb197b7.gif) + + ### Simplified example ```bash $ diffenv From 4e650b07d99a4e21d871e8ff92c801fc8c100f8c Mon Sep 17 00:00:00 2001 From: Stan James Date: Sun, 11 Aug 2019 17:57:00 +0200 Subject: [PATCH 31/87] example of bug report --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 48041b4..c853866 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ os: [Full example output](https://raw.githubusercontent.com/error-central/diffenv/master/examples/gabe_env.yaml). ### Use cases -* Add environment data to bug reports in a _standardized format_. +* Add environment data to bug reports in a _standardized format_. [Example](https://github.com/error-central/diffenv/issues/29) * Diagnose what subtle difference is making things fail on your coworker's machine. * Compare your current environment against past recorded state when things still worked. From afcabc8a0bec131fdcd77a4b040ed2bcb406ed46 Mon Sep 17 00:00:00 2001 From: Stan James Date: Mon, 12 Aug 2019 17:23:11 +0200 Subject: [PATCH 32/87] travis tests --- .travis.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..cc8a183 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,14 @@ +language: python # this works for Linux but is an error on macOS or Windows +matrix: + include: + - name: "Python 3.7.1 on Xenial Linux" + python: 3.7 # this works for Linux but is ignored on macOS or Windows + dist: xenial # required for Python >= 3.7 + - name: "Python 3.7.2 on macOS" + os: osx + osx_image: xcode10.2 # Python 3.7.2 running on macOS 10.14.3 + language: shell # 'language: python' is an error on Travis CI macOS +install: pip3 install --upgrade pip # all three OSes agree about 'pip3' +# 'python' points to Python 2.7 on macOS but points to Python 3.7 on Linux and Windows +# 'python3' is a 'command not found' error on Windows but 'py' works on Windows only +script: python3 -m unittest tests/tests.py || python -m unittest tests/tests.py From b82952d080a488cf7aac58797ff034d71b9165c3 Mon Sep 17 00:00:00 2001 From: Stan James Date: Mon, 12 Aug 2019 17:28:10 +0200 Subject: [PATCH 33/87] fix travis pip --- .travis.yml | 2 +- README.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index cc8a183..e739832 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ matrix: os: osx osx_image: xcode10.2 # Python 3.7.2 running on macOS 10.14.3 language: shell # 'language: python' is an error on Travis CI macOS -install: pip3 install --upgrade pip # all three OSes agree about 'pip3' +install: pip3 install --editable . # all three OSes agree about 'pip3' # 'python' points to Python 2.7 on macOS but points to Python 3.7 on Linux and Windows # 'python3' is a 'command not found' error on Windows but 'py' works on Windows only script: python3 -m unittest tests/tests.py || python -m unittest tests/tests.py diff --git a/README.md b/README.md index c853866..9b60a71 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ python: python-version: Python 3.7.3 shell: envvars: - EDITOR: sublw + EDITOR: sublw GIT_EDITOR: subl -w API_ENDPOINT: http://api.lvh.me:4000 PRISMA_ENDPOINT: http://prisma:4466 @@ -36,7 +36,7 @@ os: ```bash python3 -m pip install diffenv ``` -Currently diffenv only supports Python 3. +Currently diffenv only supports Python 3. ## Use @@ -84,7 +84,7 @@ If you are developing locally, do _not_ install as above, and instead run the fo ```bash # depending on your setup you may have to prefix sudo to this command -pip install --editable . +pip3 install --editable . ``` Now `diffenv` will always point to your local repo, including any changes. From 9c6c238e88ca2ee7030484ff0b911830c99bf4d9 Mon Sep 17 00:00:00 2001 From: Stan James Date: Mon, 12 Aug 2019 17:33:12 +0200 Subject: [PATCH 34/87] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 9b60a71..371c963 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Build Status](https://travis-ci.com/error-central/diffenv.svg?branch=master)](https://travis-ci.com/error-central/diffenv) + # diffenv Output and compare all facets of development environments. From cf2391241e25dd16d628a128e1ce158c7a116813 Mon Sep 17 00:00:00 2001 From: Gabriel Pickard Date: Mon, 12 Aug 2019 18:24:58 +0200 Subject: [PATCH 35/87] Move facets into module directy because apparently that's how they're installed --- MANIFEST.in | 1 + {facets => diffenv/facets}/diffenv-version | 0 {facets => diffenv/facets}/directory/listing | 0 {facets => diffenv/facets}/directory/path | 0 {facets => diffenv/facets}/git/git-remote | 0 {facets => diffenv/facets}/git/git-status | 0 {facets => diffenv/facets}/git/git-user-email | 0 {facets => diffenv/facets}/git/git-user-name | 0 {facets => diffenv/facets}/git/version | 0 {facets => diffenv/facets}/nodejs/node-version | 0 {facets => diffenv/facets}/nodejs/npm-ls | 0 {facets => diffenv/facets}/nodejs/npm-version | 0 {facets => diffenv/facets}/os/timezone | 0 {facets => diffenv/facets}/os/version | 0 {facets => diffenv/facets}/php/composer-show | 0 {facets => diffenv/facets}/php/composer-version | 0 {facets => diffenv/facets}/php/php-version | 0 {facets => diffenv/facets}/python/pip-packages | 0 {facets => diffenv/facets}/python/pip3-packages | 0 {facets => diffenv/facets}/python/python-version | 0 {facets => diffenv/facets}/python/python3-version | 0 {facets => diffenv/facets}/python/virtualenv | 0 {facets => diffenv/facets}/python/which-python | 0 {facets => diffenv/facets}/python/which-python3 | 0 {facets => diffenv/facets}/ruby/gem-list | 0 {facets => diffenv/facets}/ruby/version | 0 {facets => diffenv/facets}/shell/envvars | 0 {facets => diffenv/facets}/shell/shell-version | 0 diffenv/main.py | 2 +- setup.py | 3 ++- 30 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 MANIFEST.in rename {facets => diffenv/facets}/diffenv-version (100%) rename {facets => diffenv/facets}/directory/listing (100%) rename {facets => diffenv/facets}/directory/path (100%) rename {facets => diffenv/facets}/git/git-remote (100%) rename {facets => diffenv/facets}/git/git-status (100%) rename {facets => diffenv/facets}/git/git-user-email (100%) rename {facets => diffenv/facets}/git/git-user-name (100%) rename {facets => diffenv/facets}/git/version (100%) rename {facets => diffenv/facets}/nodejs/node-version (100%) rename {facets => diffenv/facets}/nodejs/npm-ls (100%) rename {facets => diffenv/facets}/nodejs/npm-version (100%) rename {facets => diffenv/facets}/os/timezone (100%) rename {facets => diffenv/facets}/os/version (100%) rename {facets => diffenv/facets}/php/composer-show (100%) rename {facets => diffenv/facets}/php/composer-version (100%) rename {facets => diffenv/facets}/php/php-version (100%) rename {facets => diffenv/facets}/python/pip-packages (100%) rename {facets => diffenv/facets}/python/pip3-packages (100%) rename {facets => diffenv/facets}/python/python-version (100%) rename {facets => diffenv/facets}/python/python3-version (100%) rename {facets => diffenv/facets}/python/virtualenv (100%) rename {facets => diffenv/facets}/python/which-python (100%) rename {facets => diffenv/facets}/python/which-python3 (100%) rename {facets => diffenv/facets}/ruby/gem-list (100%) rename {facets => diffenv/facets}/ruby/version (100%) rename {facets => diffenv/facets}/shell/envvars (100%) rename {facets => diffenv/facets}/shell/shell-version (100%) diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..44a0b61 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +recursive-include diffenv/facets * \ No newline at end of file diff --git a/facets/diffenv-version b/diffenv/facets/diffenv-version similarity index 100% rename from facets/diffenv-version rename to diffenv/facets/diffenv-version diff --git a/facets/directory/listing b/diffenv/facets/directory/listing similarity index 100% rename from facets/directory/listing rename to diffenv/facets/directory/listing diff --git a/facets/directory/path b/diffenv/facets/directory/path similarity index 100% rename from facets/directory/path rename to diffenv/facets/directory/path diff --git a/facets/git/git-remote b/diffenv/facets/git/git-remote similarity index 100% rename from facets/git/git-remote rename to diffenv/facets/git/git-remote diff --git a/facets/git/git-status b/diffenv/facets/git/git-status similarity index 100% rename from facets/git/git-status rename to diffenv/facets/git/git-status diff --git a/facets/git/git-user-email b/diffenv/facets/git/git-user-email similarity index 100% rename from facets/git/git-user-email rename to diffenv/facets/git/git-user-email diff --git a/facets/git/git-user-name b/diffenv/facets/git/git-user-name similarity index 100% rename from facets/git/git-user-name rename to diffenv/facets/git/git-user-name diff --git a/facets/git/version b/diffenv/facets/git/version similarity index 100% rename from facets/git/version rename to diffenv/facets/git/version diff --git a/facets/nodejs/node-version b/diffenv/facets/nodejs/node-version similarity index 100% rename from facets/nodejs/node-version rename to diffenv/facets/nodejs/node-version diff --git a/facets/nodejs/npm-ls b/diffenv/facets/nodejs/npm-ls similarity index 100% rename from facets/nodejs/npm-ls rename to diffenv/facets/nodejs/npm-ls diff --git a/facets/nodejs/npm-version b/diffenv/facets/nodejs/npm-version similarity index 100% rename from facets/nodejs/npm-version rename to diffenv/facets/nodejs/npm-version diff --git a/facets/os/timezone b/diffenv/facets/os/timezone similarity index 100% rename from facets/os/timezone rename to diffenv/facets/os/timezone diff --git a/facets/os/version b/diffenv/facets/os/version similarity index 100% rename from facets/os/version rename to diffenv/facets/os/version diff --git a/facets/php/composer-show b/diffenv/facets/php/composer-show similarity index 100% rename from facets/php/composer-show rename to diffenv/facets/php/composer-show diff --git a/facets/php/composer-version b/diffenv/facets/php/composer-version similarity index 100% rename from facets/php/composer-version rename to diffenv/facets/php/composer-version diff --git a/facets/php/php-version b/diffenv/facets/php/php-version similarity index 100% rename from facets/php/php-version rename to diffenv/facets/php/php-version diff --git a/facets/python/pip-packages b/diffenv/facets/python/pip-packages similarity index 100% rename from facets/python/pip-packages rename to diffenv/facets/python/pip-packages diff --git a/facets/python/pip3-packages b/diffenv/facets/python/pip3-packages similarity index 100% rename from facets/python/pip3-packages rename to diffenv/facets/python/pip3-packages diff --git a/facets/python/python-version b/diffenv/facets/python/python-version similarity index 100% rename from facets/python/python-version rename to diffenv/facets/python/python-version diff --git a/facets/python/python3-version b/diffenv/facets/python/python3-version similarity index 100% rename from facets/python/python3-version rename to diffenv/facets/python/python3-version diff --git a/facets/python/virtualenv b/diffenv/facets/python/virtualenv similarity index 100% rename from facets/python/virtualenv rename to diffenv/facets/python/virtualenv diff --git a/facets/python/which-python b/diffenv/facets/python/which-python similarity index 100% rename from facets/python/which-python rename to diffenv/facets/python/which-python diff --git a/facets/python/which-python3 b/diffenv/facets/python/which-python3 similarity index 100% rename from facets/python/which-python3 rename to diffenv/facets/python/which-python3 diff --git a/facets/ruby/gem-list b/diffenv/facets/ruby/gem-list similarity index 100% rename from facets/ruby/gem-list rename to diffenv/facets/ruby/gem-list diff --git a/facets/ruby/version b/diffenv/facets/ruby/version similarity index 100% rename from facets/ruby/version rename to diffenv/facets/ruby/version diff --git a/facets/shell/envvars b/diffenv/facets/shell/envvars similarity index 100% rename from facets/shell/envvars rename to diffenv/facets/shell/envvars diff --git a/facets/shell/shell-version b/diffenv/facets/shell/shell-version similarity index 100% rename from facets/shell/shell-version rename to diffenv/facets/shell/shell-version diff --git a/diffenv/main.py b/diffenv/main.py index a31f482..e5655eb 100644 --- a/diffenv/main.py +++ b/diffenv/main.py @@ -112,7 +112,7 @@ def get_all_facets(): # Default facets default_facet_dir = join(os.path.split( - os.path.abspath(__file__))[0], '..', 'facets') # dir in our package + os.path.abspath(__file__))[0], 'facets') # dir in our package facet_map = extract_facet_dir(default_facet_dir, facet_map) return facet_map diff --git a/setup.py b/setup.py index 35272a2..b0a5ee8 100644 --- a/setup.py +++ b/setup.py @@ -8,13 +8,14 @@ def readme(): setup( name='diffenv', - version='0.2.0', + version='0.2.4', author='Stan James, Gabriel Pickard', author_email='wanderingstan@gmail.com, wergomat@gmail.com', url='http://github.com/error-central/diffenv', description='Compare development environments', long_description=readme(), long_description_content_type='text/markdown', + include_package_data=True, scripts=['bin/diffenv'], license='MIT', packages=['diffenv'], From 0e8c9f514502022400c1639663f766410f42607c Mon Sep 17 00:00:00 2001 From: Stan James Date: Tue, 13 Aug 2019 08:38:42 +0200 Subject: [PATCH 36/87] dont sow editor if not on tty --- README.md | 5 +++++ diffenv/editor.py | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 9b60a71..1360950 100644 --- a/README.md +++ b/README.md @@ -89,4 +89,9 @@ pip3 install --editable . Now `diffenv` will always point to your local repo, including any changes. +### Testing + +``` +python3 -m unittest tests/tests.py +``` diff --git a/diffenv/editor.py b/diffenv/editor.py index 3320e02..ce41cf4 100644 --- a/diffenv/editor.py +++ b/diffenv/editor.py @@ -1,6 +1,7 @@ import tempfile import subprocess import os +import sys # From: # https://chase-seibert.github.io/blog/2012/10/31/python-fork-exec-vim-raw-input.html @@ -10,6 +11,9 @@ def raw_input_editor(default=None, editor=None, prefix=None, suffix=None): ''' like the built-in raw_input(), except that it uses a visual text editor for ease of editing. Unline raw_input() it can also take a default value. ''' + if not sys.stdout.isatty(): + # Not a terminal, so don't show editor + return default with tempfile.NamedTemporaryFile(mode='r+', prefix=prefix, suffix=suffix) as tmpfile: if default: tmpfile.write(default) @@ -19,6 +23,7 @@ def raw_input_editor(default=None, editor=None, prefix=None, suffix=None): tmpfile.seek(0) return tmpfile.read().strip() except FileNotFoundError: + # Could not find editor return default From c73d6c5fa6a631f092f31e0715de7af430513fc1 Mon Sep 17 00:00:00 2001 From: Stan James Date: Tue, 13 Aug 2019 10:20:45 +0200 Subject: [PATCH 37/87] Fixing tests. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Testing env in commit message. diffenv-version: 0.2.0 directory: listing: tests: 160, 1565678433.2291105, DIR setup.py: 733, 1565678335.65217, 87dd8aa7a93a73f5b91d8e97b636da74 hooks: 96, 1564495268.8297575, DIR facets: 96, 1565678335.6676767, DIR examples: 160, 1565526937.9334917, DIR example_config.yaml: 45, 1564670036.66021, 759eab2b0f2d79bd2c0991820fa76787 env.yaml: 9557, 1565529046.05771, 10189a68cae562b4b15176c628584ea1 dist: 128, 1565525687.4886672, DIR diffenv.egg-info: 256, 1565525994.236996, DIR diffenv: 256, 1565678335.6507754, DIR build: 160, 1565525325.6887057, DIR bin: 96, 1565678300.6797817, DIR __pycache__: 96, 1564129273.2804494, DIR README.md: 2588, 1565678335.68020, f3438f14dc6bdadfddc7d24668bc2302 MANIFEST.in: 34, 1565678335.64307, abac8a0efd6ab97d247687aa250d071b LICENSE: 1070, 1563971721.10152, bbd2cb1a41f404058e170e74a725bb18 .vscode: 128, 1565036334.5557442, DIR .travis.yml: 814, 1565623659.24969, d7278269a9794d1260164b15942c0c60 .gitignore: 1221, 1565035870.68035, 3b1c12c1ca4e89f3c929c73c4427f846 .github: 96, 1565526937.9326942, DIR .git: 512, 1565684400.9814315, DIR .diffenv: 192, 1565528757.891121, DIR .DS_Store: 6148, 1564760143.68363, df20c99511081bcbf44de38d832fbe70 path: /Users/stan/code/diffenv git: git-remote: |- origin git@github.com:error-central/diffenv.git (fetch) origin git@github.com:error-central/diffenv.git (push) git-status: |- On branch master Your branch is ahead of 'origin/master' by 2 commits. (use "git push" to publish your local commits) Changes not staged for commit: (use "git add/rm ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) deleted: .diffenv/facets/git_facet modified: .vscode/launch.json modified: examples/config-small.yaml modified: tests/tests.py Untracked files: (use "git add ..." to include in what will be committed) env.yaml no changes added to commit (use "git add" and/or "git commit -a") git-user-email: stan@wanderingstan.com git-user-name: Stan James version: git version 2.22.0 os: timezone: 0200 version: Darwin 18.7.0 x86_64 python: pip-packages: astroid: 2.2.5 autopep8: 1.4.4 bleach: 3.1.0 certifi: 2019.6.16 chardet: 3.0.4 colorama: 0.4.1 diffenv: 0.2.0 docutils: 0.15.2 gitdb2: 2.0.5 GitPython: 2.1.13 idna: 2.8 importlib-metadata: 0.19 isort: 4.3.21 lazy-object-proxy: 1.4.1 mccabe: 0.6.1 pip: 19.0.3 pkginfo: 1.5.0.1 psutil: 5.6.3 pycodestyle: 2.5.0 Pygments: 2.4.2 pylint: 2.3.1 readme-renderer: 24.0 requests: 2.22.0 requests-toolbelt: 0.9.1 ruamel.yaml: 0.16.0 ruamel.yaml.clib: 0.1.0 setuptools: 41.0.1 six: 1.12.0 smmap2: 2.0.5 tqdm: 4.33.0 twine: 1.13.0 typed-ast: 1.4.0 urllib3: 1.25.3 webencodings: 0.5.1 wheel: 0.33.4 wrapt: 1.11.2 zipp: 0.5.2 pip3-packages: astroid: 2.2.5 autopep8: 1.4.4 bleach: 3.1.0 certifi: 2019.6.16 chardet: 3.0.4 colorama: 0.4.1 diffenv: 0.2.0 docutils: 0.15.2 gitdb2: 2.0.5 GitPython: 2.1.13 idna: 2.8 importlib-metadata: 0.19 isort: 4.3.21 lazy-object-proxy: 1.4.1 mccabe: 0.6.1 pip: 19.0.3 pkginfo: 1.5.0.1 psutil: 5.6.3 pycodestyle: 2.5.0 Pygments: 2.4.2 pylint: 2.3.1 readme-renderer: 24.0 requests: 2.22.0 requests-toolbelt: 0.9.1 ruamel.yaml: 0.16.0 ruamel.yaml.clib: 0.1.0 setuptools: 41.0.1 six: 1.12.0 smmap2: 2.0.5 tqdm: 4.33.0 twine: 1.13.0 typed-ast: 1.4.0 urllib3: 1.25.3 webencodings: 0.5.1 wheel: 0.33.4 wrapt: 1.11.2 zipp: 0.5.2 python-version: Python 3.7.3 python3-version: Python 3.7.3 virtualenv: | which-python: /usr/local/opt/python/libexec/bin/python which-python3: /usr/local/bin/python3 shell: envvars: Apple_PubSub_Socket_Render: /private/tmp/com.apple.launchd.SUotZpHrk2/Render CLICOLOR: '1' DISPLAY: /private/tmp/com.apple.launchd.CYIS8W8rHK/org.macosforge.xquartz:0 EDITOR: sublw GIT_EDITOR: subl -w HISTTIMEFORMAT: '%Y-%m-%d_%H-%M-%S; ' HOME: /Users/stan ISODATETIME: '2019-08-13 08:40:43' LANG: en_US.UTF-8 LOGNAME: stan LSCOLORS: GxFxCxDxBxegedabagaced NVM_BIN: /Users/stan/.nvm/versions/node/v10.16.0/bin NVM_CD_FLAGS: '' NVM_DIR: /Users/stan/.nvm OLDPWD: /Users/stan/code/diffenv PATH: /Users/stan/Library/Python/3.7/bin:/usr/local/opt/python/libexec/bin:/usr/local/opt/sqlite/bin:/Users/stan/.nvm/versions/node/v10.16.0/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/opt/X11/bin:/Users/stan/Library/Python/3.7/bin:/usr/local/opt/python/libexec/bin:/usr/local/opt/sqlite/bin:/Users/stan/.nvm/versions/node/v10.16.0/bin:/usr/local/cuda/bin:/usr/local/sbin:/Users/stan/bin:/Users/stan/bin PS1: \033[1;90m\]───── \h $ISODATETIME ─────\] $(git_prompt)\n\[\033[0;35m\]\w\[\033[0m\]\$ \[\033[0;92m\] PS2: '| => ' PWD: /Users/stan/code/diffenv SHELL: /bin/bash SHLVL: '2' SSH_AUTH_SOCK: /private/tmp/com.apple.launchd.ga06oU9huP/Listeners TERM: xterm-color TERM_PROGRAM: vscode TERM_PROGRAM_VERSION: 1.36.1 TMPDIR: /var/folders/9n/2vf6_x0s79bdzphhpyk83fnr0000gn/T/ USER: stan VIRTUALENVWRAPPER_HOOK_DIR: /Users/stan/Envs VIRTUALENVWRAPPER_PROJECT_FILENAME: .project VIRTUALENVWRAPPER_SCRIPT: /usr/local/bin/virtualenvwrapper.sh VIRTUALENVWRAPPER_WORKON_CD: '1' WORKON_HOME: /Users/stan/Envs XPC_FLAGS: '0x0' XPC_SERVICE_NAME: '0' _: /usr/local/bin/diffenv __CF_USER_TEXT_ENCODING: 0x1F5:0x0:0x0 __PYVENV_LAUNCHER__: /usr/local/bin/python3 shell-version: GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18) Copyright (C) 2007 Free Software Foundation, Inc. --- tests/tests.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/tests.py b/tests/tests.py index 47d9e08..f904e29 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -30,10 +30,10 @@ def test_sharing(self): if err: sys.stderr.write(err) result_lines = (out.decode("utf-8")).split("\n") - # Get the url - # Should be e.g. diffenv --compare https://transfer.sh/15xMWL/diff - diff_command = result_lines[2] + # Get the url + # 5th line Should be e.g. `diffenv --compare https://transfer.sh/15xMWL/diff` + diff_command = result_lines[5] self.assertEqual(diff_command[:26], "diffenv --compare https://") process = subprocess.Popen( From 3a2b3f48be0c0d6c761efaba7e1537730d0fa620 Mon Sep 17 00:00:00 2001 From: Stan James Date: Tue, 13 Aug 2019 10:23:18 +0200 Subject: [PATCH 38/87] add vs code debug for issue repporting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit
Environment - Click to open ```yaml diffenv-version: 0.2.0 directory: listing: tests: 160, 1565678433.2291105, DIR setup.py: 733, 1565678335.65217, 87dd8aa7a93a73f5b91d8e97b636da74 hooks: 96, 1564495268.8297575, DIR facets: 96, 1565678335.6676767, DIR examples: 160, 1565526937.9334917, DIR example_config.yaml: 45, 1564670036.66021, 759eab2b0f2d79bd2c0991820fa76787 env.yaml: 9557, 1565529046.05771, 10189a68cae562b4b15176c628584ea1 dist: 128, 1565525687.4886672, DIR diffenv.egg-info: 256, 1565525994.236996, DIR diffenv: 256, 1565678335.6507754, DIR build: 160, 1565525325.6887057, DIR bin: 96, 1565678300.6797817, DIR __pycache__: 96, 1564129273.2804494, DIR README.md: 2588, 1565678335.68020, f3438f14dc6bdadfddc7d24668bc2302 MANIFEST.in: 34, 1565678335.64307, abac8a0efd6ab97d247687aa250d071b LICENSE: 1070, 1563971721.10152, bbd2cb1a41f404058e170e74a725bb18 .vscode: 128, 1565036334.5557442, DIR .travis.yml: 814, 1565623659.24969, d7278269a9794d1260164b15942c0c60 .gitignore: 1221, 1565035870.68035, 3b1c12c1ca4e89f3c929c73c4427f846 .github: 96, 1565526937.9326942, DIR .git: 512, 1565684400.9814315, DIR .diffenv: 192, 1565528757.891121, DIR .DS_Store: 6148, 1564760143.68363, df20c99511081bcbf44de38d832fbe70 path: /Users/stan/code/diffenv git: git-remote: |- origin git@github.com:error-central/diffenv.git (fetch) origin git@github.com:error-central/diffenv.git (push) git-status: |- On branch master Your branch is ahead of 'origin/master' by 2 commits. (use "git push" to publish your local commits) Changes not staged for commit: (use "git add/rm ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) deleted: .diffenv/facets/git_facet modified: .vscode/launch.json modified: examples/config-small.yaml modified: tests/tests.py Untracked files: (use "git add ..." to include in what will be committed) env.yaml no changes added to commit (use "git add" and/or "git commit -a") git-user-email: stan@wanderingstan.com git-user-name: Stan James version: git version 2.22.0 os: timezone: 0200 version: Darwin 18.7.0 x86_64 python: pip-packages: astroid: 2.2.5 autopep8: 1.4.4 bleach: 3.1.0 certifi: 2019.6.16 chardet: 3.0.4 colorama: 0.4.1 diffenv: 0.2.0 docutils: 0.15.2 gitdb2: 2.0.5 GitPython: 2.1.13 idna: 2.8 importlib-metadata: 0.19 isort: 4.3.21 lazy-object-proxy: 1.4.1 mccabe: 0.6.1 pip: 19.0.3 pkginfo: 1.5.0.1 psutil: 5.6.3 pycodestyle: 2.5.0 Pygments: 2.4.2 pylint: 2.3.1 readme-renderer: 24.0 requests: 2.22.0 requests-toolbelt: 0.9.1 ruamel.yaml: 0.16.0 ruamel.yaml.clib: 0.1.0 setuptools: 41.0.1 six: 1.12.0 smmap2: 2.0.5 tqdm: 4.33.0 twine: 1.13.0 typed-ast: 1.4.0 urllib3: 1.25.3 webencodings: 0.5.1 wheel: 0.33.4 wrapt: 1.11.2 zipp: 0.5.2 pip3-packages: astroid: 2.2.5 autopep8: 1.4.4 bleach: 3.1.0 certifi: 2019.6.16 chardet: 3.0.4 colorama: 0.4.1 diffenv: 0.2.0 docutils: 0.15.2 gitdb2: 2.0.5 GitPython: 2.1.13 idna: 2.8 importlib-metadata: 0.19 isort: 4.3.21 lazy-object-proxy: 1.4.1 mccabe: 0.6.1 pip: 19.0.3 pkginfo: 1.5.0.1 psutil: 5.6.3 pycodestyle: 2.5.0 Pygments: 2.4.2 pylint: 2.3.1 readme-renderer: 24.0 requests: 2.22.0 requests-toolbelt: 0.9.1 ruamel.yaml: 0.16.0 ruamel.yaml.clib: 0.1.0 setuptools: 41.0.1 six: 1.12.0 smmap2: 2.0.5 tqdm: 4.33.0 twine: 1.13.0 typed-ast: 1.4.0 urllib3: 1.25.3 webencodings: 0.5.1 wheel: 0.33.4 wrapt: 1.11.2 zipp: 0.5.2 python-version: Python 3.7.3 python3-version: Python 3.7.3 virtualenv: | which-python: /usr/local/opt/python/libexec/bin/python which-python3: /usr/local/bin/python3 shell: envvars: Apple_PubSub_Socket_Render: /private/tmp/com.apple.launchd.SUotZpHrk2/Render CLICOLOR: '1' DISPLAY: /private/tmp/com.apple.launchd.CYIS8W8rHK/org.macosforge.xquartz:0 EDITOR: sublw GIT_EDITOR: subl -w HISTTIMEFORMAT: '%Y-%m-%d_%H-%M-%S; ' HOME: /Users/stan ISODATETIME: '2019-08-13 08:40:43' LANG: en_US.UTF-8 LOGNAME: stan LSCOLORS: GxFxCxDxBxegedabagaced NVM_BIN: /Users/stan/.nvm/versions/node/v10.16.0/bin NVM_CD_FLAGS: '' NVM_DIR: /Users/stan/.nvm OLDPWD: /Users/stan/code/diffenv PATH: /Users/stan/Library/Python/3.7/bin:/usr/local/opt/python/libexec/bin:/usr/local/opt/sqlite/bin:/Users/stan/.nvm/versions/node/v10.16.0/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/opt/X11/bin:/Users/stan/Library/Python/3.7/bin:/usr/local/opt/python/libexec/bin:/usr/local/opt/sqlite/bin:/Users/stan/.nvm/versions/node/v10.16.0/bin:/usr/local/cuda/bin:/usr/local/sbin:/Users/stan/bin:/Users/stan/bin PS1: \033[1;90m\]───── \h $ISODATETIME ─────\] $(git_prompt)\n\[\033[0;35m\]\w\[\033[0m\]\$ \[\033[0;92m\] PS2: '| => ' PWD: /Users/stan/code/diffenv SHELL: /bin/bash SHLVL: '2' SSH_AUTH_SOCK: /private/tmp/com.apple.launchd.ga06oU9huP/Listeners TERM: xterm-color TERM_PROGRAM: vscode TERM_PROGRAM_VERSION: 1.36.1 TMPDIR: /var/folders/9n/2vf6_x0s79bdzphhpyk83fnr0000gn/T/ USER: stan VIRTUALENVWRAPPER_HOOK_DIR: /Users/stan/Envs VIRTUALENVWRAPPER_PROJECT_FILENAME: .project VIRTUALENVWRAPPER_SCRIPT: /usr/local/bin/virtualenvwrapper.sh VIRTUALENVWRAPPER_WORKON_CD: '1' WORKON_HOME: /Users/stan/Envs XPC_FLAGS: '0x0' XPC_SERVICE_NAME: '0' _: /usr/local/bin/diffenv __CF_USER_TEXT_ENCODING: 0x1F5:0x0:0x0 __PYVENV_LAUNCHER__: /usr/local/bin/python3 shell-version: GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18) Copyright (C) 2007 Free Software Foundation, Inc.
--- .vscode/launch.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.vscode/launch.json b/.vscode/launch.json index dc77987..3e49875 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -50,6 +50,16 @@ "program": "${workspaceFolder}/bin/diffenv", "console": "integratedTerminal" }, + { + "name": "Python: diffenv --issue", + "type": "python", + "request": "launch", + "args": [ + "--issue" + ], + "program": "${workspaceFolder}/bin/diffenv", + "console": "integratedTerminal" + }, { "name": "Python: Current File", "type": "python", From 9306e2ea2bf9fed4a1e015eff175900279d01d12 Mon Sep 17 00:00:00 2001 From: Gabriel Pickard Date: Tue, 13 Aug 2019 10:50:43 +0200 Subject: [PATCH 39/87] Move hooks into visible folder --- MANIFEST.in | 3 ++- bin/diffenv | 4 ++-- {hooks => diffenv/hooks}/post-commit | 0 setup.py | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) rename {hooks => diffenv/hooks}/post-commit (100%) diff --git a/MANIFEST.in b/MANIFEST.in index 44a0b61..a82c80d 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1,2 @@ -recursive-include diffenv/facets * \ No newline at end of file +recursive-include diffenv/facets * +recursive-include diffenv/hooks * \ No newline at end of file diff --git a/bin/diffenv b/bin/diffenv index 1e33e29..d900d33 100755 --- a/bin/diffenv +++ b/bin/diffenv @@ -125,7 +125,7 @@ try: hooks_dst = os.path.join(main.git_toplevel, '.git', 'hooks', 'post-commit') dirname = os.path.split(os.path.abspath(__file__))[0] # Find hooks dir relative to this file - hooks_src = os.path.join(dirname, '..', 'hooks', 'post-commit') + hooks_src = os.path.join(dirname, 'hooks', 'post-commit') # Copy the hook copyfile(hooks_src, hooks_dst) # Make executable @@ -143,7 +143,7 @@ try: not args.no_color) outfilestream.writelines(diff) except BrokenPipeError as e: - # TODO (Gabe) : We should comment why we ignore this error. + # Ignore if less hangs up pass elif args.share: diff --git a/hooks/post-commit b/diffenv/hooks/post-commit similarity index 100% rename from hooks/post-commit rename to diffenv/hooks/post-commit diff --git a/setup.py b/setup.py index b0a5ee8..fc75db1 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ def readme(): setup( name='diffenv', - version='0.2.4', + version='0.2.5', author='Stan James, Gabriel Pickard', author_email='wanderingstan@gmail.com, wergomat@gmail.com', url='http://github.com/error-central/diffenv', From 3ed8ddaac9cff7933af200a9456c5ba83e417063 Mon Sep 17 00:00:00 2001 From: Stan James Date: Tue, 13 Aug 2019 11:17:04 +0200 Subject: [PATCH 40/87] testing whats its like to add env to commits. too much?? diffenv-version: 0.2.0 directory: listing: tests: 160, 1565678433.2291105, DIR setup.py: 733, 1565686663.53653, 7c1c3a03e40fe2a8d3d35cd9b8e396c4 facets: 96, 1565678335.6676767, DIR examples: 160, 1565526937.9334917, DIR example_config.yaml: 45, 1564670036.66021, 759eab2b0f2d79bd2c0991820fa76787 env.yaml: 9557, 1565529046.05771, 10189a68cae562b4b15176c628584ea1 dist: 128, 1565525687.4886672, DIR diffenv.egg-info: 256, 1565525994.236996, DIR diffenv: 288, 1565687026.3474302, DIR build: 160, 1565525325.6887057, DIR bin: 96, 1565687421.3104718, DIR __pycache__: 96, 1564129273.2804494, DIR README.md: 2588, 1565678335.68020, f3438f14dc6bdadfddc7d24668bc2302 MANIFEST.in: 68, 1565686663.53471, edff356a00ba1b5f0660d5514ebb5fb5 LICENSE: 1070, 1563971721.10152, bbd2cb1a41f404058e170e74a725bb18 .vscode: 128, 1565036334.5557442, DIR .travis.yml: 814, 1565623659.24969, d7278269a9794d1260164b15942c0c60 .gitignore: 1221, 1565035870.68035, 3b1c12c1ca4e89f3c929c73c4427f846 .github: 96, 1565526937.9326942, DIR .git: 544, 1565687825.8846838, DIR .diffenv: 192, 1565528757.891121, DIR .DS_Store: 6148, 1564760143.68363, df20c99511081bcbf44de38d832fbe70 path: /Users/stan/code/diffenv git: git-remote: |- origin git@github.com:error-central/diffenv.git (fetch) origin git@github.com:error-central/diffenv.git (push) git-status: |- On branch master Your branch is up to date with 'origin/master'. Changes to be committed: (use "git reset HEAD ..." to unstage) deleted: .diffenv/facets/git_facet modified: bin/diffenv new file: diffenv/hooks/prepare-commit-msg modified: diffenv/main.py Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) modified: diffenv/hooks/prepare-commit-msg modified: examples/config-small.yaml Untracked files: (use "git add ..." to include in what will be committed) env.yaml git-user-email: stan@wanderingstan.com git-user-name: Stan James version: git version 2.22.0 os: timezone: 0200 version: Darwin 18.7.0 x86_64 python: pip-packages: astroid: 2.2.5 autopep8: 1.4.4 bleach: 3.1.0 certifi: 2019.6.16 chardet: 3.0.4 colorama: 0.4.1 diffenv: 0.2.0 docutils: 0.15.2 gitdb2: 2.0.5 GitPython: 2.1.13 idna: 2.8 importlib-metadata: 0.19 isort: 4.3.21 lazy-object-proxy: 1.4.1 mccabe: 0.6.1 pip: 19.0.3 pkginfo: 1.5.0.1 psutil: 5.6.3 pycodestyle: 2.5.0 Pygments: 2.4.2 pylint: 2.3.1 readme-renderer: 24.0 requests: 2.22.0 requests-toolbelt: 0.9.1 ruamel.yaml: 0.16.0 ruamel.yaml.clib: 0.1.0 setuptools: 41.0.1 six: 1.12.0 smmap2: 2.0.5 tqdm: 4.33.0 twine: 1.13.0 typed-ast: 1.4.0 urllib3: 1.25.3 webencodings: 0.5.1 wheel: 0.33.4 wrapt: 1.11.2 zipp: 0.5.2 pip3-packages: astroid: 2.2.5 autopep8: 1.4.4 bleach: 3.1.0 certifi: 2019.6.16 chardet: 3.0.4 colorama: 0.4.1 diffenv: 0.2.0 docutils: 0.15.2 gitdb2: 2.0.5 GitPython: 2.1.13 idna: 2.8 importlib-metadata: 0.19 isort: 4.3.21 lazy-object-proxy: 1.4.1 mccabe: 0.6.1 pip: 19.0.3 pkginfo: 1.5.0.1 psutil: 5.6.3 pycodestyle: 2.5.0 Pygments: 2.4.2 pylint: 2.3.1 readme-renderer: 24.0 requests: 2.22.0 requests-toolbelt: 0.9.1 ruamel.yaml: 0.16.0 ruamel.yaml.clib: 0.1.0 setuptools: 41.0.1 six: 1.12.0 smmap2: 2.0.5 tqdm: 4.33.0 twine: 1.13.0 typed-ast: 1.4.0 urllib3: 1.25.3 webencodings: 0.5.1 wheel: 0.33.4 wrapt: 1.11.2 zipp: 0.5.2 python-version: Python 3.7.3 python3-version: Python 3.7.3 virtualenv: | which-python: /usr/local/opt/python/libexec/bin/python which-python3: /usr/local/bin/python3 shell: envvars: Apple_PubSub_Socket_Render: /private/tmp/com.apple.launchd.SUotZpHrk2/Render CLICOLOR: '1' DISPLAY: /private/tmp/com.apple.launchd.CYIS8W8rHK/org.macosforge.xquartz:0 EDITOR: sublw GIT_AUTHOR_DATE: '@1565687824 +0200' GIT_AUTHOR_EMAIL: stan@wanderingstan.com GIT_AUTHOR_NAME: Stan James GIT_EDITOR: subl -w GIT_EXEC_PATH: /usr/local/Cellar/git/2.22.0/libexec/git-core GIT_INDEX_FILE: .git/index GIT_PREFIX: '' HISTTIMEFORMAT: '%Y-%m-%d_%H-%M-%S; ' HOME: /Users/stan ISODATETIME: '2019-08-13 08:40:43' LANG: en_US.UTF-8 LOGNAME: stan LSCOLORS: GxFxCxDxBxegedabagaced NVM_BIN: /Users/stan/.nvm/versions/node/v10.16.0/bin NVM_CD_FLAGS: '' NVM_DIR: /Users/stan/.nvm PATH: /usr/local/Cellar/git/2.22.0/libexec/git-core:/Users/stan/Library/Python/3.7/bin:/usr/local/opt/python/libexec/bin:/usr/local/opt/sqlite/bin:/Users/stan/.nvm/versions/node/v10.16.0/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/opt/X11/bin:/Users/stan/Library/Python/3.7/bin:/usr/local/opt/python/libexec/bin:/usr/local/opt/sqlite/bin:/Users/stan/.nvm/versions/node/v10.16.0/bin:/usr/local/cuda/bin:/usr/local/sbin:/Users/stan/bin:/Users/stan/bin PWD: /Users/stan/code/diffenv SHELL: /bin/bash SHLVL: '3' SSH_AUTH_SOCK: /private/tmp/com.apple.launchd.ga06oU9huP/Listeners TERM: xterm-color TERM_PROGRAM: vscode TERM_PROGRAM_VERSION: 1.36.1 TMPDIR: /var/folders/9n/2vf6_x0s79bdzphhpyk83fnr0000gn/T/ USER: stan VIRTUALENVWRAPPER_HOOK_DIR: /Users/stan/Envs VIRTUALENVWRAPPER_PROJECT_FILENAME: .project VIRTUALENVWRAPPER_SCRIPT: /usr/local/bin/virtualenvwrapper.sh VIRTUALENVWRAPPER_WORKON_CD: '1' WORKON_HOME: /Users/stan/Envs XPC_FLAGS: '0x0' XPC_SERVICE_NAME: '0' _: /usr/local/bin/diffenv __CF_USER_TEXT_ENCODING: 0x1F5:0x0:0x0 __PYVENV_LAUNCHER__: /usr/local/bin/python3 shell-version: GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18) Copyright (C) 2007 Free Software Foundation, Inc. --- .diffenv/facets/git_facet | 3 --- bin/diffenv | 20 ++++++++++++++++---- diffenv/hooks/prepare-commit-msg | 15 +++++++++++++++ diffenv/main.py | 5 +++++ 4 files changed, 36 insertions(+), 7 deletions(-) delete mode 100755 .diffenv/facets/git_facet create mode 100644 diffenv/hooks/prepare-commit-msg diff --git a/.diffenv/facets/git_facet b/.diffenv/facets/git_facet deleted file mode 100755 index 132aab6..0000000 --- a/.diffenv/facets/git_facet +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -echo "This is a test git/repo facet" diff --git a/bin/diffenv b/bin/diffenv index d900d33..f74efbb 100755 --- a/bin/diffenv +++ b/bin/diffenv @@ -122,16 +122,28 @@ try: sys.stderr.write("ERROR: Not in a git repot, so cannot add git hooks.") exit(1) - hooks_dst = os.path.join(main.git_toplevel, '.git', 'hooks', 'post-commit') - dirname = os.path.split(os.path.abspath(__file__))[0] - # Find hooks dir relative to this file - hooks_src = os.path.join(dirname, 'hooks', 'post-commit') + + hooks_dst = os.path.join( + main.git_toplevel, '.git', 'hooks', 'post-commit') + hooks_src = os.path.join(main.get_main_dir(), 'hooks', 'post-commit') # Copy the hook copyfile(hooks_src, hooks_dst) # Make executable copystat(hooks_src, hooks_dst) print("virtualenv: Installed git post-commit hook to %s" % hooks_dst) + hooks_dst = os.path.join( + main.git_toplevel, '.git', 'hooks', 'prepare-commit-msg') + hooks_src = os.path.join( + main.get_main_dir(), 'hooks', 'prepare-commit-msg') + + # Copy the hook + copyfile(hooks_src, hooks_dst) + # Make executable + copystat(hooks_src, hooks_dst) + print("virtualenv: Installed git prepare-commit-msg hook to %s" % hooks_dst) + + elif args.compare is not None: # --compare : compare with file or url sys.stderr.write("Collecting env...\r") diff --git a/diffenv/hooks/prepare-commit-msg b/diffenv/hooks/prepare-commit-msg new file mode 100644 index 0000000..ad1375b --- /dev/null +++ b/diffenv/hooks/prepare-commit-msg @@ -0,0 +1,15 @@ +#!/bin/sh +# +# An hook script to prepare the commit log message. +# Called by "git commit" with the name of the file that has the +# commit message, followed by the description of the commit +# message's source. The hook's purpose is to edit the commit +# message file. If the hook fails with a non-zero status, +# the commit is aborted. + +COMMIT_MSG_FILE=$1 +COMMIT_SOURCE=$2 +SHA1=$3 + +diffenv >> "$COMMIT_MSG_FILE" + diff --git a/diffenv/main.py b/diffenv/main.py index e5655eb..fefc3d1 100644 --- a/diffenv/main.py +++ b/diffenv/main.py @@ -171,3 +171,8 @@ def read_file_or_url(name: str): else: with open(name) as file: return yaml.load(file) + + +def get_main_dir(): + """ Get path to this dir """ + return os.path.split(os.path.abspath(__file__))[0] From abb9fb1f74330fbed55d000535029140b3f0f45c Mon Sep 17 00:00:00 2001 From: Stan James Date: Tue, 13 Aug 2019 11:31:33 +0200 Subject: [PATCH 41/87] Testing links in commit messages ./README.md ./diffenv/main.py diffenv/main.py /diffenv/main.py diffenv-version: 0.2.0 directory: listing: tests: 160, 1565678433.2291105, DIR setup.py: 733, 1565686663.53653, 7c1c3a03e40fe2a8d3d35cd9b8e396c4 facets: 96, 1565678335.6676767, DIR examples: 160, 1565526937.9334917, DIR example_config.yaml: 45, 1564670036.66021, 759eab2b0f2d79bd2c0991820fa76787 env.yaml: 9557, 1565529046.05771, 10189a68cae562b4b15176c628584ea1 dist: 128, 1565525687.4886672, DIR diffenv.egg-info: 256, 1565525994.236996, DIR diffenv: 288, 1565687026.3474302, DIR build: 160, 1565525325.6887057, DIR bin: 96, 1565687421.3104718, DIR __pycache__: 96, 1564129273.2804494, DIR README.md: 2588, 1565678335.68020, f3438f14dc6bdadfddc7d24668bc2302 MANIFEST.in: 68, 1565686663.53471, edff356a00ba1b5f0660d5514ebb5fb5 LICENSE: 1070, 1563971721.10152, bbd2cb1a41f404058e170e74a725bb18 .vscode: 128, 1565036334.5557442, DIR .travis.yml: 814, 1565623659.24969, d7278269a9794d1260164b15942c0c60 .gitignore: 1221, 1565035870.68035, 3b1c12c1ca4e89f3c929c73c4427f846 .github: 96, 1565526937.9326942, DIR .git: 544, 1565688695.6738453, DIR .diffenv: 192, 1565528757.891121, DIR .DS_Store: 6148, 1564760143.68363, df20c99511081bcbf44de38d832fbe70 path: /Users/stan/code/diffenv git: git-remote: |- origin git@github.com:error-central/diffenv.git (fetch) origin git@github.com:error-central/diffenv.git (push) git-status: |- On branch master Your branch is up to date with 'origin/master'. Changes to be committed: (use "git reset HEAD ..." to unstage) modified: diffenv/hooks/prepare-commit-msg Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) modified: examples/config-small.yaml Untracked files: (use "git add ..." to include in what will be committed) env.yaml git-user-email: stan@wanderingstan.com git-user-name: Stan James version: git version 2.22.0 os: timezone: 0200 version: Darwin 18.7.0 x86_64 python: pip-packages: astroid: 2.2.5 autopep8: 1.4.4 bleach: 3.1.0 certifi: 2019.6.16 chardet: 3.0.4 colorama: 0.4.1 diffenv: 0.2.0 docutils: 0.15.2 gitdb2: 2.0.5 GitPython: 2.1.13 idna: 2.8 importlib-metadata: 0.19 isort: 4.3.21 lazy-object-proxy: 1.4.1 mccabe: 0.6.1 pip: 19.0.3 pkginfo: 1.5.0.1 psutil: 5.6.3 pycodestyle: 2.5.0 Pygments: 2.4.2 pylint: 2.3.1 readme-renderer: 24.0 requests: 2.22.0 requests-toolbelt: 0.9.1 ruamel.yaml: 0.16.0 ruamel.yaml.clib: 0.1.0 setuptools: 41.0.1 six: 1.12.0 smmap2: 2.0.5 tqdm: 4.33.0 twine: 1.13.0 typed-ast: 1.4.0 urllib3: 1.25.3 webencodings: 0.5.1 wheel: 0.33.4 wrapt: 1.11.2 zipp: 0.5.2 pip3-packages: astroid: 2.2.5 autopep8: 1.4.4 bleach: 3.1.0 certifi: 2019.6.16 chardet: 3.0.4 colorama: 0.4.1 diffenv: 0.2.0 docutils: 0.15.2 gitdb2: 2.0.5 GitPython: 2.1.13 idna: 2.8 importlib-metadata: 0.19 isort: 4.3.21 lazy-object-proxy: 1.4.1 mccabe: 0.6.1 pip: 19.0.3 pkginfo: 1.5.0.1 psutil: 5.6.3 pycodestyle: 2.5.0 Pygments: 2.4.2 pylint: 2.3.1 readme-renderer: 24.0 requests: 2.22.0 requests-toolbelt: 0.9.1 ruamel.yaml: 0.16.0 ruamel.yaml.clib: 0.1.0 setuptools: 41.0.1 six: 1.12.0 smmap2: 2.0.5 tqdm: 4.33.0 twine: 1.13.0 typed-ast: 1.4.0 urllib3: 1.25.3 webencodings: 0.5.1 wheel: 0.33.4 wrapt: 1.11.2 zipp: 0.5.2 python-version: Python 3.7.3 python3-version: Python 3.7.3 virtualenv: | which-python: /usr/local/opt/python/libexec/bin/python which-python3: /usr/local/bin/python3 shell: envvars: Apple_PubSub_Socket_Render: /private/tmp/com.apple.launchd.SUotZpHrk2/Render CLICOLOR: '1' DISPLAY: /private/tmp/com.apple.launchd.CYIS8W8rHK/org.macosforge.xquartz:0 EDITOR: sublw GIT_AUTHOR_DATE: '@1565688693 +0200' GIT_AUTHOR_EMAIL: stan@wanderingstan.com GIT_AUTHOR_NAME: Stan James GIT_EDITOR: subl -w GIT_EXEC_PATH: /usr/local/Cellar/git/2.22.0/libexec/git-core GIT_INDEX_FILE: .git/index GIT_PREFIX: '' HISTTIMEFORMAT: '%Y-%m-%d_%H-%M-%S; ' HOME: /Users/stan ISODATETIME: '2019-08-13 08:40:43' LANG: en_US.UTF-8 LOGNAME: stan LSCOLORS: GxFxCxDxBxegedabagaced NVM_BIN: /Users/stan/.nvm/versions/node/v10.16.0/bin NVM_CD_FLAGS: '' NVM_DIR: /Users/stan/.nvm PATH: /usr/local/Cellar/git/2.22.0/libexec/git-core:/Users/stan/Library/Python/3.7/bin:/usr/local/opt/python/libexec/bin:/usr/local/opt/sqlite/bin:/Users/stan/.nvm/versions/node/v10.16.0/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/opt/X11/bin:/Users/stan/Library/Python/3.7/bin:/usr/local/opt/python/libexec/bin:/usr/local/opt/sqlite/bin:/Users/stan/.nvm/versions/node/v10.16.0/bin:/usr/local/cuda/bin:/usr/local/sbin:/Users/stan/bin:/Users/stan/bin PWD: /Users/stan/code/diffenv SHELL: /bin/bash SHLVL: '3' SSH_AUTH_SOCK: /private/tmp/com.apple.launchd.ga06oU9huP/Listeners TERM: xterm-color TERM_PROGRAM: vscode TERM_PROGRAM_VERSION: 1.36.1 TMPDIR: /var/folders/9n/2vf6_x0s79bdzphhpyk83fnr0000gn/T/ USER: stan VIRTUALENVWRAPPER_HOOK_DIR: /Users/stan/Envs VIRTUALENVWRAPPER_PROJECT_FILENAME: .project VIRTUALENVWRAPPER_SCRIPT: /usr/local/bin/virtualenvwrapper.sh VIRTUALENVWRAPPER_WORKON_CD: '1' WORKON_HOME: /Users/stan/Envs XPC_FLAGS: '0x0' XPC_SERVICE_NAME: '0' _: /usr/local/bin/diffenv __CF_USER_TEXT_ENCODING: 0x1F5:0x0:0x0 __PYVENV_LAUNCHER__: /usr/local/bin/python3 shell-version: GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18) Copyright (C) 2007 Free Software Foundation, Inc. --- diffenv/hooks/prepare-commit-msg | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 diffenv/hooks/prepare-commit-msg diff --git a/diffenv/hooks/prepare-commit-msg b/diffenv/hooks/prepare-commit-msg old mode 100644 new mode 100755 From 509f6d15f1b40edf4f6c6de7b804f2bd81a88771 Mon Sep 17 00:00:00 2001 From: Gabriel Pickard Date: Tue, 13 Aug 2019 11:47:27 +0200 Subject: [PATCH 42/87] Ignore .git directory in file listing --- diffenv/facets/directory/listing | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/diffenv/facets/directory/listing b/diffenv/facets/directory/listing index a343dee..b7c4a09 100755 --- a/diffenv/facets/directory/listing +++ b/diffenv/facets/directory/listing @@ -40,7 +40,8 @@ def file_info(path): def collect_dir_info(path): return CommentedMap([(p.name or '.', file_info(p)) for p in sorted(list(path.iterdir()), - reverse=True)]) + reverse=True) + if p.name != '.git']) yaml.dump(collect_dir_info(pathlib.Path('.')), From 147baf18547efc641abbbd9d497666df51b8f72e Mon Sep 17 00:00:00 2001 From: Gabriel Pickard Date: Tue, 13 Aug 2019 11:57:29 +0200 Subject: [PATCH 43/87] Don't reset color if we aren't marking --- diffenv/diffviewer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/diffenv/diffviewer.py b/diffenv/diffviewer.py index 237fc47..656c9d7 100644 --- a/diffenv/diffviewer.py +++ b/diffenv/diffviewer.py @@ -64,7 +64,10 @@ def colorize_diff(diff: typing.List[str]): # keep track of leading whitespace to catch unindent col = len(line) - len(line.lstrip()) - line = marking + line + Fore.RESET + reset = '' + if marking: + reset = Fore.RESET + line = marking + line + reset if A_MARKER_TXT in line or B_MARKER_TXT in line: # reset because text lines are marked individually marking = '' From c1c7b89ed07e5f071a141a289bc5eaff52d8205e Mon Sep 17 00:00:00 2001 From: Stan James Date: Wed, 14 Aug 2019 14:09:34 +0200 Subject: [PATCH 44/87] readme love --- README.md | 38 +++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6a3cd33..18980e8 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,10 @@ [![Build Status](https://travis-ci.com/error-central/diffenv.svg?branch=master)](https://travis-ci.com/error-central/diffenv) # diffenv -Output and compare all facets of development environments. ## Overview -diffenv gathers and compares runtime environment metadata. A standard way of capturing a complete picture of a development environment. +diffenv gathers and compares runtime environments. It defines a simple standard for stoting a complete picture of a development environment. ![output](https://user-images.githubusercontent.com/673455/62836101-182d1200-bc60-11e9-95c7-1f52dfb197b7.gif) @@ -29,9 +28,38 @@ os: [Full example output](https://raw.githubusercontent.com/error-central/diffenv/master/examples/gabe_env.yaml). ### Use cases -* Add environment data to bug reports in a _standardized format_. [Example](https://github.com/error-central/diffenv/issues/29) -* Diagnose what subtle difference is making things fail on your coworker's machine. -* Compare your current environment against past recorded state when things still worked. +* Add environment data to bug reports, even automatically. [Example](https://github.com/error-central/diffenv/issues/29) +* Diagnose what subtle difference in environment is making things fail on your coworker's machine. +* Compare your current environment against past commits when things worked. + +## Options + +```bash +usage: diffenv [-h] [-o OUTPUT] [-c COMPARE] [--add-hooks] [--share] [--issue] + [--post POST] [--config CONFIG] [--ignore-config] [--no-color] + [--no-paging] [--version] + +Diff your total environment. Run without any params to simply output current +environment state as YAML. + +optional arguments: + -h, --help show this help message and exit + -o OUTPUT, --output OUTPUT + output to file instead of stdout + -c COMPARE, --compare COMPARE + file or URL to compare against the current env + --add-hooks install git hooks in current repo and exit + --share store current env and return URL that can be shared + --issue create github issue + --post POST POST env to specific URL when sharing; must be used + with --share + --config CONFIG load config from specific file + --ignore-config ignore configs and run all facets + --no-color don't color diff output + --no-paging don't use less for paging output + --version display version and exit + +``` ## Installation From eb1cae46167a2a2409a587de43e494a62db9d612 Mon Sep 17 00:00:00 2001 From: Stan James Date: Wed, 14 Aug 2019 17:31:37 +0200 Subject: [PATCH 45/87] typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 18980e8..617f886 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ## Overview -diffenv gathers and compares runtime environments. It defines a simple standard for stoting a complete picture of a development environment. +diffenv gathers and compares runtime environments. It defines a simple standard for storing a complete picture of a development environment. ![output](https://user-images.githubusercontent.com/673455/62836101-182d1200-bc60-11e9-95c7-1f52dfb197b7.gif) From 97bacf39ed88e5e8d94692a8f22ebaf8f59a8ca5 Mon Sep 17 00:00:00 2001 From: Stan James Date: Wed, 14 Aug 2019 17:49:32 +0200 Subject: [PATCH 46/87] Add example diff --- README.md | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 617f886..3c8fb7d 100644 --- a/README.md +++ b/README.md @@ -24,9 +24,45 @@ os: timezone: 0200 version: Darwin 18.7.0 x86_64 ``` - [Full example output](https://raw.githubusercontent.com/error-central/diffenv/master/examples/gabe_env.yaml). + +### Simplified diff +```diff +git: + git-user-name: +- <<-: Stan James ++ +>>: Gabriel Pickard + version: +- <<-: git version 2.22.0 ++ +>>: git version 2.11.0 +os: + version: +- <<-: Darwin 18.7.0 x86_64 ++ +>>: Linux 4.19.34-04457-g5b63d4390e96 x86_64 +python: + python-version: +- <<-: Python 3.7.3 ++ +>>: Python 2.7.13 + python3-version: +- <<-: Python 3.7.3 ++ +>>: Python 3.5.3 + which-python: +- <<-: /usr/local/opt/python/libexec/bin/python ++ +>>: /usr/bin/python + shell-version: +- <<-: GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18) Copyright (C) +- 2007 Free Software Foundation, Inc. ++ +>>: |- ++ GNU bash, version 4.4.12(1)-release (x86_64-pc-linux-gnu) ++ Copyright (C) 2016 Free Software Foundation, Inc. ++ License GPLv3+: GNU GPL version 3 or later ++ ++ This is free software; you are free to change and redistribute it. ++ There is NO WARRANTY, to the extent permitted by law. +``` + + ### Use cases * Add environment data to bug reports, even automatically. [Example](https://github.com/error-central/diffenv/issues/29) * Diagnose what subtle difference in environment is making things fail on your coworker's machine. From 369b714500ce2eb05cb4b60f0fe1ecb0c8197558 Mon Sep 17 00:00:00 2001 From: Stan James Date: Wed, 14 Aug 2019 18:09:38 +0200 Subject: [PATCH 47/87] update readme --- README.md | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 3c8fb7d..8818564 100644 --- a/README.md +++ b/README.md @@ -50,16 +50,6 @@ python: which-python: - <<-: /usr/local/opt/python/libexec/bin/python + +>>: /usr/bin/python - shell-version: -- <<-: GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18) Copyright (C) -- 2007 Free Software Foundation, Inc. -+ +>>: |- -+ GNU bash, version 4.4.12(1)-release (x86_64-pc-linux-gnu) -+ Copyright (C) 2016 Free Software Foundation, Inc. -+ License GPLv3+: GNU GPL version 3 or later -+ -+ This is free software; you are free to change and redistribute it. -+ There is NO WARRANTY, to the extent permitted by law. ``` @@ -155,6 +145,14 @@ pip3 install --editable . Now `diffenv` will always point to your local repo, including any changes. + +For testing on docker containers: +``` +docker pull python +docker run -it python bash +# Now e.g. `pip install diffenv` +``` + ### Testing ``` From 32e2118ae3432be54bb367a1458f607103ca81b6 Mon Sep 17 00:00:00 2001 From: Stan James Date: Wed, 14 Aug 2019 18:10:27 +0200 Subject: [PATCH 48/87] readme --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8818564..ecb256f 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ python: ## Options -```bash +``` usage: diffenv [-h] [-o OUTPUT] [-c COMPARE] [--add-hooks] [--share] [--issue] [--post POST] [--config CONFIG] [--ignore-config] [--no-color] [--no-paging] [--version] @@ -147,7 +147,7 @@ Now `diffenv` will always point to your local repo, including any changes. For testing on docker containers: -``` +```bash docker pull python docker run -it python bash # Now e.g. `pip install diffenv` @@ -155,7 +155,7 @@ docker run -it python bash ### Testing -``` +```bash python3 -m unittest tests/tests.py ``` From 4e41b86a8216f8b38542cbbe9118c6e4ef385907 Mon Sep 17 00:00:00 2001 From: Stan James Date: Wed, 14 Aug 2019 18:15:33 +0200 Subject: [PATCH 49/87] yaml format readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ecb256f..1f5a866 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ diffenv gathers and compares runtime environments. It defines a simple standard ### Simplified example -```bash +```yaml $ diffenv python: python-version: Python 3.7.3 From a88499163a90be10d126a1c00bad5667574f2e29 Mon Sep 17 00:00:00 2001 From: Gabriel Pickard Date: Wed, 14 Aug 2019 18:15:24 +0200 Subject: [PATCH 50/87] Don't require yaml in facets --- diffenv/facets/directory/listing | 18 ++++++++++-------- diffenv/facets/shell/envvars | 10 ++++++---- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/diffenv/facets/directory/listing b/diffenv/facets/directory/listing index b7c4a09..8a9bdd2 100755 --- a/diffenv/facets/directory/listing +++ b/diffenv/facets/directory/listing @@ -3,12 +3,14 @@ import os import hashlib import sys -from ruamel.yaml import YAML -from ruamel.yaml.comments import CommentedMap +#from ruamel.yaml import YAML +#from ruamel.yaml.comments import CommentedMap import pathlib +import json +from collections import OrderedDict -yaml = YAML() +#yaml = YAML() MAX_FILE_SIZE_HASH = 1024 * 1024 # 1 MB @@ -38,11 +40,11 @@ def file_info(path): def collect_dir_info(path): - return CommentedMap([(p.name or '.', file_info(p)) - for p in sorted(list(path.iterdir()), - reverse=True) - if p.name != '.git']) + return OrderedDict([(p.name or '.', file_info(p)) + for p in sorted(list(path.iterdir()), + reverse=True) + if p.name != '.git']) -yaml.dump(collect_dir_info(pathlib.Path('.')), +json.dump(collect_dir_info(pathlib.Path('.')), sys.stdout) diff --git a/diffenv/facets/shell/envvars b/diffenv/facets/shell/envvars index c558fc7..7070dd2 100755 --- a/diffenv/facets/shell/envvars +++ b/diffenv/facets/shell/envvars @@ -1,15 +1,17 @@ #!/usr/bin/env python3 -from ruamel.yaml import YAML -from ruamel.yaml.comments import CommentedMap +#from ruamel.yaml import YAML +#from ruamel.yaml.comments import CommentedMap import os import sys from typing import Tuple import hashlib +import json +from collections import OrderedDict # Return a YAML list of all environment variables, with sensitive ones hashed. -yaml = YAML() +# yaml = YAML() def filter_sensitive_vars(env_var: Tuple[str, str]): @@ -28,4 +30,4 @@ def filter_sensitive_vars(env_var: Tuple[str, str]): env_vars = os.environ.items() filtered_env_vars = list(map(filter_sensitive_vars, env_vars)) -yaml.dump(CommentedMap(sorted(filtered_env_vars)), sys.stdout) +json.dump(OrderedDict(sorted(filtered_env_vars)), sys.stdout) From 0208fdec72dc4e101387eced697c08c39da013fb Mon Sep 17 00:00:00 2001 From: Stan James Date: Wed, 14 Aug 2019 18:21:14 +0200 Subject: [PATCH 51/87] readme --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1f5a866..2d9936b 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ diffenv gathers and compares runtime environments. It defines a simple standard ### Simplified example ```yaml -$ diffenv +#$ diffenv python: python-version: Python 3.7.3 shell: @@ -29,6 +29,7 @@ os: ### Simplified diff ```diff +#$ diffenv --compare https://transfer.sh/P1gQZ/env.yaml git: git-user-name: - <<-: Stan James From 95c78a7925623ca7165416ebb06240d415a2ef65 Mon Sep 17 00:00:00 2001 From: Gabriel Pickard Date: Wed, 14 Aug 2019 18:26:04 +0200 Subject: [PATCH 52/87] Release instructions --- README.md | 10 ++++++++++ setup.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2d9936b..a6066e5 100644 --- a/README.md +++ b/README.md @@ -160,3 +160,13 @@ docker run -it python bash python3 -m unittest tests/tests.py ``` +### Cutting a release + +First edit `setup.py` and bump the version, then: + +```bash +python3 setup.py sdist +# modify the below to match the file of the version you just created +twine upload dist/diffenv- +``` + diff --git a/setup.py b/setup.py index fc75db1..8a840ac 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ def readme(): setup( name='diffenv', - version='0.2.5', + version='0.2.6', author='Stan James, Gabriel Pickard', author_email='wanderingstan@gmail.com, wergomat@gmail.com', url='http://github.com/error-central/diffenv', From 653dd4e73a8e8e79969619ce2db41f283fc5edd5 Mon Sep 17 00:00:00 2001 From: Stan James Date: Wed, 14 Aug 2019 18:27:17 +0200 Subject: [PATCH 53/87] share exampe to readme --- README.md | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index a6066e5..576406c 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ diffenv gathers and compares runtime environments. It defines a simple standard ![output](https://user-images.githubusercontent.com/673455/62836101-182d1200-bc60-11e9-95c7-1f52dfb197b7.gif) -### Simplified example +### Save your current environment ```yaml #$ diffenv python: @@ -23,11 +23,23 @@ shell: os: timezone: 0200 version: Darwin 18.7.0 x86_64 + +# ...trimmed +``` +(Simplified example. See [full example](https://raw.githubusercontent.com/error-central/diffenv/master/examples/gabe_env.yaml) here) + +### Share your environment with co-worker ``` -[Full example output](https://raw.githubusercontent.com/error-central/diffenv/master/examples/gabe_env.yaml). +#$ diffenv --share +Your env was uploaded to: https://transfer.sh/P1gQZ/env.yaml + +Run the following line on comparison environment: + +diffenv --compare https://transfer.sh/P1gQZ/env.yaml +``` -### Simplified diff +### Diff your environment with co-worker ```diff #$ diffenv --compare https://transfer.sh/P1gQZ/env.yaml git: @@ -51,6 +63,8 @@ python: which-python: - <<-: /usr/local/opt/python/libexec/bin/python + +>>: /usr/bin/python + +# ...trimmed ``` @@ -160,13 +174,3 @@ docker run -it python bash python3 -m unittest tests/tests.py ``` -### Cutting a release - -First edit `setup.py` and bump the version, then: - -```bash -python3 setup.py sdist -# modify the below to match the file of the version you just created -twine upload dist/diffenv- -``` - From 24deea9c492136e14db3d4fc2f4810595cc0d18b Mon Sep 17 00:00:00 2001 From: Stan James Date: Wed, 14 Aug 2019 18:29:03 +0200 Subject: [PATCH 54/87] put back gabes readme --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 576406c..adc134d 100644 --- a/README.md +++ b/README.md @@ -174,3 +174,12 @@ docker run -it python bash python3 -m unittest tests/tests.py ``` +### Creating a release + +First edit `setup.py` and bump the version, then: + +```bash +python3 setup.py sdist +# modify the below to match the file of the version you just created +twine upload dist/diffenv- +``` From 7ef19821ac0b38666d4178573b30a4d2599a116f Mon Sep 17 00:00:00 2001 From: Gabriel Pickard Date: Wed, 14 Aug 2019 18:34:19 +0200 Subject: [PATCH 55/87] Actually elide hidden files in facets dir? --- diffenv/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diffenv/main.py b/diffenv/main.py index fefc3d1..c828a66 100644 --- a/diffenv/main.py +++ b/diffenv/main.py @@ -79,7 +79,7 @@ def extract_facet_dir(dirpath, structure, depth=0): p = pathlib.Path(dirpath) if p.exists(): for item in sorted(p.iterdir()): - if str(item).startswith('.'): + if item.name.startswith('.') or item.name.startswith('#'): # Ignore hidden files continue if item.is_dir(): From 6895e822260b1eb5cd95afdfa2732cf49c51afe9 Mon Sep 17 00:00:00 2001 From: Stan James Date: Wed, 14 Aug 2019 18:48:44 +0200 Subject: [PATCH 56/87] readne example of old commit diff --- README.md | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index adc134d..77f2af3 100644 --- a/README.md +++ b/README.md @@ -67,11 +67,31 @@ python: # ...trimmed ``` +### Include environment in submitted issues + +```bash +#$ diffenv --issue + +# Browser will open with new issue +``` + +Screen Shot 2019-08-14 at 6 43 06 PM + + +### Compare with past commits + +```diff +#$ diffenv --compare .diffenv/commits/2b19c9e47af0828c8775ee231768631e0b06ae0f.diffenv +git: + version: +- <<-: git version 2.11.0 ++ +>>: git version 2.22.0 +python: + python-version: +- <<-: Python 3.7 ++ +>>: Python 3.7.3 +``` -### Use cases -* Add environment data to bug reports, even automatically. [Example](https://github.com/error-central/diffenv/issues/29) -* Diagnose what subtle difference in environment is making things fail on your coworker's machine. -* Compare your current environment against past commits when things worked. ## Options From 2238dd774756c01999502d7ac5a1399ff19a9e6b Mon Sep 17 00:00:00 2001 From: Stan James Date: Wed, 14 Aug 2019 18:51:07 +0200 Subject: [PATCH 57/87] readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 77f2af3..ae8b746 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ diffenv gathers and compares runtime environments. It defines a simple standard ![output](https://user-images.githubusercontent.com/673455/62836101-182d1200-bc60-11e9-95c7-1f52dfb197b7.gif) -### Save your current environment +### Output your current environment ```yaml #$ diffenv python: From 379280e75275fe143cac6c60007fd8f4c720acc7 Mon Sep 17 00:00:00 2001 From: Gabriel Pickard Date: Wed, 14 Aug 2019 18:56:27 +0200 Subject: [PATCH 58/87] Update README.md --- README.md | 54 +++++++++++++++++++++++++----------------------------- 1 file changed, 25 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index ae8b746..07f2f50 100644 --- a/README.md +++ b/README.md @@ -93,34 +93,6 @@ python: ``` -## Options - -``` -usage: diffenv [-h] [-o OUTPUT] [-c COMPARE] [--add-hooks] [--share] [--issue] - [--post POST] [--config CONFIG] [--ignore-config] [--no-color] - [--no-paging] [--version] - -Diff your total environment. Run without any params to simply output current -environment state as YAML. - -optional arguments: - -h, --help show this help message and exit - -o OUTPUT, --output OUTPUT - output to file instead of stdout - -c COMPARE, --compare COMPARE - file or URL to compare against the current env - --add-hooks install git hooks in current repo and exit - --share store current env and return URL that can be shared - --issue create github issue - --post POST POST env to specific URL when sharing; must be used - with --share - --config CONFIG load config from specific file - --ignore-config ignore configs and run all facets - --no-color don't color diff output - --no-paging don't use less for paging output - --version display version and exit - -``` ## Installation @@ -148,7 +120,31 @@ diffenv --share For a complete list of command line options run: ```bash -diffenv --help +$ diffenv --help + +usage: diffenv [-h] [-o OUTPUT] [-c COMPARE] [--add-hooks] [--share] [--issue] + [--post POST] [--config CONFIG] [--ignore-config] [--no-color] + [--no-paging] [--version] + +Diff your total environment. Run without any params to simply output current +environment state as YAML. + +optional arguments: + -h, --help show this help message and exit + -o OUTPUT, --output OUTPUT + output to file instead of stdout + -c COMPARE, --compare COMPARE + file or URL to compare against the current env + --add-hooks install git hooks in current repo and exit + --share store current env and return URL that can be shared + --issue create github issue + --post POST POST env to specific URL when sharing; must be used + with --share + --config CONFIG load config from specific file + --ignore-config ignore configs and run all facets + --no-color don't color diff output + --no-paging don't use less for paging output + --version display version and exit ``` ## Customization From f888cd6e22e3eb6edafee1e77341332dc45fe6fa Mon Sep 17 00:00:00 2001 From: Stan James Date: Wed, 14 Aug 2019 19:23:43 +0200 Subject: [PATCH 59/87] readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 07f2f50..7920514 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,10 @@ python: + +>>: Python 3.7.3 ``` +Note this requires the git commit hooks to have been installed, so that diffenv is run on each commit. +``` +#$ diffenv --add-hooks +``` ## Installation From 88c527c8e31c295bd2844bf4cf4a78c42c14c971 Mon Sep 17 00:00:00 2001 From: Stan James Date: Thu, 15 Aug 2019 08:09:54 +0200 Subject: [PATCH 60/87] docker testing fix --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7920514..babb988 100644 --- a/README.md +++ b/README.md @@ -181,6 +181,12 @@ pip3 install --editable . Now `diffenv` will always point to your local repo, including any changes. +### Testing + +```bash +python3 -m unittest tests/tests.py +``` + For testing on docker containers: ```bash docker pull python @@ -188,12 +194,6 @@ docker run -it python bash # Now e.g. `pip install diffenv` ``` -### Testing - -```bash -python3 -m unittest tests/tests.py -``` - ### Creating a release First edit `setup.py` and bump the version, then: From fd1c5c512b1850a43cebb5e9f21e92dbe90273a7 Mon Sep 17 00:00:00 2001 From: Stan James Date: Thu, 15 Aug 2019 08:11:09 +0200 Subject: [PATCH 61/87] dev readme --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index babb988..aeb66cd 100644 --- a/README.md +++ b/README.md @@ -174,6 +174,9 @@ See `example_config.yaml` for more information. If you are developing locally, do _not_ install as above, and instead run the following in the repo root directory: ```bash +# Remove global installation of diffenv, if present +pip3 uninstall diffenv + # depending on your setup you may have to prefix sudo to this command pip3 install --editable . ``` From 2ba2cb76fee55cf4cb9e251f84084b1d052a54c0 Mon Sep 17 00:00:00 2001 From: Stan James Date: Fri, 16 Aug 2019 08:58:01 +0200 Subject: [PATCH 62/87] hash env urls with passwords diffenv-version: 0.2.0 directory: listing: tests: 160, 1565678433.2291105, DIR setup.py: 733, 1565686663.53653, 7c1c3a03e40fe2a8d3d35cd9b8e396c4 facets: 96, 1565678335.6676767, DIR examples: 160, 1565526937.9334917, DIR example_config.yaml: 45, 1564670036.66021, 759eab2b0f2d79bd2c0991820fa76787 env.yaml: 9557, 1565529046.05771, 10189a68cae562b4b15176c628584ea1 dist: 128, 1565525687.4886672, DIR diffenv.egg-info: 256, 1565525994.236996, DIR diffenv: 288, 1565687026.3474302, DIR build: 160, 1565525325.6887057, DIR bin: 96, 1565800452.866075, DIR __pycache__: 96, 1564129273.2804494, DIR README.md: 2588, 1565678335.68020, f3438f14dc6bdadfddc7d24668bc2302 MANIFEST.in: 68, 1565686663.53471, edff356a00ba1b5f0660d5514ebb5fb5 LICENSE: 1070, 1563971721.10152, bbd2cb1a41f404058e170e74a725bb18 .vscode: 128, 1565036334.5557442, DIR .travis.yml: 814, 1565623659.24969, d7278269a9794d1260164b15942c0c60 .gitignore: 1221, 1565035870.68035, 3b1c12c1ca4e89f3c929c73c4427f846 .github: 96, 1565526937.9326942, DIR .git: 544, 1565938682.6729553, DIR .diffenv: 192, 1565528757.891121, DIR .DS_Store: 6148, 1564760143.68363, df20c99511081bcbf44de38d832fbe70 path: /Users/stan/code/diffenv git: git-remote: |- origin git@github.com:error-central/diffenv.git (fetch) origin git@github.com:error-central/diffenv.git (push) git-status: |- On branch master Your branch is behind 'origin/master' by 20 commits, and can be fast-forwarded. (use "git pull" to update your local branch) Changes to be committed: (use "git reset HEAD ..." to unstage) modified: diffenv/facets/shell/envvars Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) modified: bin/diffenv modified: examples/config-small.yaml Untracked files: (use "git add ..." to include in what will be committed) env.yaml git-user-email: stan@wanderingstan.com git-user-name: Stan James version: git version 2.22.0 os: timezone: 0200 version: Darwin 18.7.0 x86_64 python: pip-packages: astroid: 2.2.5 autopep8: 1.4.4 bleach: 3.1.0 certifi: 2019.6.16 chardet: 3.0.4 colorama: 0.4.1 diffenv: 0.2.0 docutils: 0.15.2 gitdb2: 2.0.5 GitPython: 2.1.13 idna: 2.8 importlib-metadata: 0.19 isort: 4.3.21 lazy-object-proxy: 1.4.1 mccabe: 0.6.1 pip: 19.0.3 pkginfo: 1.5.0.1 psutil: 5.6.3 pycodestyle: 2.5.0 Pygments: 2.4.2 pylint: 2.3.1 readme-renderer: 24.0 requests: 2.22.0 requests-toolbelt: 0.9.1 ruamel.yaml: 0.16.0 ruamel.yaml.clib: 0.1.0 setuptools: 41.0.1 six: 1.12.0 smmap2: 2.0.5 tqdm: 4.33.0 twine: 1.13.0 typed-ast: 1.4.0 urllib3: 1.25.3 webencodings: 0.5.1 wheel: 0.33.4 wrapt: 1.11.2 zipp: 0.5.2 pip3-packages: astroid: 2.2.5 autopep8: 1.4.4 bleach: 3.1.0 certifi: 2019.6.16 chardet: 3.0.4 colorama: 0.4.1 diffenv: 0.2.0 docutils: 0.15.2 gitdb2: 2.0.5 GitPython: 2.1.13 idna: 2.8 importlib-metadata: 0.19 isort: 4.3.21 lazy-object-proxy: 1.4.1 mccabe: 0.6.1 pip: 19.0.3 pkginfo: 1.5.0.1 psutil: 5.6.3 pycodestyle: 2.5.0 Pygments: 2.4.2 pylint: 2.3.1 readme-renderer: 24.0 requests: 2.22.0 requests-toolbelt: 0.9.1 ruamel.yaml: 0.16.0 ruamel.yaml.clib: 0.1.0 setuptools: 41.0.1 six: 1.12.0 smmap2: 2.0.5 tqdm: 4.33.0 twine: 1.13.0 typed-ast: 1.4.0 urllib3: 1.25.3 webencodings: 0.5.1 wheel: 0.33.4 wrapt: 1.11.2 zipp: 0.5.2 python-version: Python 3.7.3 python3-version: Python 3.7.3 virtualenv: | which-python: /usr/local/opt/python/libexec/bin/python which-python3: /usr/local/bin/python3 shell: envvars: AMD_ENTRYPOINT: vs/workbench/services/extensions/node/extensionHostProcess APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL: 'true' Apple_PubSub_Socket_Render: /private/tmp/com.apple.launchd.obyCxwiqZk/Render CLICOLOR: '1' DISPLAY: /private/tmp/com.apple.launchd.iqAX0LXCVg/org.macosforge.xquartz:0 EDITOR: sublw ELECTRON_RUN_AS_NODE: '1' GIT_ASKPASS(HASHED): f7f6c93b472769a7f435573524ec859c(HASH) GIT_AUTHOR_DATE: '@1565938681 +0200' GIT_AUTHOR_EMAIL: stan@wanderingstan.com GIT_AUTHOR_NAME: Stan James GIT_EDITOR: ':' GIT_EXEC_PATH: /usr/local/Cellar/git/2.22.0/libexec/git-core GIT_INDEX_FILE: .git/index GIT_PREFIX: '' HISTTIMEFORMAT: '%Y-%m-%d_%H-%M-%S; ' HOME: /Users/stan ISODATETIME: '2019-08-15 15:41:37' LANG: en_US.UTF-8 LC_ALL: en_US.UTF-8 LOGNAME: stan LSCOLORS: GxFxCxDxBxegedabagaced NVM_BIN: /Users/stan/.nvm/versions/node/v10.16.0/bin NVM_CD_FLAGS: '' NVM_DIR: /Users/stan/.nvm PATH: /usr/local/Cellar/git/2.22.0/libexec/git-core:/Users/stan/Library/Python/3.7/bin:/usr/local/opt/python/libexec/bin:/usr/local/opt/sqlite/bin:/Users/stan/.nvm/versions/node/v10.16.0/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/opt/X11/bin:/Users/stan/bin PIPE_LOGGING: 'true' PWD: /Users/stan/code/diffenv SHELL: /bin/bash SHLVL: '2' SSH_AUTH_SOCK: /private/tmp/com.apple.launchd.E89PogHTQB/Listeners TERM: xterm-color TMPDIR: /var/folders/9n/2vf6_x0s79bdzphhpyk83fnr0000gn/T/ USER: stan VERBOSE_LOGGING: 'true' VSCODE_GIT_ASKPASS_HANDLE(HASHED): b3fdd4e40648b4fec81bff0e7e3a04b7(HASH) VSCODE_GIT_ASKPASS_MAIN(HASHED): 6af3c36a10ecc53c09c312b7cfdf594b(HASH) VSCODE_GIT_ASKPASS_NODE(HASHED): 806450b4398ff983c7937491b19c4ece(HASH) VSCODE_GIT_COMMAND: commit VSCODE_HANDLES_UNCAUGHT_ERRORS: 'true' VSCODE_IPC_HOOK: /Users/stan/Library/Application Support/Code/1.37.0-main.sock VSCODE_IPC_HOOK_EXTHOST: /var/folders/9n/2vf6_x0s79bdzphhpyk83fnr0000gn/T/vscode-ipc-faf6c560-d34c-461d-8e70-b22a90eb007b.sock VSCODE_LOGS: /Users/stan/Library/Application Support/Code/logs/20190815T154136 VSCODE_LOG_STACK: 'false' VSCODE_NLS_CONFIG: '{"locale":"en-us","availableLanguages":{},"_languagePackSupport":true}' VSCODE_NODE_CACHED_DATA_DIR: /Users/stan/Library/Application Support/Code/CachedData/036a6b1d3ac84e5ca96a17a44e63a87971f8fcc8 VSCODE_PID: '6372' VSCODE_PREVENT_FOREIGN_INSPECT: 'true' XPC_FLAGS: '0x0' XPC_SERVICE_NAME: '0' _: /usr/local/bin/diffenv __CF_USER_TEXT_ENCODING: 0x1F5:0x0:0x0 __PYVENV_LAUNCHER__: /usr/local/bin/python3 shell-version: GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18) Copyright (C) 2007 Free Software Foundation, Inc. --- diffenv/facets/shell/envvars | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/diffenv/facets/shell/envvars b/diffenv/facets/shell/envvars index c558fc7..d75005a 100755 --- a/diffenv/facets/shell/envvars +++ b/diffenv/facets/shell/envvars @@ -6,6 +6,7 @@ import os import sys from typing import Tuple import hashlib +from urllib.parse import urlparse # Return a YAML list of all environment variables, with sensitive ones hashed. @@ -18,8 +19,13 @@ def filter_sensitive_vars(env_var: Tuple[str, str]): then just return the hash of the value. Input is a env var tuple, e.g. ('SHELL','/bin/bash') """ - sensitive_pattern_list = ['KEY', 'SECRET'] (key, value) = env_var + # URLs with passwords + parts = urlparse(value) + if parts.password: + return (key + '(HASHED)', hashlib.md5(str(value).encode("utf-8")).hexdigest() + '(HASH)') + # var names + sensitive_pattern_list = ['KEY', 'SECRET', 'PASSWORD', 'PASS'] if any(pattern.upper() in key.upper() for pattern in sensitive_pattern_list): return (key + '(HASHED)', hashlib.md5(str(value).encode("utf-8")).hexdigest() + '(HASH)') else: From a4e648a832226772cb6ea3f0063eaa7685136e98 Mon Sep 17 00:00:00 2001 From: Stan James Date: Fri, 16 Aug 2019 09:25:33 +0200 Subject: [PATCH 63/87] filter_sensitive_vars fix per @maebert diffenv-version: 0.2.0 directory: listing: tests: 160, 1565678433.2291105, DIR setup.py: 733, 1565938699.60907, 45a6e791baed384f3973926ab47d7a97 facets: 96, 1565678335.6676767, DIR examples: 160, 1565526937.9334917, DIR example_config.yaml: 45, 1564670036.66021, 759eab2b0f2d79bd2c0991820fa76787 env.yaml: 9557, 1565529046.05771, 10189a68cae562b4b15176c628584ea1 dist: 128, 1565525687.4886672, DIR diffenv.egg-info: 256, 1565525994.236996, DIR diffenv: 288, 1565938699.608119, DIR build: 160, 1565525325.6887057, DIR bin: 96, 1565800452.866075, DIR __pycache__: 96, 1564129273.2804494, DIR README.md: 5341, 1565938699.60615, 5aff7f999d854e9f9be30c4ed2973ec5 MANIFEST.in: 68, 1565686663.53471, edff356a00ba1b5f0660d5514ebb5fb5 LICENSE: 1070, 1563971721.10152, bbd2cb1a41f404058e170e74a725bb18 .vscode: 128, 1565036334.5557442, DIR .travis.yml: 814, 1565623659.24969, d7278269a9794d1260164b15942c0c60 .gitignore: 1221, 1565035870.68035, 3b1c12c1ca4e89f3c929c73c4427f846 .github: 96, 1565526937.9326942, DIR .diffenv: 192, 1565528757.891121, DIR .DS_Store: 6148, 1564760143.68363, df20c99511081bcbf44de38d832fbe70 path: /Users/stan/code/diffenv git: git-remote: |- origin git@github.com:error-central/diffenv.git (fetch) origin git@github.com:error-central/diffenv.git (push) git-status: |- On branch master Your branch is up to date with 'origin/master'. Changes to be committed: (use "git reset HEAD ..." to unstage) modified: diffenv/facets/shell/envvars Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) modified: bin/diffenv modified: examples/config-small.yaml Untracked files: (use "git add ..." to include in what will be committed) env.yaml git-user-email: stan@wanderingstan.com git-user-name: Stan James version: git version 2.22.0 os: timezone: 0200 version: Darwin 18.7.0 x86_64 python: pip-packages: astroid: 2.2.5 autopep8: 1.4.4 bleach: 3.1.0 certifi: 2019.6.16 chardet: 3.0.4 colorama: 0.4.1 diffenv: 0.2.0 docutils: 0.15.2 gitdb2: 2.0.5 GitPython: 2.1.13 idna: 2.8 importlib-metadata: 0.19 isort: 4.3.21 lazy-object-proxy: 1.4.1 mccabe: 0.6.1 pip: 19.0.3 pkginfo: 1.5.0.1 psutil: 5.6.3 pycodestyle: 2.5.0 Pygments: 2.4.2 pylint: 2.3.1 readme-renderer: 24.0 requests: 2.22.0 requests-toolbelt: 0.9.1 rope: 0.14.0 ruamel.yaml: 0.16.0 ruamel.yaml.clib: 0.1.0 setuptools: 41.0.1 six: 1.12.0 smmap2: 2.0.5 tqdm: 4.33.0 twine: 1.13.0 typed-ast: 1.4.0 urllib3: 1.25.3 webencodings: 0.5.1 wheel: 0.33.4 wrapt: 1.11.2 zipp: 0.5.2 pip3-packages: astroid: 2.2.5 autopep8: 1.4.4 bleach: 3.1.0 certifi: 2019.6.16 chardet: 3.0.4 colorama: 0.4.1 diffenv: 0.2.0 docutils: 0.15.2 gitdb2: 2.0.5 GitPython: 2.1.13 idna: 2.8 importlib-metadata: 0.19 isort: 4.3.21 lazy-object-proxy: 1.4.1 mccabe: 0.6.1 pip: 19.0.3 pkginfo: 1.5.0.1 psutil: 5.6.3 pycodestyle: 2.5.0 Pygments: 2.4.2 pylint: 2.3.1 readme-renderer: 24.0 requests: 2.22.0 requests-toolbelt: 0.9.1 rope: 0.14.0 ruamel.yaml: 0.16.0 ruamel.yaml.clib: 0.1.0 setuptools: 41.0.1 six: 1.12.0 smmap2: 2.0.5 tqdm: 4.33.0 twine: 1.13.0 typed-ast: 1.4.0 urllib3: 1.25.3 webencodings: 0.5.1 wheel: 0.33.4 wrapt: 1.11.2 zipp: 0.5.2 python-version: Python 3.7.3 python3-version: Python 3.7.3 virtualenv: | which-python: /usr/local/opt/python/libexec/bin/python which-python3: /usr/local/bin/python3 shell: envvars: AMD_ENTRYPOINT: vs/workbench/services/extensions/node/extensionHostProcess APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL: 'true' Apple_PubSub_Socket_Render: /private/tmp/com.apple.launchd.obyCxwiqZk/Render CLICOLOR: '1' DISPLAY: /private/tmp/com.apple.launchd.iqAX0LXCVg/org.macosforge.xquartz:0 EDITOR: sublw ELECTRON_RUN_AS_NODE: '1' GIT_ASKPASS(HASHED): f7f6c93b472769a7f435573524ec859c(HASH) GIT_AUTHOR_DATE: '@1565940333 +0200' GIT_AUTHOR_EMAIL: stan@wanderingstan.com GIT_AUTHOR_NAME: Stan James GIT_EDITOR: ':' GIT_EXEC_PATH: /usr/local/Cellar/git/2.22.0/libexec/git-core GIT_INDEX_FILE: .git/index GIT_PREFIX: '' HISTTIMEFORMAT: '%Y-%m-%d_%H-%M-%S; ' HOME: /Users/stan ISODATETIME: '2019-08-15 15:41:37' LANG: en_US.UTF-8 LC_ALL: en_US.UTF-8 LOGNAME: stan LSCOLORS: GxFxCxDxBxegedabagaced NVM_BIN: /Users/stan/.nvm/versions/node/v10.16.0/bin NVM_CD_FLAGS: '' NVM_DIR: /Users/stan/.nvm PATH(HASHED): c13b21083de9282a02893eccaf6cce88(HASH) PIPE_LOGGING: 'true' PWD: /Users/stan/code/diffenv SHELL: /bin/bash SHLVL: '2' SSH_AUTH_SOCK: /private/tmp/com.apple.launchd.E89PogHTQB/Listeners TERM: xterm-color TMPDIR: /var/folders/9n/2vf6_x0s79bdzphhpyk83fnr0000gn/T/ USER: stan VERBOSE_LOGGING: 'true' VSCODE_GIT_ASKPASS_HANDLE(HASHED): b3fdd4e40648b4fec81bff0e7e3a04b7(HASH) VSCODE_GIT_ASKPASS_MAIN(HASHED): 6af3c36a10ecc53c09c312b7cfdf594b(HASH) VSCODE_GIT_ASKPASS_NODE(HASHED): 806450b4398ff983c7937491b19c4ece(HASH) VSCODE_GIT_COMMAND: commit VSCODE_HANDLES_UNCAUGHT_ERRORS: 'true' VSCODE_IPC_HOOK: /Users/stan/Library/Application Support/Code/1.37.0-main.sock VSCODE_IPC_HOOK_EXTHOST: /var/folders/9n/2vf6_x0s79bdzphhpyk83fnr0000gn/T/vscode-ipc-faf6c560-d34c-461d-8e70-b22a90eb007b.sock VSCODE_LOGS: /Users/stan/Library/Application Support/Code/logs/20190815T154136 VSCODE_LOG_STACK: 'false' VSCODE_NLS_CONFIG: '{"locale":"en-us","availableLanguages":{},"_languagePackSupport":true}' VSCODE_NODE_CACHED_DATA_DIR: /Users/stan/Library/Application Support/Code/CachedData/036a6b1d3ac84e5ca96a17a44e63a87971f8fcc8 VSCODE_PID: '6372' VSCODE_PREVENT_FOREIGN_INSPECT: 'true' XPC_FLAGS: '0x0' XPC_SERVICE_NAME: '0' _: /usr/local/bin/diffenv __CF_USER_TEXT_ENCODING: 0x1F5:0x0:0x0 __PYVENV_LAUNCHER__: /usr/local/bin/python3 shell-version: GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18) Copyright (C) 2007 Free Software Foundation, Inc. --- diffenv/facets/shell/envvars | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/diffenv/facets/shell/envvars b/diffenv/facets/shell/envvars index 022e080..97a4cd9 100755 --- a/diffenv/facets/shell/envvars +++ b/diffenv/facets/shell/envvars @@ -10,8 +10,9 @@ from urllib.parse import urlparse import json from collections import OrderedDict -# Return a YAML list of all environment variables, with sensitive ones hashed. +# Return a structured list of all environment variables, with sensitive ones hashed. +# Switched to json as it needs no librarires # yaml = YAML() @@ -22,16 +23,23 @@ def filter_sensitive_vars(env_var: Tuple[str, str]): Input is a env var tuple, e.g. ('SHELL','/bin/bash') """ (key, value) = env_var - # URLs with passwords + + # Test if value is super long + MAX_VALUE_LEN = 256 + if len(value) > MAX_VALUE_LEN: + return (key + '(HASHED)', hashlib.md5(str(value).encode("utf-8")).hexdigest() + '(HASH)') + + # Test if Value is url with password: http://username:password@example.com/ parts = urlparse(value) if parts.password: return (key + '(HASHED)', hashlib.md5(str(value).encode("utf-8")).hexdigest() + '(HASH)') - # var names - sensitive_pattern_list = ['KEY', 'SECRET', 'PASSWORD', 'PASS'] - if any(pattern.upper() in key.upper() for pattern in sensitive_pattern_list): + + # Test if Key appears to be "sensitive" + SENSITIVE_PATTERN_LIST = ['KEY', 'SECRET', 'PASSWORD', 'PASS'] + if any(pattern.upper() in key.upper() for pattern in SENSITIVE_PATTERN_LIST): return (key + '(HASHED)', hashlib.md5(str(value).encode("utf-8")).hexdigest() + '(HASH)') - else: - return env_var + + return env_var env_vars = os.environ.items() From 3c8570b37b06bafe40191a268b2573899392319b Mon Sep 17 00:00:00 2001 From: Stan James Date: Fri, 16 Aug 2019 10:05:39 +0200 Subject: [PATCH 64/87] Clarify readme first graf --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index aeb66cd..114430c 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ## Overview -diffenv gathers and compares runtime environments. It defines a simple standard for storing a complete picture of a development environment. +diffenv gathers and compares development environments. It also defines a simple standard for storing a complete picture of an environment. ![output](https://user-images.githubusercontent.com/673455/62836101-182d1200-bc60-11e9-95c7-1f52dfb197b7.gif) From 5780c9e6ad850079eb8d798978e9b04f8a0f791a Mon Sep 17 00:00:00 2001 From: Stan James Date: Fri, 16 Aug 2019 10:17:42 +0200 Subject: [PATCH 65/87] Tidy opening graf --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 114430c..9c34cb7 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,10 @@ ## Overview -diffenv gathers and compares development environments. It also defines a simple standard for storing a complete picture of an environment. +diffenv gathers and compares development environments. It defines +a simple standard for storing a complete picture of an environment +as a structured collection of "facets" such as "python", "shell", +"git", etc. ![output](https://user-images.githubusercontent.com/673455/62836101-182d1200-bc60-11e9-95c7-1f52dfb197b7.gif) From ec89e931264d57d4f4dafa050ca6c997bbbbb0ef Mon Sep 17 00:00:00 2001 From: Stan James Date: Fri, 16 Aug 2019 17:58:04 +0200 Subject: [PATCH 66/87] test that readme has help output diffenv-version: 0.2.0 directory: listing: tests: 160, 1565970697.628735, DIR setup.py: 733, 1565938699.60907, 45a6e791baed384f3973926ab47d7a97 facets: 96, 1565678335.6676767, DIR examples: 160, 1565526937.9334917, DIR example_config.yaml: 45, 1564670036.66021, 759eab2b0f2d79bd2c0991820fa76787 env.yaml: 9557, 1565529046.05771, 10189a68cae562b4b15176c628584ea1 dist: 128, 1565525687.4886672, DIR diffenv.egg-info: 256, 1565525994.236996, DIR diffenv: 288, 1565938699.608119, DIR build: 160, 1565525325.6887057, DIR bin: 96, 1565800452.866075, DIR __pycache__: 96, 1564129273.2804494, DIR README.md: 5417, 1565970755.50806, dcd1ab52a3e281a838645f7ca1c4603c MANIFEST.in: 68, 1565686663.53471, edff356a00ba1b5f0660d5514ebb5fb5 LICENSE: 1070, 1563971721.10152, bbd2cb1a41f404058e170e74a725bb18 .vscode: 128, 1565036334.5557442, DIR .travis.yml: 814, 1565623659.24969, d7278269a9794d1260164b15942c0c60 .gitignore: 1221, 1565035870.68035, 3b1c12c1ca4e89f3c929c73c4427f846 .github: 96, 1565526937.9326942, DIR .diffenv: 192, 1565528757.891121, DIR .DS_Store: 6148, 1564760143.68363, df20c99511081bcbf44de38d832fbe70 path: /Users/stan/code/diffenv git: git-remote: |- origin git@github.com:error-central/diffenv.git (fetch) origin git@github.com:error-central/diffenv.git (push) git-status: |- On branch master Your branch is behind 'origin/master' by 2 commits, and can be fast-forwarded. (use "git pull" to update your local branch) Changes to be committed: (use "git reset HEAD ..." to unstage) modified: tests/tests.py Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) modified: README.md modified: bin/diffenv modified: examples/config-small.yaml Untracked files: (use "git add ..." to include in what will be committed) env.yaml git-user-email: stan@wanderingstan.com git-user-name: Stan James version: git version 2.22.0 os: timezone: 0200 version: Darwin 18.7.0 x86_64 python: pip-packages: astroid: 2.2.5 autopep8: 1.4.4 bleach: 3.1.0 certifi: 2019.6.16 chardet: 3.0.4 colorama: 0.4.1 diffenv: 0.2.0 docutils: 0.15.2 gitdb2: 2.0.5 GitPython: 2.1.13 idna: 2.8 importlib-metadata: 0.19 isort: 4.3.21 lazy-object-proxy: 1.4.1 mccabe: 0.6.1 pip: 19.0.3 pkginfo: 1.5.0.1 psutil: 5.6.3 pycodestyle: 2.5.0 Pygments: 2.4.2 pylint: 2.3.1 readme-renderer: 24.0 requests: 2.22.0 requests-toolbelt: 0.9.1 rope: 0.14.0 ruamel.yaml: 0.16.0 ruamel.yaml.clib: 0.1.0 setuptools: 41.0.1 six: 1.12.0 smmap2: 2.0.5 tqdm: 4.33.0 twine: 1.13.0 typed-ast: 1.4.0 urllib3: 1.25.3 webencodings: 0.5.1 wheel: 0.33.4 wrapt: 1.11.2 zipp: 0.5.2 pip3-packages: astroid: 2.2.5 autopep8: 1.4.4 bleach: 3.1.0 certifi: 2019.6.16 chardet: 3.0.4 colorama: 0.4.1 diffenv: 0.2.0 docutils: 0.15.2 gitdb2: 2.0.5 GitPython: 2.1.13 idna: 2.8 importlib-metadata: 0.19 isort: 4.3.21 lazy-object-proxy: 1.4.1 mccabe: 0.6.1 pip: 19.0.3 pkginfo: 1.5.0.1 psutil: 5.6.3 pycodestyle: 2.5.0 Pygments: 2.4.2 pylint: 2.3.1 readme-renderer: 24.0 requests: 2.22.0 requests-toolbelt: 0.9.1 rope: 0.14.0 ruamel.yaml: 0.16.0 ruamel.yaml.clib: 0.1.0 setuptools: 41.0.1 six: 1.12.0 smmap2: 2.0.5 tqdm: 4.33.0 twine: 1.13.0 typed-ast: 1.4.0 urllib3: 1.25.3 webencodings: 0.5.1 wheel: 0.33.4 wrapt: 1.11.2 zipp: 0.5.2 python-version: Python 3.7.3 python3-version: Python 3.7.3 virtualenv: | which-python: /usr/local/opt/python/libexec/bin/python which-python3: /usr/local/bin/python3 shell: envvars: AMD_ENTRYPOINT: vs/workbench/services/extensions/node/extensionHostProcess APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL: 'true' Apple_PubSub_Socket_Render: /private/tmp/com.apple.launchd.obyCxwiqZk/Render CLICOLOR: '1' COMMAND_MODE: unix2003 DISPLAY: /private/tmp/com.apple.launchd.iqAX0LXCVg/org.macosforge.xquartz:0 EDITOR: sublw ELECTRON_RUN_AS_NODE: '1' GIT_ASKPASS(HASHED): f7f6c93b472769a7f435573524ec859c(HASH) GIT_AUTHOR_DATE: '@1565971084 +0200' GIT_AUTHOR_EMAIL: stan@wanderingstan.com GIT_AUTHOR_NAME: Stan James GIT_EDITOR: ':' GIT_EXEC_PATH: /usr/local/Cellar/git/2.22.0/libexec/git-core GIT_INDEX_FILE: .git/index GIT_PREFIX: '' HISTTIMEFORMAT: '%Y-%m-%d_%H-%M-%S; ' HOME: /Users/stan ISODATETIME: '2019-08-16 13:24:43' LANG: en_US.UTF-8 LC_ALL: en_US.UTF-8 LOGNAME: stan LSCOLORS: GxFxCxDxBxegedabagaced NVM_BIN: /Users/stan/.nvm/versions/node/v10.16.0/bin NVM_CD_FLAGS: '' NVM_DIR: /Users/stan/.nvm PATH(HASHED): c13b21083de9282a02893eccaf6cce88(HASH) PIPE_LOGGING: 'true' PWD: /Users/stan/code/diffenv SHELL: /bin/bash SHLVL: '2' SSH_AUTH_SOCK: /private/tmp/com.apple.launchd.E89PogHTQB/Listeners TERM: xterm-color TMPDIR: /var/folders/9n/2vf6_x0s79bdzphhpyk83fnr0000gn/T/ USER: stan VERBOSE_LOGGING: 'true' VSCODE_GIT_ASKPASS_HANDLE(HASHED): 650140d2525815002eb6e27e3300cf67(HASH) VSCODE_GIT_ASKPASS_MAIN(HASHED): 6af3c36a10ecc53c09c312b7cfdf594b(HASH) VSCODE_GIT_ASKPASS_NODE(HASHED): 806450b4398ff983c7937491b19c4ece(HASH) VSCODE_GIT_COMMAND: commit VSCODE_HANDLES_UNCAUGHT_ERRORS: 'true' VSCODE_IPC_HOOK: /Users/stan/Library/Application Support/Code/1.37.1-main.sock VSCODE_IPC_HOOK_EXTHOST: /var/folders/9n/2vf6_x0s79bdzphhpyk83fnr0000gn/T/vscode-ipc-2bd4a4fc-de2f-4707-94a8-b20d768ba681.sock VSCODE_LOGS: /Users/stan/Library/Application Support/Code/logs/20190816T132442 VSCODE_LOG_STACK: 'false' VSCODE_NLS_CONFIG: '{"locale":"en-us","availableLanguages":{},"_languagePackSupport":true}' VSCODE_NODE_CACHED_DATA_DIR: /Users/stan/Library/Application Support/Code/CachedData/f06011ac164ae4dc8e753a3fe7f9549844d15e35 VSCODE_PID: '18791' VSCODE_PREVENT_FOREIGN_INSPECT: 'true' XPC_FLAGS: '0x0' XPC_SERVICE_NAME: '0' _: /usr/local/bin/diffenv __CF_USER_TEXT_ENCODING: 0x1F5:0x0:0x0 __PYVENV_LAUNCHER__: /usr/local/bin/python3 shell-version: GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18) Copyright (C) 2007 Free Software Foundation, Inc. --- tests/tests.py | 74 +++++++++++++++++++++++++++++++------------------- 1 file changed, 46 insertions(+), 28 deletions(-) diff --git a/tests/tests.py b/tests/tests.py index f904e29..6b92001 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -10,17 +10,35 @@ class TestStringMethods(unittest.TestCase): - def test_non_git(self): - """ Test running in a non-git repo """ - # TODO - # self.assertEqual('foo'.upper(), 'FOO') - pass - - def test_plain(self): - """ Test running with no params """ - # TODO - # self.assertEqual('foo'.upper(), 'FOO') - pass + # def test_non_git(self): + # """ Test running in a non-git repo """ + # # TODO + # # self.assertEqual('foo'.upper(), 'FOO') + # pass + + # def test_plain(self): + # """ Test running with no params """ + # # TODO + # # self.assertEqual('foo'.upper(), 'FOO') + # pass + + def test_readme_for_help(self): + process = subprocess.Popen( + ['diffenv', '-h'], stdout=subprocess.PIPE) + out, err = process.communicate() + if err: + sys.stderr.write(err) + help_out = (out.decode("utf-8")) + + # print(help_out) + + with open('../README.md', 'r') as readme_file: + readme = readme_file.read() + + print(readme) + + self.assertIn(help_out, readme) + def test_sharing(self): """ Test sharing env """ @@ -46,23 +64,23 @@ def test_sharing(self): # Should show that env is identical self.assertEqual(result_lines, "{}\n") - def test_compare_http(self): - """ Test comparing with remote env """ - # TODO - # self.assertEqual('foo'.upper(), 'FOO') - pass - - def test_compare_file(self): - """ Test comparing with a file """ - # TODO - # self.assertEqual('foo'.upper(), 'FOO') - pass - - def test_passed_config(self): - """ Test with passing in a cofig file """ - # TODO - # self.assertEqual('foo'.upper(), 'FOO') - pass + # def test_compare_http(self): + # """ Test comparing with remote env """ + # # TODO + # # self.assertEqual('foo'.upper(), 'FOO') + # pass + + # def test_compare_file(self): + # """ Test comparing with a file """ + # # TODO + # # self.assertEqual('foo'.upper(), 'FOO') + # pass + + # def test_passed_config(self): + # """ Test with passing in a cofig file """ + # # TODO + # # self.assertEqual('foo'.upper(), 'FOO') + # pass if __name__ == '__main__': From 99cad2c7e0fa7698a0830067a53b9a0eb3f79538 Mon Sep 17 00:00:00 2001 From: Stan James Date: Fri, 16 Aug 2019 17:59:01 +0200 Subject: [PATCH 67/87] update readme to match help output diffenv-version: 0.2.0 directory: listing: tests: 160, 1565970697.628735, DIR setup.py: 733, 1565938699.60907, 45a6e791baed384f3973926ab47d7a97 facets: 96, 1565678335.6676767, DIR examples: 160, 1565526937.9334917, DIR example_config.yaml: 45, 1564670036.66021, 759eab2b0f2d79bd2c0991820fa76787 env.yaml: 9557, 1565529046.05771, 10189a68cae562b4b15176c628584ea1 dist: 128, 1565525687.4886672, DIR diffenv.egg-info: 256, 1565525994.236996, DIR diffenv: 288, 1565938699.608119, DIR build: 160, 1565525325.6887057, DIR bin: 96, 1565800452.866075, DIR __pycache__: 96, 1564129273.2804494, DIR README.md: 5417, 1565970755.50806, dcd1ab52a3e281a838645f7ca1c4603c MANIFEST.in: 68, 1565686663.53471, edff356a00ba1b5f0660d5514ebb5fb5 LICENSE: 1070, 1563971721.10152, bbd2cb1a41f404058e170e74a725bb18 .vscode: 128, 1565036334.5557442, DIR .travis.yml: 814, 1565623659.24969, d7278269a9794d1260164b15942c0c60 .gitignore: 1221, 1565035870.68035, 3b1c12c1ca4e89f3c929c73c4427f846 .github: 96, 1565526937.9326942, DIR .diffenv: 192, 1565528757.891121, DIR .DS_Store: 6148, 1564760143.68363, df20c99511081bcbf44de38d832fbe70 path: /Users/stan/code/diffenv git: git-remote: |- origin git@github.com:error-central/diffenv.git (fetch) origin git@github.com:error-central/diffenv.git (push) git-status: |- On branch master Your branch and 'origin/master' have diverged, and have 1 and 2 different commits each, respectively. (use "git pull" to merge the remote branch into yours) Changes to be committed: (use "git reset HEAD ..." to unstage) modified: README.md Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) modified: bin/diffenv modified: examples/config-small.yaml Untracked files: (use "git add ..." to include in what will be committed) env.yaml git-user-email: stan@wanderingstan.com git-user-name: Stan James version: git version 2.22.0 os: timezone: 0200 version: Darwin 18.7.0 x86_64 python: pip-packages: astroid: 2.2.5 autopep8: 1.4.4 bleach: 3.1.0 certifi: 2019.6.16 chardet: 3.0.4 colorama: 0.4.1 diffenv: 0.2.0 docutils: 0.15.2 gitdb2: 2.0.5 GitPython: 2.1.13 idna: 2.8 importlib-metadata: 0.19 isort: 4.3.21 lazy-object-proxy: 1.4.1 mccabe: 0.6.1 pip: 19.0.3 pkginfo: 1.5.0.1 psutil: 5.6.3 pycodestyle: 2.5.0 Pygments: 2.4.2 pylint: 2.3.1 readme-renderer: 24.0 requests: 2.22.0 requests-toolbelt: 0.9.1 rope: 0.14.0 ruamel.yaml: 0.16.0 ruamel.yaml.clib: 0.1.0 setuptools: 41.0.1 six: 1.12.0 smmap2: 2.0.5 tqdm: 4.33.0 twine: 1.13.0 typed-ast: 1.4.0 urllib3: 1.25.3 webencodings: 0.5.1 wheel: 0.33.4 wrapt: 1.11.2 zipp: 0.5.2 pip3-packages: astroid: 2.2.5 autopep8: 1.4.4 bleach: 3.1.0 certifi: 2019.6.16 chardet: 3.0.4 colorama: 0.4.1 diffenv: 0.2.0 docutils: 0.15.2 gitdb2: 2.0.5 GitPython: 2.1.13 idna: 2.8 importlib-metadata: 0.19 isort: 4.3.21 lazy-object-proxy: 1.4.1 mccabe: 0.6.1 pip: 19.0.3 pkginfo: 1.5.0.1 psutil: 5.6.3 pycodestyle: 2.5.0 Pygments: 2.4.2 pylint: 2.3.1 readme-renderer: 24.0 requests: 2.22.0 requests-toolbelt: 0.9.1 rope: 0.14.0 ruamel.yaml: 0.16.0 ruamel.yaml.clib: 0.1.0 setuptools: 41.0.1 six: 1.12.0 smmap2: 2.0.5 tqdm: 4.33.0 twine: 1.13.0 typed-ast: 1.4.0 urllib3: 1.25.3 webencodings: 0.5.1 wheel: 0.33.4 wrapt: 1.11.2 zipp: 0.5.2 python-version: Python 3.7.3 python3-version: Python 3.7.3 virtualenv: | which-python: /usr/local/opt/python/libexec/bin/python which-python3: /usr/local/bin/python3 shell: envvars: AMD_ENTRYPOINT: vs/workbench/services/extensions/node/extensionHostProcess APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL: 'true' Apple_PubSub_Socket_Render: /private/tmp/com.apple.launchd.obyCxwiqZk/Render CLICOLOR: '1' COMMAND_MODE: unix2003 DISPLAY: /private/tmp/com.apple.launchd.iqAX0LXCVg/org.macosforge.xquartz:0 EDITOR: sublw ELECTRON_RUN_AS_NODE: '1' GIT_ASKPASS(HASHED): f7f6c93b472769a7f435573524ec859c(HASH) GIT_AUTHOR_DATE: '@1565971141 +0200' GIT_AUTHOR_EMAIL: stan@wanderingstan.com GIT_AUTHOR_NAME: Stan James GIT_EDITOR: ':' GIT_EXEC_PATH: /usr/local/Cellar/git/2.22.0/libexec/git-core GIT_INDEX_FILE: .git/index GIT_PREFIX: '' HISTTIMEFORMAT: '%Y-%m-%d_%H-%M-%S; ' HOME: /Users/stan ISODATETIME: '2019-08-16 13:24:43' LANG: en_US.UTF-8 LC_ALL: en_US.UTF-8 LOGNAME: stan LSCOLORS: GxFxCxDxBxegedabagaced NVM_BIN: /Users/stan/.nvm/versions/node/v10.16.0/bin NVM_CD_FLAGS: '' NVM_DIR: /Users/stan/.nvm PATH(HASHED): c13b21083de9282a02893eccaf6cce88(HASH) PIPE_LOGGING: 'true' PWD: /Users/stan/code/diffenv SHELL: /bin/bash SHLVL: '2' SSH_AUTH_SOCK: /private/tmp/com.apple.launchd.E89PogHTQB/Listeners TERM: xterm-color TMPDIR: /var/folders/9n/2vf6_x0s79bdzphhpyk83fnr0000gn/T/ USER: stan VERBOSE_LOGGING: 'true' VSCODE_GIT_ASKPASS_HANDLE(HASHED): 650140d2525815002eb6e27e3300cf67(HASH) VSCODE_GIT_ASKPASS_MAIN(HASHED): 6af3c36a10ecc53c09c312b7cfdf594b(HASH) VSCODE_GIT_ASKPASS_NODE(HASHED): 806450b4398ff983c7937491b19c4ece(HASH) VSCODE_GIT_COMMAND: commit VSCODE_HANDLES_UNCAUGHT_ERRORS: 'true' VSCODE_IPC_HOOK: /Users/stan/Library/Application Support/Code/1.37.1-main.sock VSCODE_IPC_HOOK_EXTHOST: /var/folders/9n/2vf6_x0s79bdzphhpyk83fnr0000gn/T/vscode-ipc-2bd4a4fc-de2f-4707-94a8-b20d768ba681.sock VSCODE_LOGS: /Users/stan/Library/Application Support/Code/logs/20190816T132442 VSCODE_LOG_STACK: 'false' VSCODE_NLS_CONFIG: '{"locale":"en-us","availableLanguages":{},"_languagePackSupport":true}' VSCODE_NODE_CACHED_DATA_DIR: /Users/stan/Library/Application Support/Code/CachedData/f06011ac164ae4dc8e753a3fe7f9549844d15e35 VSCODE_PID: '18791' VSCODE_PREVENT_FOREIGN_INSPECT: 'true' XPC_FLAGS: '0x0' XPC_SERVICE_NAME: '0' _: /usr/local/bin/diffenv __CF_USER_TEXT_ENCODING: 0x1F5:0x0:0x0 __PYVENV_LAUNCHER__: /usr/local/bin/python3 shell-version: GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18) Copyright (C) 2007 Free Software Foundation, Inc. --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index aeb66cd..33b763f 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ os: timezone: 0200 version: Darwin 18.7.0 x86_64 -# ...trimmed +# ...trimmed ``` (Simplified example. See [full example](https://raw.githubusercontent.com/error-central/diffenv/master/examples/gabe_env.yaml) here) @@ -64,7 +64,7 @@ python: - <<-: /usr/local/opt/python/libexec/bin/python + +>>: /usr/bin/python -# ...trimmed +# ...trimmed ``` ### Include environment in submitted issues @@ -149,6 +149,8 @@ optional arguments: --no-color don't color diff output --no-paging don't use less for paging output --version display version and exit + +More information and source code at https://github.com/error-central/diffenv ``` ## Customization From b968fc217e8243c57028e10aa415b275d58bc885 Mon Sep 17 00:00:00 2001 From: Stan James Date: Fri, 16 Aug 2019 20:59:56 +0200 Subject: [PATCH 68/87] test diffenv-version: 0.2.0 directory: listing: tests: 160, 1565970697.628735, DIR setup.py: 733, 1565938699.60907, 45a6e791baed384f3973926ab47d7a97 facets: 96, 1565678335.6676767, DIR examples: 160, 1565526937.9334917, DIR example_config.yaml: 45, 1564670036.66021, 759eab2b0f2d79bd2c0991820fa76787 env.yaml: 9557, 1565529046.05771, 10189a68cae562b4b15176c628584ea1 dist: 128, 1565525687.4886672, DIR diffenv.egg-info: 256, 1565525994.236996, DIR diffenv: 288, 1565938699.608119, DIR build: 160, 1565525325.6887057, DIR bin: 96, 1565800452.866075, DIR __pycache__: 96, 1564129273.2804494, DIR README.md: 5488, 1565971150.27754, 910a046ad20caf962e9e1ef33b7a9bdb MANIFEST.in: 68, 1565686663.53471, edff356a00ba1b5f0660d5514ebb5fb5 LICENSE: 1070, 1563971721.10152, bbd2cb1a41f404058e170e74a725bb18 .vscode: 128, 1565036334.5557442, DIR .travis.yml: 814, 1565623659.24969, d7278269a9794d1260164b15942c0c60 .gitignore: 1221, 1565035870.68035, 3b1c12c1ca4e89f3c929c73c4427f846 .github: 96, 1565526937.9326942, DIR .diffenv: 192, 1565528757.891121, DIR .DS_Store: 6148, 1564760143.68363, df20c99511081bcbf44de38d832fbe70 path: /Users/stan/code/diffenv git: git-remote: |- origin git@github.com:error-central/diffenv.git (fetch) origin git@github.com:error-central/diffenv.git (push) git-status: |- On branch master Your branch is up to date with 'origin/master'. Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) modified: bin/diffenv modified: examples/config-small.yaml Untracked files: (use "git add ..." to include in what will be committed) env.yaml no changes added to commit (use "git add" and/or "git commit -a") git-user-email: stan@wanderingstan.com git-user-name: Stan James version: git version 2.22.0 os: timezone: 0200 version: Darwin 18.7.0 x86_64 python: pip-packages: astroid: 2.2.5 autopep8: 1.4.4 bleach: 3.1.0 certifi: 2019.6.16 chardet: 3.0.4 colorama: 0.4.1 diffenv: 0.2.0 docutils: 0.15.2 gitdb2: 2.0.5 GitPython: 2.1.13 idna: 2.8 importlib-metadata: 0.19 isort: 4.3.21 lazy-object-proxy: 1.4.1 mccabe: 0.6.1 pip: 19.0.3 pkginfo: 1.5.0.1 psutil: 5.6.3 pycodestyle: 2.5.0 Pygments: 2.4.2 pylint: 2.3.1 readme-renderer: 24.0 requests: 2.22.0 requests-toolbelt: 0.9.1 rope: 0.14.0 ruamel.yaml: 0.16.0 ruamel.yaml.clib: 0.1.0 setuptools: 41.0.1 six: 1.12.0 smmap2: 2.0.5 tqdm: 4.33.0 twine: 1.13.0 typed-ast: 1.4.0 urllib3: 1.25.3 webencodings: 0.5.1 wheel: 0.33.4 wrapt: 1.11.2 zipp: 0.5.2 pip3-packages: astroid: 2.2.5 autopep8: 1.4.4 bleach: 3.1.0 certifi: 2019.6.16 chardet: 3.0.4 colorama: 0.4.1 diffenv: 0.2.0 docutils: 0.15.2 gitdb2: 2.0.5 GitPython: 2.1.13 idna: 2.8 importlib-metadata: 0.19 isort: 4.3.21 lazy-object-proxy: 1.4.1 mccabe: 0.6.1 pip: 19.0.3 pkginfo: 1.5.0.1 psutil: 5.6.3 pycodestyle: 2.5.0 Pygments: 2.4.2 pylint: 2.3.1 readme-renderer: 24.0 requests: 2.22.0 requests-toolbelt: 0.9.1 rope: 0.14.0 ruamel.yaml: 0.16.0 ruamel.yaml.clib: 0.1.0 setuptools: 41.0.1 six: 1.12.0 smmap2: 2.0.5 tqdm: 4.33.0 twine: 1.13.0 typed-ast: 1.4.0 urllib3: 1.25.3 webencodings: 0.5.1 wheel: 0.33.4 wrapt: 1.11.2 zipp: 0.5.2 python-version: Python 3.7.3 python3-version: Python 3.7.3 virtualenv: | which-python: /usr/local/opt/python/libexec/bin/python which-python3: /usr/local/bin/python3 shell: envvars: Apple_PubSub_Socket_Render: /private/tmp/com.apple.launchd.obyCxwiqZk/Render CLICOLOR: '1' COLORTERM: truecolor COMMAND_MODE: unix2003 DISPLAY: /private/tmp/com.apple.launchd.iqAX0LXCVg/org.macosforge.xquartz:0 EDITOR: sublw GIT_AUTHOR_DATE: '@1565981996 +0200' GIT_AUTHOR_EMAIL: stan@wanderingstan.com GIT_AUTHOR_NAME: Stan James GIT_EDITOR: ':' GIT_EXEC_PATH: /usr/local/Cellar/git/2.22.0/libexec/git-core GIT_INDEX_FILE: .git/index GIT_PREFIX: '' HISTTIMEFORMAT: '%Y-%m-%d_%H-%M-%S; ' HOME: /Users/stan ISODATETIME: '2019-08-16 17:38:49' LANG: en_US.UTF-8 LOGNAME: stan LSCOLORS: GxFxCxDxBxegedabagaced NVM_BIN: /Users/stan/.nvm/versions/node/v10.16.0/bin NVM_CD_FLAGS: '' NVM_DIR: /Users/stan/.nvm PATH(HASHED): 5541d1f8f1d0aaeaaa4eeb411bb945a9(HASH) PWD: /Users/stan/code/diffenv SHELL: /bin/bash SHLVL: '3' SSH_AUTH_SOCK: /private/tmp/com.apple.launchd.E89PogHTQB/Listeners TERM: xterm-color TERM_PROGRAM: vscode TERM_PROGRAM_VERSION: 1.37.1 TMPDIR: /var/folders/9n/2vf6_x0s79bdzphhpyk83fnr0000gn/T/ USER: stan XPC_FLAGS: '0x0' XPC_SERVICE_NAME: '0' _: /usr/local/bin/diffenv __CF_USER_TEXT_ENCODING: 0x1F5:0x0:0x0 __PYVENV_LAUNCHER__: /usr/local/bin/python3 shell-version: GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18) Copyright (C) 2007 Free Software Foundation, Inc. From cc76ac91bdf68196e11ea7805cfc1a61eb329fd3 Mon Sep 17 00:00:00 2001 From: Stan James Date: Fri, 16 Aug 2019 21:01:23 +0200 Subject: [PATCH 69/87] test diffenv-version: 0.2.0 directory: listing: tests: 160, 1565970697.628735, DIR setup.py: 733, 1565938699.60907, 45a6e791baed384f3973926ab47d7a97 facets: 96, 1565678335.6676767, DIR examples: 160, 1565526937.9334917, DIR example_config.yaml: 45, 1564670036.66021, 759eab2b0f2d79bd2c0991820fa76787 env.yaml: 9557, 1565529046.05771, 10189a68cae562b4b15176c628584ea1 dist: 128, 1565525687.4886672, DIR diffenv.egg-info: 256, 1565525994.236996, DIR diffenv: 288, 1565938699.608119, DIR build: 160, 1565525325.6887057, DIR bin: 96, 1565800452.866075, DIR __pycache__: 96, 1564129273.2804494, DIR README.md: 5488, 1565971150.27754, 910a046ad20caf962e9e1ef33b7a9bdb MANIFEST.in: 68, 1565686663.53471, edff356a00ba1b5f0660d5514ebb5fb5 LICENSE: 1070, 1563971721.10152, bbd2cb1a41f404058e170e74a725bb18 .vscode: 128, 1565036334.5557442, DIR .travis.yml: 814, 1565623659.24969, d7278269a9794d1260164b15942c0c60 .gitignore: 1223, 1565982079.42292, 586f18414fb67b907192a20951a623bf .github: 96, 1565526937.9326942, DIR .diffenv: 192, 1565528757.891121, DIR .DS_Store: 6148, 1564760143.68363, df20c99511081bcbf44de38d832fbe70 path: /Users/stan/code/diffenv git: git-remote: |- origin git@github.com:error-central/diffenv.git (fetch) origin git@github.com:error-central/diffenv.git (push) git-status: |- On branch master Your branch is ahead of 'origin/master' by 1 commit. (use "git push" to publish your local commits) Changes to be committed: (use "git reset HEAD ..." to unstage) new file: .diffenv/commits/XX.yaml Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) modified: .gitignore modified: bin/diffenv modified: examples/config-small.yaml Untracked files: (use "git add ..." to include in what will be committed) .diffenv/commits/0114ace505a8bc771aa1cce28d14684cf09727f7.diffenv .diffenv/commits/041ddf8c60ac4b1824e409c518144d7f53d7b31b.diffenv .diffenv/commits/04d619f2c1bf08056f6fd42fe8871c40690e7f8c.diffenv .diffenv/commits/0a28bced7bccb4ec0faecc3804b7370f70f269e6.diffenv .diffenv/commits/0e8c9f514502022400c1639663f766410f42607c.diffenv .diffenv/commits/0fd969ed6fcf06d3883f9ad60d2eaab6bfed7a5e.diffenv .diffenv/commits/1489cf37ba66c8f06a7617774aaa305f88bd06c1.diffenv .diffenv/commits/14d449afcf18231cf8ec89ca4a88b80f479a44ae.diffenv .diffenv/commits/151de1b539a7c510674867328a7ae6e198868ae3.diffenv .diffenv/commits/159679a896cd243db9af76f77a641355c6bb34c1.diffenv .diffenv/commits/166125101351854e4fa91634d782f541dbf01912.diffenv .diffenv/commits/16a5e0cdb7cf94f50ec3775d4a6b1c66f276168a.diffenv .diffenv/commits/1c7960ea43bd1ec0336f3c39144ca1e684effd1f.diffenv .diffenv/commits/1cd8c9a0c4e9e1c1053eacbd79ba65ae9154728a.diffenv .diffenv/commits/1dde852d8c390ece28ec071f9e202b21d9f51422.diffenv .diffenv/commits/1f476db032ae52765ef29d8ab8b1221880a65850.diffenv .diffenv/commits/2716c34fb6844bd82daeca4588842123001b56f8.diffenv .diffenv/commits/2b19c9e47af0828c8775ee231768631e0b06ae0f.diffenv .diffenv/commits/33f2a758521d845ee32490303072bdff01212aff.diffenv .diffenv/commits/3899802aa368ac7879fc1657e6f882cf85bd5a16.diffenv .diffenv/commits/3a2b3f48be0c0d6c761efaba7e1537730d0fa620.diffenv .diffenv/commits/3ae488133e2677ab1ad39ac6841400b262895811.diffenv .diffenv/commits/3e726982039a267d8df7aed0fafc4ebe49cad343.diffenv .diffenv/commits/4112feb71b16ac140de88e53e1f759508528b739.diffenv .diffenv/commits/42956d8a4c66be3b60d9e372056d5548fc340af3.diffenv .diffenv/commits/44611545ca5b65809dc5c55943e5a6d76b14b139.diffenv .diffenv/commits/48c7661120c648f5e6f3ed317409182c176a9034.diffenv .diffenv/commits/4a34c3b14e315ce94c43660fbad9ad28e3977891.diffenv .diffenv/commits/4d8850885fedc91f08f49c8101549d29d6f47e7d.diffenv .diffenv/commits/4f7f4614d53a203d4c3433eed0500aecb27868d4.diffenv .diffenv/commits/5a1c1a5c04ffd74094041b1d91ce2e9fcd7232e9.diffenv .diffenv/commits/5b422f62200e08f3dc09a7e0b00a20dd5d41c6c0.diffenv .diffenv/commits/612142ef90cc8f3f4f05a86608a62f3a36969372.diffenv .diffenv/commits/630df76abab4257f51502ae4cb3cbc1f44f6fd91.diffenv .diffenv/commits/6ecebfa22969c33be2f67d7f91c63a838a756b21.diffenv .diffenv/commits/70187318b02790ed0ae501801bdfa7475d660548.diffenv .diffenv/commits/706712b3488bb94036883d67ef1f871bb48c72b6.diffenv .diffenv/commits/759cd57119934333585d0fb4c6cc1238c76ad14d.diffenv .diffenv/commits/77749af7d1dc33e24e95981345b569e19a655e90.diffenv .diffenv/commits/7f16ea2044b2ba12a036a11d365807db54cfbeed.diffenv .diffenv/commits/7fd37f503cd46b96ad249d8ae8e884bddd0d13cc.diffenv .diffenv/commits/80f28949112b2c4b9fbab1a8d66a0b3bba3c97d3.diffenv .diffenv/commits/834a1c7fe05383e6d5e7a638ba5b5ef21aa150f6.diffenv .diffenv/commits/856fea119d383e422948f724adab314602077fe5.diffenv .diffenv/commits/886d4a55f738db76dc96603c7567ef5652f0c492.diffenv .diffenv/commits/8a764320b8282bc008594ba1a7b53922b14918b6.diffenv .diffenv/commits/8bc0b52250d565140eaa230eafc90f94cf83f07f.diffenv .diffenv/commits/8f553cf58d5595fa9b4238215787baac6520bd6b.diffenv .diffenv/commits/9bcd2095b5d65765dbad87b09735b2a934a1f8d7.diffenv .diffenv/commits/a0b4431a3a63f21b17ad85877182178e41f68599.diffenv .diffenv/commits/a0d29e83656a01329f702ab08e953aef1607d7b5.diffenv .diffenv/commits/a285eba637d944f3c53450f7a5ce05e878962d33.diffenv .diffenv/commits/afcabc8a0bec131fdcd77a4b040ed2bcb406ed46.diffenv .diffenv/commits/b455412413df8b99f3efadb8fc38c6faf2d38e3b.diffenv .diffenv/commits/b74274fd7f6bd85bb7f2b1e5baf4129701f3400e.diffenv .diffenv/commits/b82952d080a488cf7aac58797ff034d71b9165c3.diffenv .diffenv/commits/bfe232b69e3db4d4d524d52fc8996218aa429e2a.diffenv .diffenv/commits/c18c827c48f462b9ccb4daf0b68c4d099f69be0b.diffenv .diffenv/commits/c1c5f9162e170c325118d21794e4ef76f034f35c.diffenv .diffenv/commits/c2360230586ef660878662279f257ff6ee14c362.diffenv .diffenv/commits/c653cc793961cf751ea07ea435277814ed556234.diffenv .diffenv/commits/c73d6c5fa6a631f092f31e0715de7af430513fc1.diffenv .diffenv/commits/c75ca695050d40ae8509b109409a08760ef6155f.diffenv .diffenv/commits/cdbb7e07e573bddf813bdf4ae0e33b21dfe25aa7.diffenv .diffenv/commits/cf0383404a641ff224225170afb821ac3beedfce.diffenv .diffenv/commits/d720e1d4bb42b69842fc085817dc47d73a4862d3.diffenv .diffenv/commits/e77ed2bcad7e275999579464a82c55060debd14e.diffenv .diffenv/commits/eae7254c3f362e2d397e7552c607604fe89ad3bc.diffenv .diffenv/commits/eda95fb3582dab5087c57e2aadb7134e44620fd3.diffenv .diffenv/commits/f4d457f6a959823fbd2aba2fa480f0aa86e24d3b.diffenv .diffenv/commits/f67085e9d72ed17d2d701198c3176e75cb2a988c.diffenv .diffenv/commits/f8e6bf58cc9d2d1058d8ace3cbc0152a2ee5f3aa.diffenv .diffenv/commits/fd1d4b8d484dc8f7383eb69809e1c783d9593bc9.diffenv .diffenv/commits/fe273abd284f07492839b9330623b0ef67b773e7.diffenv env.yaml git-user-email: stan@wanderingstan.com git-user-name: Stan James version: git version 2.22.0 os: timezone: 0200 version: Darwin 18.7.0 x86_64 python: pip-packages: astroid: 2.2.5 autopep8: 1.4.4 bleach: 3.1.0 certifi: 2019.6.16 chardet: 3.0.4 colorama: 0.4.1 diffenv: 0.2.0 docutils: 0.15.2 gitdb2: 2.0.5 GitPython: 2.1.13 idna: 2.8 importlib-metadata: 0.19 isort: 4.3.21 lazy-object-proxy: 1.4.1 mccabe: 0.6.1 pip: 19.0.3 pkginfo: 1.5.0.1 psutil: 5.6.3 pycodestyle: 2.5.0 Pygments: 2.4.2 pylint: 2.3.1 readme-renderer: 24.0 requests: 2.22.0 requests-toolbelt: 0.9.1 rope: 0.14.0 ruamel.yaml: 0.16.0 ruamel.yaml.clib: 0.1.0 setuptools: 41.0.1 six: 1.12.0 smmap2: 2.0.5 tqdm: 4.33.0 twine: 1.13.0 typed-ast: 1.4.0 urllib3: 1.25.3 webencodings: 0.5.1 wheel: 0.33.4 wrapt: 1.11.2 zipp: 0.5.2 pip3-packages: astroid: 2.2.5 autopep8: 1.4.4 bleach: 3.1.0 certifi: 2019.6.16 chardet: 3.0.4 colorama: 0.4.1 diffenv: 0.2.0 docutils: 0.15.2 gitdb2: 2.0.5 GitPython: 2.1.13 idna: 2.8 importlib-metadata: 0.19 isort: 4.3.21 lazy-object-proxy: 1.4.1 mccabe: 0.6.1 pip: 19.0.3 pkginfo: 1.5.0.1 psutil: 5.6.3 pycodestyle: 2.5.0 Pygments: 2.4.2 pylint: 2.3.1 readme-renderer: 24.0 requests: 2.22.0 requests-toolbelt: 0.9.1 rope: 0.14.0 ruamel.yaml: 0.16.0 ruamel.yaml.clib: 0.1.0 setuptools: 41.0.1 six: 1.12.0 smmap2: 2.0.5 tqdm: 4.33.0 twine: 1.13.0 typed-ast: 1.4.0 urllib3: 1.25.3 webencodings: 0.5.1 wheel: 0.33.4 wrapt: 1.11.2 zipp: 0.5.2 python-version: Python 3.7.3 python3-version: Python 3.7.3 virtualenv: | which-python: /usr/local/opt/python/libexec/bin/python which-python3: /usr/local/bin/python3 shell: envvars: Apple_PubSub_Socket_Render: /private/tmp/com.apple.launchd.obyCxwiqZk/Render CLICOLOR: '1' COLORTERM: truecolor COMMAND_MODE: unix2003 DISPLAY: /private/tmp/com.apple.launchd.iqAX0LXCVg/org.macosforge.xquartz:0 EDITOR: sublw GIT_AUTHOR_DATE: '@1565982083 +0200' GIT_AUTHOR_EMAIL: stan@wanderingstan.com GIT_AUTHOR_NAME: Stan James GIT_EDITOR: ':' GIT_EXEC_PATH: /usr/local/Cellar/git/2.22.0/libexec/git-core GIT_INDEX_FILE: .git/index GIT_PREFIX: '' HISTTIMEFORMAT: '%Y-%m-%d_%H-%M-%S; ' HOME: /Users/stan ISODATETIME: '2019-08-16 17:38:49' LANG: en_US.UTF-8 LOGNAME: stan LSCOLORS: GxFxCxDxBxegedabagaced NVM_BIN: /Users/stan/.nvm/versions/node/v10.16.0/bin NVM_CD_FLAGS: '' NVM_DIR: /Users/stan/.nvm PATH(HASHED): 5541d1f8f1d0aaeaaa4eeb411bb945a9(HASH) PWD: /Users/stan/code/diffenv SHELL: /bin/bash SHLVL: '3' SSH_AUTH_SOCK: /private/tmp/com.apple.launchd.E89PogHTQB/Listeners TERM: xterm-color TERM_PROGRAM: vscode TERM_PROGRAM_VERSION: 1.37.1 TMPDIR: /var/folders/9n/2vf6_x0s79bdzphhpyk83fnr0000gn/T/ USER: stan XPC_FLAGS: '0x0' XPC_SERVICE_NAME: '0' _: /usr/local/bin/diffenv __CF_USER_TEXT_ENCODING: 0x1F5:0x0:0x0 __PYVENV_LAUNCHER__: /usr/local/bin/python3 shell-version: GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18) Copyright (C) 2007 Free Software Foundation, Inc. --- .diffenv/commits/XX.yaml | 204 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 204 insertions(+) create mode 100644 .diffenv/commits/XX.yaml diff --git a/.diffenv/commits/XX.yaml b/.diffenv/commits/XX.yaml new file mode 100644 index 0000000..24a9805 --- /dev/null +++ b/.diffenv/commits/XX.yaml @@ -0,0 +1,204 @@ + +diffenv-version: 0.2.0 + +directory: + + listing: + tests: 160, 1565970697.628735, DIR + setup.py: 733, 1565938699.60907, 45a6e791baed384f3973926ab47d7a97 + facets: 96, 1565678335.6676767, DIR + examples: 160, 1565526937.9334917, DIR + example_config.yaml: 45, 1564670036.66021, 759eab2b0f2d79bd2c0991820fa76787 + env.yaml: 9557, 1565529046.05771, 10189a68cae562b4b15176c628584ea1 + dist: 128, 1565525687.4886672, DIR + diffenv.egg-info: 256, 1565525994.236996, DIR + diffenv: 288, 1565938699.608119, DIR + build: 160, 1565525325.6887057, DIR + bin: 96, 1565800452.866075, DIR + __pycache__: 96, 1564129273.2804494, DIR + README.md: 5488, 1565971150.27754, 910a046ad20caf962e9e1ef33b7a9bdb + MANIFEST.in: 68, 1565686663.53471, edff356a00ba1b5f0660d5514ebb5fb5 + LICENSE: 1070, 1563971721.10152, bbd2cb1a41f404058e170e74a725bb18 + .vscode: 128, 1565036334.5557442, DIR + .travis.yml: 814, 1565623659.24969, d7278269a9794d1260164b15942c0c60 + .gitignore: 1223, 1565982079.42292, 586f18414fb67b907192a20951a623bf + .github: 96, 1565526937.9326942, DIR + .diffenv: 192, 1565528757.891121, DIR + .DS_Store: 6148, 1564760143.68363, df20c99511081bcbf44de38d832fbe70 + + path: /Users/stan/code/diffenv + +git: + + git-remote: |- + origin git@github.com:error-central/diffenv.git (fetch) + origin git@github.com:error-central/diffenv.git (push) + + git-status: |- + On branch master + Your branch is ahead of 'origin/master' by 1 commit. + (use "git push" to publish your local commits) + + Changes not staged for commit: + (use "git add ..." to update what will be committed) + (use "git checkout -- ..." to discard changes in working directory) + + modified: .gitignore + modified: bin/diffenv + modified: examples/config-small.yaml + + Untracked files: + (use "git add ..." to include in what will be committed) + + .diffenv/commits/ + env.yaml + + no changes added to commit (use "git add" and/or "git commit -a") + + git-user-email: stan@wanderingstan.com + + git-user-name: Stan James + + version: git version 2.22.0 + +os: + + timezone: 0200 + + version: Darwin 18.7.0 x86_64 + +python: + + pip-packages: + astroid: 2.2.5 + autopep8: 1.4.4 + bleach: 3.1.0 + certifi: 2019.6.16 + chardet: 3.0.4 + colorama: 0.4.1 + diffenv: 0.2.0 + docutils: 0.15.2 + gitdb2: 2.0.5 + GitPython: 2.1.13 + idna: 2.8 + importlib-metadata: 0.19 + isort: 4.3.21 + lazy-object-proxy: 1.4.1 + mccabe: 0.6.1 + pip: 19.0.3 + pkginfo: 1.5.0.1 + psutil: 5.6.3 + pycodestyle: 2.5.0 + Pygments: 2.4.2 + pylint: 2.3.1 + readme-renderer: 24.0 + requests: 2.22.0 + requests-toolbelt: 0.9.1 + rope: 0.14.0 + ruamel.yaml: 0.16.0 + ruamel.yaml.clib: 0.1.0 + setuptools: 41.0.1 + six: 1.12.0 + smmap2: 2.0.5 + tqdm: 4.33.0 + twine: 1.13.0 + typed-ast: 1.4.0 + urllib3: 1.25.3 + webencodings: 0.5.1 + wheel: 0.33.4 + wrapt: 1.11.2 + zipp: 0.5.2 + + pip3-packages: + astroid: 2.2.5 + autopep8: 1.4.4 + bleach: 3.1.0 + certifi: 2019.6.16 + chardet: 3.0.4 + colorama: 0.4.1 + diffenv: 0.2.0 + docutils: 0.15.2 + gitdb2: 2.0.5 + GitPython: 2.1.13 + idna: 2.8 + importlib-metadata: 0.19 + isort: 4.3.21 + lazy-object-proxy: 1.4.1 + mccabe: 0.6.1 + pip: 19.0.3 + pkginfo: 1.5.0.1 + psutil: 5.6.3 + pycodestyle: 2.5.0 + Pygments: 2.4.2 + pylint: 2.3.1 + readme-renderer: 24.0 + requests: 2.22.0 + requests-toolbelt: 0.9.1 + rope: 0.14.0 + ruamel.yaml: 0.16.0 + ruamel.yaml.clib: 0.1.0 + setuptools: 41.0.1 + six: 1.12.0 + smmap2: 2.0.5 + tqdm: 4.33.0 + twine: 1.13.0 + typed-ast: 1.4.0 + urllib3: 1.25.3 + webencodings: 0.5.1 + wheel: 0.33.4 + wrapt: 1.11.2 + zipp: 0.5.2 + + python-version: Python 3.7.3 + + python3-version: Python 3.7.3 + + virtualenv: | + + which-python: /usr/local/opt/python/libexec/bin/python + + which-python3: /usr/local/bin/python3 + +shell: + + envvars: + Apple_PubSub_Socket_Render: /private/tmp/com.apple.launchd.obyCxwiqZk/Render + CLICOLOR: '1' + COLORTERM: truecolor + COMMAND_MODE: unix2003 + DISPLAY: /private/tmp/com.apple.launchd.iqAX0LXCVg/org.macosforge.xquartz:0 + EDITOR: sublw + GIT_AUTHOR_DATE: '@1565982083 +0200' + GIT_AUTHOR_EMAIL: stan@wanderingstan.com + GIT_AUTHOR_NAME: Stan James + GIT_EDITOR: ':' + GIT_EXEC_PATH: /usr/local/Cellar/git/2.22.0/libexec/git-core + GIT_INDEX_FILE: .git/index + GIT_PREFIX: '' + HISTTIMEFORMAT: '%Y-%m-%d_%H-%M-%S; ' + HOME: /Users/stan + ISODATETIME: '2019-08-16 17:38:49' + LANG: en_US.UTF-8 + LOGNAME: stan + LSCOLORS: GxFxCxDxBxegedabagaced + NVM_BIN: /Users/stan/.nvm/versions/node/v10.16.0/bin + NVM_CD_FLAGS: '' + NVM_DIR: /Users/stan/.nvm + PATH(HASHED): 5541d1f8f1d0aaeaaa4eeb411bb945a9(HASH) + PWD: /Users/stan/code/diffenv + SHELL: /bin/bash + SHLVL: '3' + SSH_AUTH_SOCK: /private/tmp/com.apple.launchd.E89PogHTQB/Listeners + TERM: xterm-color + TERM_PROGRAM: vscode + TERM_PROGRAM_VERSION: 1.37.1 + TMPDIR: /var/folders/9n/2vf6_x0s79bdzphhpyk83fnr0000gn/T/ + USER: stan + XPC_FLAGS: '0x0' + XPC_SERVICE_NAME: '0' + _: /usr/local/bin/diffenv + __CF_USER_TEXT_ENCODING: 0x1F5:0x0:0x0 + __PYVENV_LAUNCHER__: /usr/local/bin/python3 + + shell-version: GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18) Copyright + (C) 2007 Free Software Foundation, Inc. From 8680cd5633d71a661723e2e50515ced7c860bc7c Mon Sep 17 00:00:00 2001 From: Stan James Date: Fri, 16 Aug 2019 21:02:53 +0200 Subject: [PATCH 70/87] test2 --- .diffenv/commits/XX.yaml | 80 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 77 insertions(+), 3 deletions(-) diff --git a/.diffenv/commits/XX.yaml b/.diffenv/commits/XX.yaml index 24a9805..e7893f5 100644 --- a/.diffenv/commits/XX.yaml +++ b/.diffenv/commits/XX.yaml @@ -36,13 +36,14 @@ git: git-status: |- On branch master - Your branch is ahead of 'origin/master' by 1 commit. + Your branch is ahead of 'origin/master' by 2 commits. (use "git push" to publish your local commits) Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) + modified: .diffenv/commits/XX.yaml modified: .gitignore modified: bin/diffenv modified: examples/config-small.yaml @@ -50,7 +51,80 @@ git: Untracked files: (use "git add ..." to include in what will be committed) - .diffenv/commits/ + .diffenv/commits/0114ace505a8bc771aa1cce28d14684cf09727f7.diffenv + .diffenv/commits/041ddf8c60ac4b1824e409c518144d7f53d7b31b.diffenv + .diffenv/commits/04d619f2c1bf08056f6fd42fe8871c40690e7f8c.diffenv + .diffenv/commits/0a28bced7bccb4ec0faecc3804b7370f70f269e6.diffenv + .diffenv/commits/0e8c9f514502022400c1639663f766410f42607c.diffenv + .diffenv/commits/0fd969ed6fcf06d3883f9ad60d2eaab6bfed7a5e.diffenv + .diffenv/commits/1489cf37ba66c8f06a7617774aaa305f88bd06c1.diffenv + .diffenv/commits/14d449afcf18231cf8ec89ca4a88b80f479a44ae.diffenv + .diffenv/commits/151de1b539a7c510674867328a7ae6e198868ae3.diffenv + .diffenv/commits/159679a896cd243db9af76f77a641355c6bb34c1.diffenv + .diffenv/commits/166125101351854e4fa91634d782f541dbf01912.diffenv + .diffenv/commits/16a5e0cdb7cf94f50ec3775d4a6b1c66f276168a.diffenv + .diffenv/commits/1c7960ea43bd1ec0336f3c39144ca1e684effd1f.diffenv + .diffenv/commits/1cd8c9a0c4e9e1c1053eacbd79ba65ae9154728a.diffenv + .diffenv/commits/1dde852d8c390ece28ec071f9e202b21d9f51422.diffenv + .diffenv/commits/1f476db032ae52765ef29d8ab8b1221880a65850.diffenv + .diffenv/commits/2716c34fb6844bd82daeca4588842123001b56f8.diffenv + .diffenv/commits/2b19c9e47af0828c8775ee231768631e0b06ae0f.diffenv + .diffenv/commits/33f2a758521d845ee32490303072bdff01212aff.diffenv + .diffenv/commits/3899802aa368ac7879fc1657e6f882cf85bd5a16.diffenv + .diffenv/commits/3a2b3f48be0c0d6c761efaba7e1537730d0fa620.diffenv + .diffenv/commits/3ae488133e2677ab1ad39ac6841400b262895811.diffenv + .diffenv/commits/3e726982039a267d8df7aed0fafc4ebe49cad343.diffenv + .diffenv/commits/4112feb71b16ac140de88e53e1f759508528b739.diffenv + .diffenv/commits/42956d8a4c66be3b60d9e372056d5548fc340af3.diffenv + .diffenv/commits/44611545ca5b65809dc5c55943e5a6d76b14b139.diffenv + .diffenv/commits/48c7661120c648f5e6f3ed317409182c176a9034.diffenv + .diffenv/commits/4a34c3b14e315ce94c43660fbad9ad28e3977891.diffenv + .diffenv/commits/4d8850885fedc91f08f49c8101549d29d6f47e7d.diffenv + .diffenv/commits/4f7f4614d53a203d4c3433eed0500aecb27868d4.diffenv + .diffenv/commits/5a1c1a5c04ffd74094041b1d91ce2e9fcd7232e9.diffenv + .diffenv/commits/5b422f62200e08f3dc09a7e0b00a20dd5d41c6c0.diffenv + .diffenv/commits/612142ef90cc8f3f4f05a86608a62f3a36969372.diffenv + .diffenv/commits/630df76abab4257f51502ae4cb3cbc1f44f6fd91.diffenv + .diffenv/commits/6ecebfa22969c33be2f67d7f91c63a838a756b21.diffenv + .diffenv/commits/70187318b02790ed0ae501801bdfa7475d660548.diffenv + .diffenv/commits/706712b3488bb94036883d67ef1f871bb48c72b6.diffenv + .diffenv/commits/759cd57119934333585d0fb4c6cc1238c76ad14d.diffenv + .diffenv/commits/77749af7d1dc33e24e95981345b569e19a655e90.diffenv + .diffenv/commits/7f16ea2044b2ba12a036a11d365807db54cfbeed.diffenv + .diffenv/commits/7fd37f503cd46b96ad249d8ae8e884bddd0d13cc.diffenv + .diffenv/commits/80f28949112b2c4b9fbab1a8d66a0b3bba3c97d3.diffenv + .diffenv/commits/834a1c7fe05383e6d5e7a638ba5b5ef21aa150f6.diffenv + .diffenv/commits/856fea119d383e422948f724adab314602077fe5.diffenv + .diffenv/commits/886d4a55f738db76dc96603c7567ef5652f0c492.diffenv + .diffenv/commits/8a764320b8282bc008594ba1a7b53922b14918b6.diffenv + .diffenv/commits/8bc0b52250d565140eaa230eafc90f94cf83f07f.diffenv + .diffenv/commits/8f553cf58d5595fa9b4238215787baac6520bd6b.diffenv + .diffenv/commits/9bcd2095b5d65765dbad87b09735b2a934a1f8d7.diffenv + .diffenv/commits/a0b4431a3a63f21b17ad85877182178e41f68599.diffenv + .diffenv/commits/a0d29e83656a01329f702ab08e953aef1607d7b5.diffenv + .diffenv/commits/a285eba637d944f3c53450f7a5ce05e878962d33.diffenv + .diffenv/commits/afcabc8a0bec131fdcd77a4b040ed2bcb406ed46.diffenv + .diffenv/commits/b455412413df8b99f3efadb8fc38c6faf2d38e3b.diffenv + .diffenv/commits/b74274fd7f6bd85bb7f2b1e5baf4129701f3400e.diffenv + .diffenv/commits/b82952d080a488cf7aac58797ff034d71b9165c3.diffenv + .diffenv/commits/bfe232b69e3db4d4d524d52fc8996218aa429e2a.diffenv + .diffenv/commits/c18c827c48f462b9ccb4daf0b68c4d099f69be0b.diffenv + .diffenv/commits/c1c5f9162e170c325118d21794e4ef76f034f35c.diffenv + .diffenv/commits/c2360230586ef660878662279f257ff6ee14c362.diffenv + .diffenv/commits/c653cc793961cf751ea07ea435277814ed556234.diffenv + .diffenv/commits/c73d6c5fa6a631f092f31e0715de7af430513fc1.diffenv + .diffenv/commits/c75ca695050d40ae8509b109409a08760ef6155f.diffenv + .diffenv/commits/cdbb7e07e573bddf813bdf4ae0e33b21dfe25aa7.diffenv + .diffenv/commits/cf0383404a641ff224225170afb821ac3beedfce.diffenv + .diffenv/commits/d720e1d4bb42b69842fc085817dc47d73a4862d3.diffenv + .diffenv/commits/e77ed2bcad7e275999579464a82c55060debd14e.diffenv + .diffenv/commits/eae7254c3f362e2d397e7552c607604fe89ad3bc.diffenv + .diffenv/commits/eda95fb3582dab5087c57e2aadb7134e44620fd3.diffenv + .diffenv/commits/f4d457f6a959823fbd2aba2fa480f0aa86e24d3b.diffenv + .diffenv/commits/f67085e9d72ed17d2d701198c3176e75cb2a988c.diffenv + .diffenv/commits/f8e6bf58cc9d2d1058d8ace3cbc0152a2ee5f3aa.diffenv + .diffenv/commits/fd1d4b8d484dc8f7383eb69809e1c783d9593bc9.diffenv + .diffenv/commits/fe273abd284f07492839b9330623b0ef67b773e7.diffenv env.yaml no changes added to commit (use "git add" and/or "git commit -a") @@ -168,7 +242,7 @@ shell: COMMAND_MODE: unix2003 DISPLAY: /private/tmp/com.apple.launchd.iqAX0LXCVg/org.macosforge.xquartz:0 EDITOR: sublw - GIT_AUTHOR_DATE: '@1565982083 +0200' + GIT_AUTHOR_DATE: '@1565982173 +0200' GIT_AUTHOR_EMAIL: stan@wanderingstan.com GIT_AUTHOR_NAME: Stan James GIT_EDITOR: ':' From b9c911ee27b295ea6375759aa210309e3389a0ff Mon Sep 17 00:00:00 2001 From: Stan James Date: Fri, 16 Aug 2019 21:16:49 +0200 Subject: [PATCH 71/87] test2 --- ...0cd5633d71a661723e2e50515ced7c860bc7c.yaml | 278 ++++++++++++++++++ 1 file changed, 278 insertions(+) create mode 100644 .diffenv/commits/8680cd5633d71a661723e2e50515ced7c860bc7c.yaml diff --git a/.diffenv/commits/8680cd5633d71a661723e2e50515ced7c860bc7c.yaml b/.diffenv/commits/8680cd5633d71a661723e2e50515ced7c860bc7c.yaml new file mode 100644 index 0000000..dcdbeae --- /dev/null +++ b/.diffenv/commits/8680cd5633d71a661723e2e50515ced7c860bc7c.yaml @@ -0,0 +1,278 @@ + +diffenv-version: 0.2.0 + +directory: + + listing: + tests: 160, 1565970697.628735, DIR + setup.py: 733, 1565938699.60907, 45a6e791baed384f3973926ab47d7a97 + facets: 96, 1565678335.6676767, DIR + examples: 160, 1565526937.9334917, DIR + example_config.yaml: 45, 1564670036.66021, 759eab2b0f2d79bd2c0991820fa76787 + env.yaml: 9557, 1565529046.05771, 10189a68cae562b4b15176c628584ea1 + dist: 128, 1565525687.4886672, DIR + diffenv.egg-info: 256, 1565525994.236996, DIR + diffenv: 288, 1565938699.608119, DIR + build: 160, 1565525325.6887057, DIR + bin: 96, 1565800452.866075, DIR + __pycache__: 96, 1564129273.2804494, DIR + README.md: 5488, 1565971150.27754, 910a046ad20caf962e9e1ef33b7a9bdb + MANIFEST.in: 68, 1565686663.53471, edff356a00ba1b5f0660d5514ebb5fb5 + LICENSE: 1070, 1563971721.10152, bbd2cb1a41f404058e170e74a725bb18 + .vscode: 128, 1565036334.5557442, DIR + .travis.yml: 814, 1565623659.24969, d7278269a9794d1260164b15942c0c60 + .gitignore: 1223, 1565982079.42292, 586f18414fb67b907192a20951a623bf + .github: 96, 1565526937.9326942, DIR + .diffenv: 192, 1565528757.891121, DIR + .DS_Store: 6148, 1564760143.68363, df20c99511081bcbf44de38d832fbe70 + + path: /Users/stan/code/diffenv + +git: + + git-remote: |- + origin git@github.com:error-central/diffenv.git (fetch) + origin git@github.com:error-central/diffenv.git (push) + + git-status: |- + On branch master + Your branch is ahead of 'origin/master' by 3 commits. + (use "git push" to publish your local commits) + + Changes not staged for commit: + (use "git add ..." to update what will be committed) + (use "git checkout -- ..." to discard changes in working directory) + + modified: .gitignore + modified: bin/diffenv + modified: examples/config-small.yaml + + Untracked files: + (use "git add ..." to include in what will be committed) + + .diffenv/commits/0114ace505a8bc771aa1cce28d14684cf09727f7.diffenv + .diffenv/commits/041ddf8c60ac4b1824e409c518144d7f53d7b31b.diffenv + .diffenv/commits/04d619f2c1bf08056f6fd42fe8871c40690e7f8c.diffenv + .diffenv/commits/0a28bced7bccb4ec0faecc3804b7370f70f269e6.diffenv + .diffenv/commits/0e8c9f514502022400c1639663f766410f42607c.diffenv + .diffenv/commits/0fd969ed6fcf06d3883f9ad60d2eaab6bfed7a5e.diffenv + .diffenv/commits/1489cf37ba66c8f06a7617774aaa305f88bd06c1.diffenv + .diffenv/commits/14d449afcf18231cf8ec89ca4a88b80f479a44ae.diffenv + .diffenv/commits/151de1b539a7c510674867328a7ae6e198868ae3.diffenv + .diffenv/commits/159679a896cd243db9af76f77a641355c6bb34c1.diffenv + .diffenv/commits/166125101351854e4fa91634d782f541dbf01912.diffenv + .diffenv/commits/16a5e0cdb7cf94f50ec3775d4a6b1c66f276168a.diffenv + .diffenv/commits/1c7960ea43bd1ec0336f3c39144ca1e684effd1f.diffenv + .diffenv/commits/1cd8c9a0c4e9e1c1053eacbd79ba65ae9154728a.diffenv + .diffenv/commits/1dde852d8c390ece28ec071f9e202b21d9f51422.diffenv + .diffenv/commits/1f476db032ae52765ef29d8ab8b1221880a65850.diffenv + .diffenv/commits/2716c34fb6844bd82daeca4588842123001b56f8.diffenv + .diffenv/commits/2b19c9e47af0828c8775ee231768631e0b06ae0f.diffenv + .diffenv/commits/33f2a758521d845ee32490303072bdff01212aff.diffenv + .diffenv/commits/3899802aa368ac7879fc1657e6f882cf85bd5a16.diffenv + .diffenv/commits/3a2b3f48be0c0d6c761efaba7e1537730d0fa620.diffenv + .diffenv/commits/3ae488133e2677ab1ad39ac6841400b262895811.diffenv + .diffenv/commits/3e726982039a267d8df7aed0fafc4ebe49cad343.diffenv + .diffenv/commits/4112feb71b16ac140de88e53e1f759508528b739.diffenv + .diffenv/commits/42956d8a4c66be3b60d9e372056d5548fc340af3.diffenv + .diffenv/commits/44611545ca5b65809dc5c55943e5a6d76b14b139.diffenv + .diffenv/commits/48c7661120c648f5e6f3ed317409182c176a9034.diffenv + .diffenv/commits/4a34c3b14e315ce94c43660fbad9ad28e3977891.diffenv + .diffenv/commits/4d8850885fedc91f08f49c8101549d29d6f47e7d.diffenv + .diffenv/commits/4f7f4614d53a203d4c3433eed0500aecb27868d4.diffenv + .diffenv/commits/5a1c1a5c04ffd74094041b1d91ce2e9fcd7232e9.diffenv + .diffenv/commits/5b422f62200e08f3dc09a7e0b00a20dd5d41c6c0.diffenv + .diffenv/commits/612142ef90cc8f3f4f05a86608a62f3a36969372.diffenv + .diffenv/commits/630df76abab4257f51502ae4cb3cbc1f44f6fd91.diffenv + .diffenv/commits/6ecebfa22969c33be2f67d7f91c63a838a756b21.diffenv + .diffenv/commits/70187318b02790ed0ae501801bdfa7475d660548.diffenv + .diffenv/commits/706712b3488bb94036883d67ef1f871bb48c72b6.diffenv + .diffenv/commits/759cd57119934333585d0fb4c6cc1238c76ad14d.diffenv + .diffenv/commits/77749af7d1dc33e24e95981345b569e19a655e90.diffenv + .diffenv/commits/7f16ea2044b2ba12a036a11d365807db54cfbeed.diffenv + .diffenv/commits/7fd37f503cd46b96ad249d8ae8e884bddd0d13cc.diffenv + .diffenv/commits/80f28949112b2c4b9fbab1a8d66a0b3bba3c97d3.diffenv + .diffenv/commits/834a1c7fe05383e6d5e7a638ba5b5ef21aa150f6.diffenv + .diffenv/commits/856fea119d383e422948f724adab314602077fe5.diffenv + .diffenv/commits/8680cd5633d71a661723e2e50515ced7c860bc7c.yaml + .diffenv/commits/886d4a55f738db76dc96603c7567ef5652f0c492.diffenv + .diffenv/commits/8a764320b8282bc008594ba1a7b53922b14918b6.diffenv + .diffenv/commits/8bc0b52250d565140eaa230eafc90f94cf83f07f.diffenv + .diffenv/commits/8f553cf58d5595fa9b4238215787baac6520bd6b.diffenv + .diffenv/commits/9bcd2095b5d65765dbad87b09735b2a934a1f8d7.diffenv + .diffenv/commits/a0b4431a3a63f21b17ad85877182178e41f68599.diffenv + .diffenv/commits/a0d29e83656a01329f702ab08e953aef1607d7b5.diffenv + .diffenv/commits/a285eba637d944f3c53450f7a5ce05e878962d33.diffenv + .diffenv/commits/afcabc8a0bec131fdcd77a4b040ed2bcb406ed46.diffenv + .diffenv/commits/b455412413df8b99f3efadb8fc38c6faf2d38e3b.diffenv + .diffenv/commits/b74274fd7f6bd85bb7f2b1e5baf4129701f3400e.diffenv + .diffenv/commits/b82952d080a488cf7aac58797ff034d71b9165c3.diffenv + .diffenv/commits/bfe232b69e3db4d4d524d52fc8996218aa429e2a.diffenv + .diffenv/commits/c18c827c48f462b9ccb4daf0b68c4d099f69be0b.diffenv + .diffenv/commits/c1c5f9162e170c325118d21794e4ef76f034f35c.diffenv + .diffenv/commits/c2360230586ef660878662279f257ff6ee14c362.diffenv + .diffenv/commits/c653cc793961cf751ea07ea435277814ed556234.diffenv + .diffenv/commits/c73d6c5fa6a631f092f31e0715de7af430513fc1.diffenv + .diffenv/commits/c75ca695050d40ae8509b109409a08760ef6155f.diffenv + .diffenv/commits/cdbb7e07e573bddf813bdf4ae0e33b21dfe25aa7.diffenv + .diffenv/commits/cf0383404a641ff224225170afb821ac3beedfce.diffenv + .diffenv/commits/d720e1d4bb42b69842fc085817dc47d73a4862d3.diffenv + .diffenv/commits/e77ed2bcad7e275999579464a82c55060debd14e.diffenv + .diffenv/commits/eae7254c3f362e2d397e7552c607604fe89ad3bc.diffenv + .diffenv/commits/eda95fb3582dab5087c57e2aadb7134e44620fd3.diffenv + .diffenv/commits/f4d457f6a959823fbd2aba2fa480f0aa86e24d3b.diffenv + .diffenv/commits/f67085e9d72ed17d2d701198c3176e75cb2a988c.diffenv + .diffenv/commits/f8e6bf58cc9d2d1058d8ace3cbc0152a2ee5f3aa.diffenv + .diffenv/commits/fd1d4b8d484dc8f7383eb69809e1c783d9593bc9.diffenv + .diffenv/commits/fe273abd284f07492839b9330623b0ef67b773e7.diffenv + env.yaml + + no changes added to commit (use "git add" and/or "git commit -a") + + git-user-email: stan@wanderingstan.com + + git-user-name: Stan James + + version: git version 2.22.0 + +os: + + timezone: 0200 + + version: Darwin 18.7.0 x86_64 + +python: + + pip-packages: + astroid: 2.2.5 + autopep8: 1.4.4 + bleach: 3.1.0 + certifi: 2019.6.16 + chardet: 3.0.4 + colorama: 0.4.1 + diffenv: 0.2.0 + docutils: 0.15.2 + gitdb2: 2.0.5 + GitPython: 2.1.13 + idna: 2.8 + importlib-metadata: 0.19 + isort: 4.3.21 + lazy-object-proxy: 1.4.1 + mccabe: 0.6.1 + pip: 19.0.3 + pkginfo: 1.5.0.1 + psutil: 5.6.3 + pycodestyle: 2.5.0 + Pygments: 2.4.2 + pylint: 2.3.1 + readme-renderer: 24.0 + requests: 2.22.0 + requests-toolbelt: 0.9.1 + rope: 0.14.0 + ruamel.yaml: 0.16.0 + ruamel.yaml.clib: 0.1.0 + setuptools: 41.0.1 + six: 1.12.0 + smmap2: 2.0.5 + tqdm: 4.33.0 + twine: 1.13.0 + typed-ast: 1.4.0 + urllib3: 1.25.3 + webencodings: 0.5.1 + wheel: 0.33.4 + wrapt: 1.11.2 + zipp: 0.5.2 + + pip3-packages: + astroid: 2.2.5 + autopep8: 1.4.4 + bleach: 3.1.0 + certifi: 2019.6.16 + chardet: 3.0.4 + colorama: 0.4.1 + diffenv: 0.2.0 + docutils: 0.15.2 + gitdb2: 2.0.5 + GitPython: 2.1.13 + idna: 2.8 + importlib-metadata: 0.19 + isort: 4.3.21 + lazy-object-proxy: 1.4.1 + mccabe: 0.6.1 + pip: 19.0.3 + pkginfo: 1.5.0.1 + psutil: 5.6.3 + pycodestyle: 2.5.0 + Pygments: 2.4.2 + pylint: 2.3.1 + readme-renderer: 24.0 + requests: 2.22.0 + requests-toolbelt: 0.9.1 + rope: 0.14.0 + ruamel.yaml: 0.16.0 + ruamel.yaml.clib: 0.1.0 + setuptools: 41.0.1 + six: 1.12.0 + smmap2: 2.0.5 + tqdm: 4.33.0 + twine: 1.13.0 + typed-ast: 1.4.0 + urllib3: 1.25.3 + webencodings: 0.5.1 + wheel: 0.33.4 + wrapt: 1.11.2 + zipp: 0.5.2 + + python-version: Python 3.7.3 + + python3-version: Python 3.7.3 + + virtualenv: | + + which-python: /usr/local/opt/python/libexec/bin/python + + which-python3: /usr/local/bin/python3 + +shell: + + envvars: + Apple_PubSub_Socket_Render: /private/tmp/com.apple.launchd.obyCxwiqZk/Render + CLICOLOR: '1' + COLORTERM: truecolor + COMMAND_MODE: unix2003 + DISPLAY: /private/tmp/com.apple.launchd.iqAX0LXCVg/org.macosforge.xquartz:0 + EDITOR: sublw + GIT_AUTHOR_DATE: '@1565983009 +0200' + GIT_AUTHOR_EMAIL: stan@wanderingstan.com + GIT_AUTHOR_NAME: Stan James + GIT_EDITOR: ':' + GIT_EXEC_PATH: /usr/local/Cellar/git/2.22.0/libexec/git-core + GIT_INDEX_FILE: .git/index + GIT_PREFIX: '' + HISTTIMEFORMAT: '%Y-%m-%d_%H-%M-%S; ' + HOME: /Users/stan + ISODATETIME: '2019-08-16 17:38:49' + LANG: en_US.UTF-8 + LOGNAME: stan + LSCOLORS: GxFxCxDxBxegedabagaced + NVM_BIN: /Users/stan/.nvm/versions/node/v10.16.0/bin + NVM_CD_FLAGS: '' + NVM_DIR: /Users/stan/.nvm + PATH(HASHED): 5541d1f8f1d0aaeaaa4eeb411bb945a9(HASH) + PWD: /Users/stan/code/diffenv + SHELL: /bin/bash + SHLVL: '3' + SSH_AUTH_SOCK: /private/tmp/com.apple.launchd.E89PogHTQB/Listeners + TERM: xterm-color + TERM_PROGRAM: vscode + TERM_PROGRAM_VERSION: 1.37.1 + TMPDIR: /var/folders/9n/2vf6_x0s79bdzphhpyk83fnr0000gn/T/ + USER: stan + XPC_FLAGS: '0x0' + XPC_SERVICE_NAME: '0' + _: /usr/local/bin/diffenv + __CF_USER_TEXT_ENCODING: 0x1F5:0x0:0x0 + __PYVENV_LAUNCHER__: /usr/local/bin/python3 + + shell-version: GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18) Copyright + (C) 2007 Free Software Foundation, Inc. From ab00d4ad917201cde332fc279e57ea1fbe2d96f5 Mon Sep 17 00:00:00 2001 From: Stan James Date: Fri, 16 Aug 2019 21:34:23 +0200 Subject: [PATCH 72/87] test3 diffenv was added to this commit. --- .diffenv/commits/XX.yaml | 278 ------------------ ...911ee27b295ea6375759aa210309e3389a0ff.yaml | 210 +++++++++++++ 2 files changed, 210 insertions(+), 278 deletions(-) delete mode 100644 .diffenv/commits/XX.yaml create mode 100644 .diffenv/commits/b9c911ee27b295ea6375759aa210309e3389a0ff.yaml diff --git a/.diffenv/commits/XX.yaml b/.diffenv/commits/XX.yaml deleted file mode 100644 index e7893f5..0000000 --- a/.diffenv/commits/XX.yaml +++ /dev/null @@ -1,278 +0,0 @@ - -diffenv-version: 0.2.0 - -directory: - - listing: - tests: 160, 1565970697.628735, DIR - setup.py: 733, 1565938699.60907, 45a6e791baed384f3973926ab47d7a97 - facets: 96, 1565678335.6676767, DIR - examples: 160, 1565526937.9334917, DIR - example_config.yaml: 45, 1564670036.66021, 759eab2b0f2d79bd2c0991820fa76787 - env.yaml: 9557, 1565529046.05771, 10189a68cae562b4b15176c628584ea1 - dist: 128, 1565525687.4886672, DIR - diffenv.egg-info: 256, 1565525994.236996, DIR - diffenv: 288, 1565938699.608119, DIR - build: 160, 1565525325.6887057, DIR - bin: 96, 1565800452.866075, DIR - __pycache__: 96, 1564129273.2804494, DIR - README.md: 5488, 1565971150.27754, 910a046ad20caf962e9e1ef33b7a9bdb - MANIFEST.in: 68, 1565686663.53471, edff356a00ba1b5f0660d5514ebb5fb5 - LICENSE: 1070, 1563971721.10152, bbd2cb1a41f404058e170e74a725bb18 - .vscode: 128, 1565036334.5557442, DIR - .travis.yml: 814, 1565623659.24969, d7278269a9794d1260164b15942c0c60 - .gitignore: 1223, 1565982079.42292, 586f18414fb67b907192a20951a623bf - .github: 96, 1565526937.9326942, DIR - .diffenv: 192, 1565528757.891121, DIR - .DS_Store: 6148, 1564760143.68363, df20c99511081bcbf44de38d832fbe70 - - path: /Users/stan/code/diffenv - -git: - - git-remote: |- - origin git@github.com:error-central/diffenv.git (fetch) - origin git@github.com:error-central/diffenv.git (push) - - git-status: |- - On branch master - Your branch is ahead of 'origin/master' by 2 commits. - (use "git push" to publish your local commits) - - Changes not staged for commit: - (use "git add ..." to update what will be committed) - (use "git checkout -- ..." to discard changes in working directory) - - modified: .diffenv/commits/XX.yaml - modified: .gitignore - modified: bin/diffenv - modified: examples/config-small.yaml - - Untracked files: - (use "git add ..." to include in what will be committed) - - .diffenv/commits/0114ace505a8bc771aa1cce28d14684cf09727f7.diffenv - .diffenv/commits/041ddf8c60ac4b1824e409c518144d7f53d7b31b.diffenv - .diffenv/commits/04d619f2c1bf08056f6fd42fe8871c40690e7f8c.diffenv - .diffenv/commits/0a28bced7bccb4ec0faecc3804b7370f70f269e6.diffenv - .diffenv/commits/0e8c9f514502022400c1639663f766410f42607c.diffenv - .diffenv/commits/0fd969ed6fcf06d3883f9ad60d2eaab6bfed7a5e.diffenv - .diffenv/commits/1489cf37ba66c8f06a7617774aaa305f88bd06c1.diffenv - .diffenv/commits/14d449afcf18231cf8ec89ca4a88b80f479a44ae.diffenv - .diffenv/commits/151de1b539a7c510674867328a7ae6e198868ae3.diffenv - .diffenv/commits/159679a896cd243db9af76f77a641355c6bb34c1.diffenv - .diffenv/commits/166125101351854e4fa91634d782f541dbf01912.diffenv - .diffenv/commits/16a5e0cdb7cf94f50ec3775d4a6b1c66f276168a.diffenv - .diffenv/commits/1c7960ea43bd1ec0336f3c39144ca1e684effd1f.diffenv - .diffenv/commits/1cd8c9a0c4e9e1c1053eacbd79ba65ae9154728a.diffenv - .diffenv/commits/1dde852d8c390ece28ec071f9e202b21d9f51422.diffenv - .diffenv/commits/1f476db032ae52765ef29d8ab8b1221880a65850.diffenv - .diffenv/commits/2716c34fb6844bd82daeca4588842123001b56f8.diffenv - .diffenv/commits/2b19c9e47af0828c8775ee231768631e0b06ae0f.diffenv - .diffenv/commits/33f2a758521d845ee32490303072bdff01212aff.diffenv - .diffenv/commits/3899802aa368ac7879fc1657e6f882cf85bd5a16.diffenv - .diffenv/commits/3a2b3f48be0c0d6c761efaba7e1537730d0fa620.diffenv - .diffenv/commits/3ae488133e2677ab1ad39ac6841400b262895811.diffenv - .diffenv/commits/3e726982039a267d8df7aed0fafc4ebe49cad343.diffenv - .diffenv/commits/4112feb71b16ac140de88e53e1f759508528b739.diffenv - .diffenv/commits/42956d8a4c66be3b60d9e372056d5548fc340af3.diffenv - .diffenv/commits/44611545ca5b65809dc5c55943e5a6d76b14b139.diffenv - .diffenv/commits/48c7661120c648f5e6f3ed317409182c176a9034.diffenv - .diffenv/commits/4a34c3b14e315ce94c43660fbad9ad28e3977891.diffenv - .diffenv/commits/4d8850885fedc91f08f49c8101549d29d6f47e7d.diffenv - .diffenv/commits/4f7f4614d53a203d4c3433eed0500aecb27868d4.diffenv - .diffenv/commits/5a1c1a5c04ffd74094041b1d91ce2e9fcd7232e9.diffenv - .diffenv/commits/5b422f62200e08f3dc09a7e0b00a20dd5d41c6c0.diffenv - .diffenv/commits/612142ef90cc8f3f4f05a86608a62f3a36969372.diffenv - .diffenv/commits/630df76abab4257f51502ae4cb3cbc1f44f6fd91.diffenv - .diffenv/commits/6ecebfa22969c33be2f67d7f91c63a838a756b21.diffenv - .diffenv/commits/70187318b02790ed0ae501801bdfa7475d660548.diffenv - .diffenv/commits/706712b3488bb94036883d67ef1f871bb48c72b6.diffenv - .diffenv/commits/759cd57119934333585d0fb4c6cc1238c76ad14d.diffenv - .diffenv/commits/77749af7d1dc33e24e95981345b569e19a655e90.diffenv - .diffenv/commits/7f16ea2044b2ba12a036a11d365807db54cfbeed.diffenv - .diffenv/commits/7fd37f503cd46b96ad249d8ae8e884bddd0d13cc.diffenv - .diffenv/commits/80f28949112b2c4b9fbab1a8d66a0b3bba3c97d3.diffenv - .diffenv/commits/834a1c7fe05383e6d5e7a638ba5b5ef21aa150f6.diffenv - .diffenv/commits/856fea119d383e422948f724adab314602077fe5.diffenv - .diffenv/commits/886d4a55f738db76dc96603c7567ef5652f0c492.diffenv - .diffenv/commits/8a764320b8282bc008594ba1a7b53922b14918b6.diffenv - .diffenv/commits/8bc0b52250d565140eaa230eafc90f94cf83f07f.diffenv - .diffenv/commits/8f553cf58d5595fa9b4238215787baac6520bd6b.diffenv - .diffenv/commits/9bcd2095b5d65765dbad87b09735b2a934a1f8d7.diffenv - .diffenv/commits/a0b4431a3a63f21b17ad85877182178e41f68599.diffenv - .diffenv/commits/a0d29e83656a01329f702ab08e953aef1607d7b5.diffenv - .diffenv/commits/a285eba637d944f3c53450f7a5ce05e878962d33.diffenv - .diffenv/commits/afcabc8a0bec131fdcd77a4b040ed2bcb406ed46.diffenv - .diffenv/commits/b455412413df8b99f3efadb8fc38c6faf2d38e3b.diffenv - .diffenv/commits/b74274fd7f6bd85bb7f2b1e5baf4129701f3400e.diffenv - .diffenv/commits/b82952d080a488cf7aac58797ff034d71b9165c3.diffenv - .diffenv/commits/bfe232b69e3db4d4d524d52fc8996218aa429e2a.diffenv - .diffenv/commits/c18c827c48f462b9ccb4daf0b68c4d099f69be0b.diffenv - .diffenv/commits/c1c5f9162e170c325118d21794e4ef76f034f35c.diffenv - .diffenv/commits/c2360230586ef660878662279f257ff6ee14c362.diffenv - .diffenv/commits/c653cc793961cf751ea07ea435277814ed556234.diffenv - .diffenv/commits/c73d6c5fa6a631f092f31e0715de7af430513fc1.diffenv - .diffenv/commits/c75ca695050d40ae8509b109409a08760ef6155f.diffenv - .diffenv/commits/cdbb7e07e573bddf813bdf4ae0e33b21dfe25aa7.diffenv - .diffenv/commits/cf0383404a641ff224225170afb821ac3beedfce.diffenv - .diffenv/commits/d720e1d4bb42b69842fc085817dc47d73a4862d3.diffenv - .diffenv/commits/e77ed2bcad7e275999579464a82c55060debd14e.diffenv - .diffenv/commits/eae7254c3f362e2d397e7552c607604fe89ad3bc.diffenv - .diffenv/commits/eda95fb3582dab5087c57e2aadb7134e44620fd3.diffenv - .diffenv/commits/f4d457f6a959823fbd2aba2fa480f0aa86e24d3b.diffenv - .diffenv/commits/f67085e9d72ed17d2d701198c3176e75cb2a988c.diffenv - .diffenv/commits/f8e6bf58cc9d2d1058d8ace3cbc0152a2ee5f3aa.diffenv - .diffenv/commits/fd1d4b8d484dc8f7383eb69809e1c783d9593bc9.diffenv - .diffenv/commits/fe273abd284f07492839b9330623b0ef67b773e7.diffenv - env.yaml - - no changes added to commit (use "git add" and/or "git commit -a") - - git-user-email: stan@wanderingstan.com - - git-user-name: Stan James - - version: git version 2.22.0 - -os: - - timezone: 0200 - - version: Darwin 18.7.0 x86_64 - -python: - - pip-packages: - astroid: 2.2.5 - autopep8: 1.4.4 - bleach: 3.1.0 - certifi: 2019.6.16 - chardet: 3.0.4 - colorama: 0.4.1 - diffenv: 0.2.0 - docutils: 0.15.2 - gitdb2: 2.0.5 - GitPython: 2.1.13 - idna: 2.8 - importlib-metadata: 0.19 - isort: 4.3.21 - lazy-object-proxy: 1.4.1 - mccabe: 0.6.1 - pip: 19.0.3 - pkginfo: 1.5.0.1 - psutil: 5.6.3 - pycodestyle: 2.5.0 - Pygments: 2.4.2 - pylint: 2.3.1 - readme-renderer: 24.0 - requests: 2.22.0 - requests-toolbelt: 0.9.1 - rope: 0.14.0 - ruamel.yaml: 0.16.0 - ruamel.yaml.clib: 0.1.0 - setuptools: 41.0.1 - six: 1.12.0 - smmap2: 2.0.5 - tqdm: 4.33.0 - twine: 1.13.0 - typed-ast: 1.4.0 - urllib3: 1.25.3 - webencodings: 0.5.1 - wheel: 0.33.4 - wrapt: 1.11.2 - zipp: 0.5.2 - - pip3-packages: - astroid: 2.2.5 - autopep8: 1.4.4 - bleach: 3.1.0 - certifi: 2019.6.16 - chardet: 3.0.4 - colorama: 0.4.1 - diffenv: 0.2.0 - docutils: 0.15.2 - gitdb2: 2.0.5 - GitPython: 2.1.13 - idna: 2.8 - importlib-metadata: 0.19 - isort: 4.3.21 - lazy-object-proxy: 1.4.1 - mccabe: 0.6.1 - pip: 19.0.3 - pkginfo: 1.5.0.1 - psutil: 5.6.3 - pycodestyle: 2.5.0 - Pygments: 2.4.2 - pylint: 2.3.1 - readme-renderer: 24.0 - requests: 2.22.0 - requests-toolbelt: 0.9.1 - rope: 0.14.0 - ruamel.yaml: 0.16.0 - ruamel.yaml.clib: 0.1.0 - setuptools: 41.0.1 - six: 1.12.0 - smmap2: 2.0.5 - tqdm: 4.33.0 - twine: 1.13.0 - typed-ast: 1.4.0 - urllib3: 1.25.3 - webencodings: 0.5.1 - wheel: 0.33.4 - wrapt: 1.11.2 - zipp: 0.5.2 - - python-version: Python 3.7.3 - - python3-version: Python 3.7.3 - - virtualenv: | - - which-python: /usr/local/opt/python/libexec/bin/python - - which-python3: /usr/local/bin/python3 - -shell: - - envvars: - Apple_PubSub_Socket_Render: /private/tmp/com.apple.launchd.obyCxwiqZk/Render - CLICOLOR: '1' - COLORTERM: truecolor - COMMAND_MODE: unix2003 - DISPLAY: /private/tmp/com.apple.launchd.iqAX0LXCVg/org.macosforge.xquartz:0 - EDITOR: sublw - GIT_AUTHOR_DATE: '@1565982173 +0200' - GIT_AUTHOR_EMAIL: stan@wanderingstan.com - GIT_AUTHOR_NAME: Stan James - GIT_EDITOR: ':' - GIT_EXEC_PATH: /usr/local/Cellar/git/2.22.0/libexec/git-core - GIT_INDEX_FILE: .git/index - GIT_PREFIX: '' - HISTTIMEFORMAT: '%Y-%m-%d_%H-%M-%S; ' - HOME: /Users/stan - ISODATETIME: '2019-08-16 17:38:49' - LANG: en_US.UTF-8 - LOGNAME: stan - LSCOLORS: GxFxCxDxBxegedabagaced - NVM_BIN: /Users/stan/.nvm/versions/node/v10.16.0/bin - NVM_CD_FLAGS: '' - NVM_DIR: /Users/stan/.nvm - PATH(HASHED): 5541d1f8f1d0aaeaaa4eeb411bb945a9(HASH) - PWD: /Users/stan/code/diffenv - SHELL: /bin/bash - SHLVL: '3' - SSH_AUTH_SOCK: /private/tmp/com.apple.launchd.E89PogHTQB/Listeners - TERM: xterm-color - TERM_PROGRAM: vscode - TERM_PROGRAM_VERSION: 1.37.1 - TMPDIR: /var/folders/9n/2vf6_x0s79bdzphhpyk83fnr0000gn/T/ - USER: stan - XPC_FLAGS: '0x0' - XPC_SERVICE_NAME: '0' - _: /usr/local/bin/diffenv - __CF_USER_TEXT_ENCODING: 0x1F5:0x0:0x0 - __PYVENV_LAUNCHER__: /usr/local/bin/python3 - - shell-version: GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18) Copyright - (C) 2007 Free Software Foundation, Inc. diff --git a/.diffenv/commits/b9c911ee27b295ea6375759aa210309e3389a0ff.yaml b/.diffenv/commits/b9c911ee27b295ea6375759aa210309e3389a0ff.yaml new file mode 100644 index 0000000..f6f17b8 --- /dev/null +++ b/.diffenv/commits/b9c911ee27b295ea6375759aa210309e3389a0ff.yaml @@ -0,0 +1,210 @@ + +diffenv-version: 0.2.0 + +directory: + + listing: + tests: 160, 1565970697.628735, DIR + setup.py: 733, 1565938699.60907, 45a6e791baed384f3973926ab47d7a97 + facets: 96, 1565678335.6676767, DIR + examples: 160, 1565526937.9334917, DIR + example_config.yaml: 45, 1564670036.66021, 759eab2b0f2d79bd2c0991820fa76787 + env.yaml: 9557, 1565529046.05771, 10189a68cae562b4b15176c628584ea1 + dist: 128, 1565525687.4886672, DIR + diffenv.egg-info: 256, 1565525994.236996, DIR + diffenv: 288, 1565938699.608119, DIR + build: 160, 1565525325.6887057, DIR + bin: 96, 1565983913.3839562, DIR + __pycache__: 96, 1564129273.2804494, DIR + README.md: 5488, 1565971150.27754, 910a046ad20caf962e9e1ef33b7a9bdb + MANIFEST.in: 68, 1565686663.53471, edff356a00ba1b5f0660d5514ebb5fb5 + LICENSE: 1070, 1563971721.10152, bbd2cb1a41f404058e170e74a725bb18 + .vscode: 128, 1565036334.5557442, DIR + .travis.yml: 814, 1565623659.24969, d7278269a9794d1260164b15942c0c60 + .gitignore: 1223, 1565982079.42292, 586f18414fb67b907192a20951a623bf + .github: 96, 1565526937.9326942, DIR + .diffenv: 192, 1565528757.891121, DIR + .DS_Store: 10244, 1565983486.60602, 1bc2854d0550a6d9a867e8f3d20c1e70 + + path: /Users/stan/code/diffenv + +git: + + git-remote: |- + origin git@github.com:error-central/diffenv.git (fetch) + origin git@github.com:error-central/diffenv.git (push) + + git-status: |- + On branch master + Your branch is ahead of 'origin/master' by 4 commits. + (use "git push" to publish your local commits) + + Changes to be committed: + (use "git reset HEAD ..." to unstage) + + deleted: .diffenv/commits/XX.yaml + + Changes not staged for commit: + (use "git add/rm ..." to update what will be committed) + (use "git checkout -- ..." to discard changes in working directory) + + modified: .gitignore + modified: bin/diffenv + deleted: diffenv/hooks/post-commit + modified: diffenv/hooks/prepare-commit-msg + modified: examples/config-small.yaml + + Untracked files: + (use "git add ..." to include in what will be committed) + + .diffenv/commits/b9c911ee27b295ea6375759aa210309e3389a0ff.yaml + diffenv/hooks/pre-commit + env.yaml + + git-user-email: stan@wanderingstan.com + + git-user-name: Stan James + + version: git version 2.22.0 + +os: + + timezone: 0200 + + version: Darwin 18.7.0 x86_64 + +python: + + pip-packages: + astroid: 2.2.5 + autopep8: 1.4.4 + bleach: 3.1.0 + certifi: 2019.6.16 + chardet: 3.0.4 + colorama: 0.4.1 + diffenv: 0.2.0 + docutils: 0.15.2 + gitdb2: 2.0.5 + GitPython: 2.1.13 + idna: 2.8 + importlib-metadata: 0.19 + isort: 4.3.21 + lazy-object-proxy: 1.4.1 + mccabe: 0.6.1 + pip: 19.0.3 + pkginfo: 1.5.0.1 + psutil: 5.6.3 + pycodestyle: 2.5.0 + Pygments: 2.4.2 + pylint: 2.3.1 + readme-renderer: 24.0 + requests: 2.22.0 + requests-toolbelt: 0.9.1 + rope: 0.14.0 + ruamel.yaml: 0.16.0 + ruamel.yaml.clib: 0.1.0 + setuptools: 41.0.1 + six: 1.12.0 + smmap2: 2.0.5 + tqdm: 4.33.0 + twine: 1.13.0 + typed-ast: 1.4.0 + urllib3: 1.25.3 + webencodings: 0.5.1 + wheel: 0.33.4 + wrapt: 1.11.2 + zipp: 0.5.2 + + pip3-packages: + astroid: 2.2.5 + autopep8: 1.4.4 + bleach: 3.1.0 + certifi: 2019.6.16 + chardet: 3.0.4 + colorama: 0.4.1 + diffenv: 0.2.0 + docutils: 0.15.2 + gitdb2: 2.0.5 + GitPython: 2.1.13 + idna: 2.8 + importlib-metadata: 0.19 + isort: 4.3.21 + lazy-object-proxy: 1.4.1 + mccabe: 0.6.1 + pip: 19.0.3 + pkginfo: 1.5.0.1 + psutil: 5.6.3 + pycodestyle: 2.5.0 + Pygments: 2.4.2 + pylint: 2.3.1 + readme-renderer: 24.0 + requests: 2.22.0 + requests-toolbelt: 0.9.1 + rope: 0.14.0 + ruamel.yaml: 0.16.0 + ruamel.yaml.clib: 0.1.0 + setuptools: 41.0.1 + six: 1.12.0 + smmap2: 2.0.5 + tqdm: 4.33.0 + twine: 1.13.0 + typed-ast: 1.4.0 + urllib3: 1.25.3 + webencodings: 0.5.1 + wheel: 0.33.4 + wrapt: 1.11.2 + zipp: 0.5.2 + + python-version: Python 3.7.3 + + python3-version: Python 3.7.3 + + virtualenv: | + + which-python: /usr/local/opt/python/libexec/bin/python + + which-python3: /usr/local/bin/python3 + +shell: + + envvars: + Apple_PubSub_Socket_Render: /private/tmp/com.apple.launchd.obyCxwiqZk/Render + CLICOLOR: '1' + COLORTERM: truecolor + COMMAND_MODE: unix2003 + DISPLAY: /private/tmp/com.apple.launchd.iqAX0LXCVg/org.macosforge.xquartz:0 + EDITOR: sublw + GIT_AUTHOR_DATE: '@1565984063 +0200' + GIT_AUTHOR_EMAIL: stan@wanderingstan.com + GIT_AUTHOR_NAME: Stan James + GIT_EDITOR: ':' + GIT_EXEC_PATH: /usr/local/Cellar/git/2.22.0/libexec/git-core + GIT_INDEX_FILE: .git/index + GIT_PREFIX: '' + HISTTIMEFORMAT: '%Y-%m-%d_%H-%M-%S; ' + HOME: /Users/stan + ISODATETIME: '2019-08-16 17:38:49' + LANG: en_US.UTF-8 + LOGNAME: stan + LSCOLORS: GxFxCxDxBxegedabagaced + NVM_BIN: /Users/stan/.nvm/versions/node/v10.16.0/bin + NVM_CD_FLAGS: '' + NVM_DIR: /Users/stan/.nvm + PATH(HASHED): 5541d1f8f1d0aaeaaa4eeb411bb945a9(HASH) + PWD: /Users/stan/code/diffenv + SHELL: /bin/bash + SHLVL: '3' + SSH_AUTH_SOCK: /private/tmp/com.apple.launchd.E89PogHTQB/Listeners + TERM: xterm-color + TERM_PROGRAM: vscode + TERM_PROGRAM_VERSION: 1.37.1 + TMPDIR: /var/folders/9n/2vf6_x0s79bdzphhpyk83fnr0000gn/T/ + USER: stan + XPC_FLAGS: '0x0' + XPC_SERVICE_NAME: '0' + _: /usr/local/bin/diffenv + __CF_USER_TEXT_ENCODING: 0x1F5:0x0:0x0 + __PYVENV_LAUNCHER__: /usr/local/bin/python3 + + shell-version: GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18) Copyright + (C) 2007 Free Software Foundation, Inc. From 81a493482e8db7ac0e02a21ca68959f96ae2734d Mon Sep 17 00:00:00 2001 From: Stan James Date: Fri, 16 Aug 2019 21:36:24 +0200 Subject: [PATCH 73/87] include env in each commit as file diffenv was added to this commit. --- ...0d4ad917201cde332fc279e57ea1fbe2d96f5.yaml | 219 ++++++++++++++++++ .gitignore | 1 - bin/diffenv | 43 ++-- diffenv/hooks/post-commit | 41 ---- diffenv/hooks/pre-commit | 6 + diffenv/hooks/prepare-commit-msg | 2 +- examples/config-small.yaml | 1 + 7 files changed, 254 insertions(+), 59 deletions(-) create mode 100644 .diffenv/commits/ab00d4ad917201cde332fc279e57ea1fbe2d96f5.yaml delete mode 100755 diffenv/hooks/post-commit create mode 100755 diffenv/hooks/pre-commit diff --git a/.diffenv/commits/ab00d4ad917201cde332fc279e57ea1fbe2d96f5.yaml b/.diffenv/commits/ab00d4ad917201cde332fc279e57ea1fbe2d96f5.yaml new file mode 100644 index 0000000..8e6ca9a --- /dev/null +++ b/.diffenv/commits/ab00d4ad917201cde332fc279e57ea1fbe2d96f5.yaml @@ -0,0 +1,219 @@ + +diffenv-version: 0.2.0 + +directory: + + listing: + tests: 160, 1565970697.628735, DIR + setup.py: 733, 1565938699.60907, 45a6e791baed384f3973926ab47d7a97 + facets: 96, 1565678335.6676767, DIR + examples: 160, 1565526937.9334917, DIR + example_config.yaml: 45, 1564670036.66021, 759eab2b0f2d79bd2c0991820fa76787 + dist: 128, 1565525687.4886672, DIR + diffenv.egg-info: 256, 1565525994.236996, DIR + diffenv: 288, 1565938699.608119, DIR + build: 160, 1565525325.6887057, DIR + bin: 96, 1565983913.3839562, DIR + __pycache__: 96, 1564129273.2804494, DIR + README.md: 5488, 1565971150.27754, 910a046ad20caf962e9e1ef33b7a9bdb + MANIFEST.in: 68, 1565686663.53471, edff356a00ba1b5f0660d5514ebb5fb5 + LICENSE: 1070, 1563971721.10152, bbd2cb1a41f404058e170e74a725bb18 + .vscode: 128, 1565036334.5557442, DIR + .travis.yml: 814, 1565623659.24969, d7278269a9794d1260164b15942c0c60 + .gitignore: 1204, 1565984121.26760, 492111bad3319be511a2db1a315e8b6a + .github: 96, 1565526937.9326942, DIR + .diffenv: 192, 1565528757.891121, DIR + .DS_Store: 10244, 1565983486.60602, 1bc2854d0550a6d9a867e8f3d20c1e70 + + path: /Users/stan/code/diffenv + +git: + + git-remote: |- + origin git@github.com:error-central/diffenv.git (fetch) + origin git@github.com:error-central/diffenv.git (push) + + git-status: |- + On branch master + Your branch is ahead of 'origin/master' by 5 commits. + (use "git push" to publish your local commits) + + Changes to be committed: + (use "git reset HEAD ..." to unstage) + + modified: .gitignore + modified: bin/diffenv + deleted: diffenv/hooks/post-commit + new file: diffenv/hooks/pre-commit + modified: diffenv/hooks/prepare-commit-msg + modified: examples/config-small.yaml + + Untracked files: + (use "git add ..." to include in what will be committed) + + .diffenv/commits/ab00d4ad917201cde332fc279e57ea1fbe2d96f5.yaml + + git-user-email: stan@wanderingstan.com + + git-user-name: Stan James + + version: git version 2.22.0 + +os: + + timezone: 0200 + + version: Darwin 18.7.0 x86_64 + +python: + + pip-packages: + astroid: 2.2.5 + autopep8: 1.4.4 + bleach: 3.1.0 + certifi: 2019.6.16 + chardet: 3.0.4 + colorama: 0.4.1 + diffenv: 0.2.0 + docutils: 0.15.2 + gitdb2: 2.0.5 + GitPython: 2.1.13 + idna: 2.8 + importlib-metadata: 0.19 + isort: 4.3.21 + lazy-object-proxy: 1.4.1 + mccabe: 0.6.1 + pip: 19.0.3 + pkginfo: 1.5.0.1 + psutil: 5.6.3 + pycodestyle: 2.5.0 + Pygments: 2.4.2 + pylint: 2.3.1 + readme-renderer: 24.0 + requests: 2.22.0 + requests-toolbelt: 0.9.1 + rope: 0.14.0 + ruamel.yaml: 0.16.0 + ruamel.yaml.clib: 0.1.0 + setuptools: 41.0.1 + six: 1.12.0 + smmap2: 2.0.5 + tqdm: 4.33.0 + twine: 1.13.0 + typed-ast: 1.4.0 + urllib3: 1.25.3 + webencodings: 0.5.1 + wheel: 0.33.4 + wrapt: 1.11.2 + zipp: 0.5.2 + + pip3-packages: + astroid: 2.2.5 + autopep8: 1.4.4 + bleach: 3.1.0 + certifi: 2019.6.16 + chardet: 3.0.4 + colorama: 0.4.1 + diffenv: 0.2.0 + docutils: 0.15.2 + gitdb2: 2.0.5 + GitPython: 2.1.13 + idna: 2.8 + importlib-metadata: 0.19 + isort: 4.3.21 + lazy-object-proxy: 1.4.1 + mccabe: 0.6.1 + pip: 19.0.3 + pkginfo: 1.5.0.1 + psutil: 5.6.3 + pycodestyle: 2.5.0 + Pygments: 2.4.2 + pylint: 2.3.1 + readme-renderer: 24.0 + requests: 2.22.0 + requests-toolbelt: 0.9.1 + rope: 0.14.0 + ruamel.yaml: 0.16.0 + ruamel.yaml.clib: 0.1.0 + setuptools: 41.0.1 + six: 1.12.0 + smmap2: 2.0.5 + tqdm: 4.33.0 + twine: 1.13.0 + typed-ast: 1.4.0 + urllib3: 1.25.3 + webencodings: 0.5.1 + wheel: 0.33.4 + wrapt: 1.11.2 + zipp: 0.5.2 + + python-version: Python 3.7.3 + + python3-version: Python 3.7.3 + + virtualenv: | + + which-python: /usr/local/opt/python/libexec/bin/python + + which-python3: /usr/local/bin/python3 + +shell: + + envvars: + AMD_ENTRYPOINT: vs/workbench/services/extensions/node/extensionHostProcess + APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL: 'true' + Apple_PubSub_Socket_Render: /private/tmp/com.apple.launchd.obyCxwiqZk/Render + CLICOLOR: '1' + COMMAND_MODE: unix2003 + DISPLAY: /private/tmp/com.apple.launchd.iqAX0LXCVg/org.macosforge.xquartz:0 + EDITOR: sublw + ELECTRON_RUN_AS_NODE: '1' + GIT_ASKPASS(HASHED): f7f6c93b472769a7f435573524ec859c(HASH) + GIT_AUTHOR_DATE: '@1565984184 +0200' + GIT_AUTHOR_EMAIL: stan@wanderingstan.com + GIT_AUTHOR_NAME: Stan James + GIT_EDITOR: ':' + GIT_EXEC_PATH: /usr/local/Cellar/git/2.22.0/libexec/git-core + GIT_INDEX_FILE: .git/index + GIT_PREFIX: '' + HISTTIMEFORMAT: '%Y-%m-%d_%H-%M-%S; ' + HOME: /Users/stan + ISODATETIME: '2019-08-16 13:24:43' + LANG: en_US.UTF-8 + LC_ALL: en_US.UTF-8 + LOGNAME: stan + LSCOLORS: GxFxCxDxBxegedabagaced + NVM_BIN: /Users/stan/.nvm/versions/node/v10.16.0/bin + NVM_CD_FLAGS: '' + NVM_DIR: /Users/stan/.nvm + PATH(HASHED): c13b21083de9282a02893eccaf6cce88(HASH) + PIPE_LOGGING: 'true' + PWD: /Users/stan/code/diffenv + SHELL: /bin/bash + SHLVL: '2' + SSH_AUTH_SOCK: /private/tmp/com.apple.launchd.E89PogHTQB/Listeners + TERM: xterm-color + TMPDIR: /var/folders/9n/2vf6_x0s79bdzphhpyk83fnr0000gn/T/ + USER: stan + VERBOSE_LOGGING: 'true' + VSCODE_GIT_ASKPASS_HANDLE(HASHED): 650140d2525815002eb6e27e3300cf67(HASH) + VSCODE_GIT_ASKPASS_MAIN(HASHED): 6af3c36a10ecc53c09c312b7cfdf594b(HASH) + VSCODE_GIT_ASKPASS_NODE(HASHED): 806450b4398ff983c7937491b19c4ece(HASH) + VSCODE_GIT_COMMAND: commit + VSCODE_HANDLES_UNCAUGHT_ERRORS: 'true' + VSCODE_IPC_HOOK: /Users/stan/Library/Application Support/Code/1.37.1-main.sock + VSCODE_IPC_HOOK_EXTHOST: /var/folders/9n/2vf6_x0s79bdzphhpyk83fnr0000gn/T/vscode-ipc-2bd4a4fc-de2f-4707-94a8-b20d768ba681.sock + VSCODE_LOGS: /Users/stan/Library/Application Support/Code/logs/20190816T132442 + VSCODE_LOG_STACK: 'false' + VSCODE_NLS_CONFIG: '{"locale":"en-us","availableLanguages":{},"_languagePackSupport":true}' + VSCODE_NODE_CACHED_DATA_DIR: /Users/stan/Library/Application Support/Code/CachedData/f06011ac164ae4dc8e753a3fe7f9549844d15e35 + VSCODE_PID: '18791' + VSCODE_PREVENT_FOREIGN_INSPECT: 'true' + XPC_FLAGS: '0x0' + XPC_SERVICE_NAME: '0' + _: /usr/local/bin/diffenv + __CF_USER_TEXT_ENCODING: 0x1F5:0x0:0x0 + __PYVENV_LAUNCHER__: /usr/local/bin/python3 + + shell-version: GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18) Copyright + (C) 2007 Free Software Foundation, Inc. diff --git a/.gitignore b/.gitignore index 6467029..d38c609 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,6 @@ __pycache__/ *.py[cod] *$py.class -.diffenv/commits # C extensions *.so diff --git a/bin/diffenv b/bin/diffenv index f74efbb..fadbd2c 100755 --- a/bin/diffenv +++ b/bin/diffenv @@ -122,26 +122,32 @@ try: sys.stderr.write("ERROR: Not in a git repot, so cannot add git hooks.") exit(1) - hooks_dst = os.path.join( - main.git_toplevel, '.git', 'hooks', 'post-commit') - hooks_src = os.path.join(main.get_main_dir(), 'hooks', 'post-commit') - # Copy the hook - copyfile(hooks_src, hooks_dst) - # Make executable - copystat(hooks_src, hooks_dst) - print("virtualenv: Installed git post-commit hook to %s" % hooks_dst) + main.git_toplevel, '.git', 'hooks', 'pre-commit') + if os.path.isfile(hooks_dst): + sys.stderr.write( + "%s already exists. Skipping.\n" % (hooks_dst)) + else: + hooks_src = os.path.join(main.get_main_dir(), 'hooks', 'pre-commit') + # Copy the hook + copyfile(hooks_src, hooks_dst) + # Make executable + copystat(hooks_src, hooks_dst) + print("virtualenv: Installed git post-commit hook to %s" % hooks_dst) hooks_dst = os.path.join( main.git_toplevel, '.git', 'hooks', 'prepare-commit-msg') - hooks_src = os.path.join( - main.get_main_dir(), 'hooks', 'prepare-commit-msg') - - # Copy the hook - copyfile(hooks_src, hooks_dst) - # Make executable - copystat(hooks_src, hooks_dst) - print("virtualenv: Installed git prepare-commit-msg hook to %s" % hooks_dst) + if os.path.isfile(hooks_dst): + sys.stderr.write( + "%s already exists. Skipping.\n" % (hooks_dst)) + else: + hooks_src = os.path.join( + main.get_main_dir(), 'hooks', 'prepare-commit-msg') + # Copy the hook + copyfile(hooks_src, hooks_dst) + # Make executable + copystat(hooks_src, hooks_dst) + print("virtualenv: Installed git prepare-commit-msg hook to %s" % hooks_dst) elif args.compare is not None: @@ -194,6 +200,11 @@ try: elif args.issue: # --share : Get a shareable link + if main.git_toplevel is None: + sys.stderr.write( + "ERROR: Not in a git repot, so cannot add git hooks.") + exit(1) + sys.stderr.write("Collecting env...\r") env = main.collect_env(facets, whitelist) yaml_stream = StringIO() diff --git a/diffenv/hooks/post-commit b/diffenv/hooks/post-commit deleted file mode 100755 index d3edae1..0000000 --- a/diffenv/hooks/post-commit +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env python3 - -""" -A git hook to automatically run diffenv after a successful git commit. -Saves to file named for the git hash -""" - -from subprocess import check_output, check_call, CalledProcessError -import sys -import os -from os.path import join - -try: - commit_hash = check_output( - ['git', 'rev-parse', 'HEAD']).decode("utf-8").strip() -except CalledProcessError as e: - sys.stderr.write( - "ERROR: diffenv git hook could get git hash. Error: %e\n" % - e) - exit(1) - -try: - # Ensure our .diffenv/commits dir exists - commits_dir = join( - os.getcwd(), '..', '..', '.diffenv', 'commits') - os.makedirs(commits_dir, exist_ok=True) -except e: - sys.stderr.write( - "ERROR: Could not create .diffenv/commits dir. Details: %s\n" % - e) - -try: - # Note: GIT_DIR is set by git before hook runs - diffenv_filename = join(commits_dir, commit_hash + '.diffenv') - commit_hash = check_call(['diffenv', '-o', diffenv_filename]) -except FileNotFoundError: - sys.stderr.write("ERROR: diffenv hook ran, but diffenv isn't installed.\n") - exit(1) -except CalledProcessError as e: - sys.stderr.write("ERROR: Could not run diffenv git hook. Error: %e\n" % e) - exit(1) diff --git a/diffenv/hooks/pre-commit b/diffenv/hooks/pre-commit new file mode 100755 index 0000000..c50eb87 --- /dev/null +++ b/diffenv/hooks/pre-commit @@ -0,0 +1,6 @@ +#!/bin/sh + +filename=$(git rev-parse HEAD) + +diffenv --output ".diffenv/commits/$filename.yaml" +git add ".diffenv/commits/$filename.yaml" diff --git a/diffenv/hooks/prepare-commit-msg b/diffenv/hooks/prepare-commit-msg index ad1375b..d915999 100755 --- a/diffenv/hooks/prepare-commit-msg +++ b/diffenv/hooks/prepare-commit-msg @@ -11,5 +11,5 @@ COMMIT_MSG_FILE=$1 COMMIT_SOURCE=$2 SHA1=$3 -diffenv >> "$COMMIT_MSG_FILE" +echo "\ndiffenv was added to this commit.\n" >> "$COMMIT_MSG_FILE" diff --git a/examples/config-small.yaml b/examples/config-small.yaml index 04e7d01..983da59 100644 --- a/examples/config-small.yaml +++ b/examples/config-small.yaml @@ -1,2 +1,3 @@ facets: diffenv-version: + php: From 97e0724dbdbc0a36f0d3b07ede52fb65e2d547d4 Mon Sep 17 00:00:00 2001 From: Stan James Date: Fri, 16 Aug 2019 22:29:46 +0200 Subject: [PATCH 74/87] fix readme test diffenv was added to this commit. --- ...493482e8db7ac0e02a21ca68959f96ae2734d.yaml | 213 ++++++++++++++++++ tests/tests.py | 6 +- 2 files changed, 216 insertions(+), 3 deletions(-) create mode 100644 .diffenv/commits/81a493482e8db7ac0e02a21ca68959f96ae2734d.yaml diff --git a/.diffenv/commits/81a493482e8db7ac0e02a21ca68959f96ae2734d.yaml b/.diffenv/commits/81a493482e8db7ac0e02a21ca68959f96ae2734d.yaml new file mode 100644 index 0000000..6124e39 --- /dev/null +++ b/.diffenv/commits/81a493482e8db7ac0e02a21ca68959f96ae2734d.yaml @@ -0,0 +1,213 @@ + +diffenv-version: 0.2.0 + +directory: + + listing: + tests: 160, 1565970697.628735, DIR + setup.py: 733, 1565938699.60907, 45a6e791baed384f3973926ab47d7a97 + facets: 96, 1565678335.6676767, DIR + examples: 160, 1565526937.9334917, DIR + example_config.yaml: 45, 1564670036.66021, 759eab2b0f2d79bd2c0991820fa76787 + dist: 128, 1565525687.4886672, DIR + diffenv.egg-info: 256, 1565525994.236996, DIR + diffenv: 288, 1565938699.608119, DIR + build: 160, 1565525325.6887057, DIR + bin: 96, 1565983913.3839562, DIR + __pycache__: 96, 1564129273.2804494, DIR + README.md: 5488, 1565971150.27754, 910a046ad20caf962e9e1ef33b7a9bdb + MANIFEST.in: 68, 1565686663.53471, edff356a00ba1b5f0660d5514ebb5fb5 + LICENSE: 1070, 1563971721.10152, bbd2cb1a41f404058e170e74a725bb18 + .vscode: 128, 1565036334.5557442, DIR + .travis.yml: 814, 1565623659.24969, d7278269a9794d1260164b15942c0c60 + .gitignore: 1204, 1565984121.26760, 492111bad3319be511a2db1a315e8b6a + .github: 96, 1565526937.9326942, DIR + .diffenv: 192, 1565528757.891121, DIR + .DS_Store: 10244, 1565983486.60602, 1bc2854d0550a6d9a867e8f3d20c1e70 + + path: /Users/stan/code/diffenv + +git: + + git-remote: |- + origin git@github.com:error-central/diffenv.git (fetch) + origin git@github.com:error-central/diffenv.git (push) + + git-status: |- + On branch master + Your branch is up to date with 'origin/master'. + + Changes to be committed: + (use "git reset HEAD ..." to unstage) + + modified: tests/tests.py + + Untracked files: + (use "git add ..." to include in what will be committed) + + .diffenv/commits/81a493482e8db7ac0e02a21ca68959f96ae2734d.yaml + + git-user-email: stan@wanderingstan.com + + git-user-name: Stan James + + version: git version 2.22.0 + +os: + + timezone: 0200 + + version: Darwin 18.7.0 x86_64 + +python: + + pip-packages: + astroid: 2.2.5 + autopep8: 1.4.4 + bleach: 3.1.0 + certifi: 2019.6.16 + chardet: 3.0.4 + colorama: 0.4.1 + diffenv: 0.2.0 + docutils: 0.15.2 + gitdb2: 2.0.5 + GitPython: 2.1.13 + idna: 2.8 + importlib-metadata: 0.19 + isort: 4.3.21 + lazy-object-proxy: 1.4.1 + mccabe: 0.6.1 + pip: 19.0.3 + pkginfo: 1.5.0.1 + psutil: 5.6.3 + pycodestyle: 2.5.0 + Pygments: 2.4.2 + pylint: 2.3.1 + readme-renderer: 24.0 + requests: 2.22.0 + requests-toolbelt: 0.9.1 + rope: 0.14.0 + ruamel.yaml: 0.16.0 + ruamel.yaml.clib: 0.1.0 + setuptools: 41.0.1 + six: 1.12.0 + smmap2: 2.0.5 + tqdm: 4.33.0 + twine: 1.13.0 + typed-ast: 1.4.0 + urllib3: 1.25.3 + webencodings: 0.5.1 + wheel: 0.33.4 + wrapt: 1.11.2 + zipp: 0.5.2 + + pip3-packages: + astroid: 2.2.5 + autopep8: 1.4.4 + bleach: 3.1.0 + certifi: 2019.6.16 + chardet: 3.0.4 + colorama: 0.4.1 + diffenv: 0.2.0 + docutils: 0.15.2 + gitdb2: 2.0.5 + GitPython: 2.1.13 + idna: 2.8 + importlib-metadata: 0.19 + isort: 4.3.21 + lazy-object-proxy: 1.4.1 + mccabe: 0.6.1 + pip: 19.0.3 + pkginfo: 1.5.0.1 + psutil: 5.6.3 + pycodestyle: 2.5.0 + Pygments: 2.4.2 + pylint: 2.3.1 + readme-renderer: 24.0 + requests: 2.22.0 + requests-toolbelt: 0.9.1 + rope: 0.14.0 + ruamel.yaml: 0.16.0 + ruamel.yaml.clib: 0.1.0 + setuptools: 41.0.1 + six: 1.12.0 + smmap2: 2.0.5 + tqdm: 4.33.0 + twine: 1.13.0 + typed-ast: 1.4.0 + urllib3: 1.25.3 + webencodings: 0.5.1 + wheel: 0.33.4 + wrapt: 1.11.2 + zipp: 0.5.2 + + python-version: Python 3.7.3 + + python3-version: Python 3.7.3 + + virtualenv: | + + which-python: /usr/local/opt/python/libexec/bin/python + + which-python3: /usr/local/bin/python3 + +shell: + + envvars: + AMD_ENTRYPOINT: vs/workbench/services/extensions/node/extensionHostProcess + APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL: 'true' + Apple_PubSub_Socket_Render: /private/tmp/com.apple.launchd.obyCxwiqZk/Render + CLICOLOR: '1' + COMMAND_MODE: unix2003 + DISPLAY: /private/tmp/com.apple.launchd.iqAX0LXCVg/org.macosforge.xquartz:0 + EDITOR: sublw + ELECTRON_RUN_AS_NODE: '1' + GIT_ASKPASS(HASHED): f7f6c93b472769a7f435573524ec859c(HASH) + GIT_AUTHOR_DATE: '@1565987386 +0200' + GIT_AUTHOR_EMAIL: stan@wanderingstan.com + GIT_AUTHOR_NAME: Stan James + GIT_EDITOR: ':' + GIT_EXEC_PATH: /usr/local/Cellar/git/2.22.0/libexec/git-core + GIT_INDEX_FILE: .git/index + GIT_PREFIX: '' + HISTTIMEFORMAT: '%Y-%m-%d_%H-%M-%S; ' + HOME: /Users/stan + ISODATETIME: '2019-08-16 13:24:43' + LANG: en_US.UTF-8 + LC_ALL: en_US.UTF-8 + LOGNAME: stan + LSCOLORS: GxFxCxDxBxegedabagaced + NVM_BIN: /Users/stan/.nvm/versions/node/v10.16.0/bin + NVM_CD_FLAGS: '' + NVM_DIR: /Users/stan/.nvm + PATH(HASHED): c13b21083de9282a02893eccaf6cce88(HASH) + PIPE_LOGGING: 'true' + PWD: /Users/stan/code/diffenv + SHELL: /bin/bash + SHLVL: '2' + SSH_AUTH_SOCK: /private/tmp/com.apple.launchd.E89PogHTQB/Listeners + TERM: xterm-color + TMPDIR: /var/folders/9n/2vf6_x0s79bdzphhpyk83fnr0000gn/T/ + USER: stan + VERBOSE_LOGGING: 'true' + VSCODE_GIT_ASKPASS_HANDLE(HASHED): 650140d2525815002eb6e27e3300cf67(HASH) + VSCODE_GIT_ASKPASS_MAIN(HASHED): 6af3c36a10ecc53c09c312b7cfdf594b(HASH) + VSCODE_GIT_ASKPASS_NODE(HASHED): 806450b4398ff983c7937491b19c4ece(HASH) + VSCODE_GIT_COMMAND: commit + VSCODE_HANDLES_UNCAUGHT_ERRORS: 'true' + VSCODE_IPC_HOOK: /Users/stan/Library/Application Support/Code/1.37.1-main.sock + VSCODE_IPC_HOOK_EXTHOST: /var/folders/9n/2vf6_x0s79bdzphhpyk83fnr0000gn/T/vscode-ipc-2bd4a4fc-de2f-4707-94a8-b20d768ba681.sock + VSCODE_LOGS: /Users/stan/Library/Application Support/Code/logs/20190816T132442 + VSCODE_LOG_STACK: 'false' + VSCODE_NLS_CONFIG: '{"locale":"en-us","availableLanguages":{},"_languagePackSupport":true}' + VSCODE_NODE_CACHED_DATA_DIR: /Users/stan/Library/Application Support/Code/CachedData/f06011ac164ae4dc8e753a3fe7f9549844d15e35 + VSCODE_PID: '18791' + VSCODE_PREVENT_FOREIGN_INSPECT: 'true' + XPC_FLAGS: '0x0' + XPC_SERVICE_NAME: '0' + _: /usr/local/bin/diffenv + __CF_USER_TEXT_ENCODING: 0x1F5:0x0:0x0 + __PYVENV_LAUNCHER__: /usr/local/bin/python3 + + shell-version: GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18) Copyright + (C) 2007 Free Software Foundation, Inc. diff --git a/tests/tests.py b/tests/tests.py index 6b92001..386b962 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -4,8 +4,8 @@ # Unit tests for diffenv # -# To run: -# python3 -m unittest tests.py +# Run from project root as: +# python3 -m unittest tests/tests.py class TestStringMethods(unittest.TestCase): @@ -32,7 +32,7 @@ def test_readme_for_help(self): # print(help_out) - with open('../README.md', 'r') as readme_file: + with open('./README.md', 'r') as readme_file: readme = readme_file.read() print(readme) From d2f051b1f97387dd05bc089cdc87853e3098ada5 Mon Sep 17 00:00:00 2001 From: Gabriel Pickard Date: Fri, 16 Aug 2019 21:56:26 +0200 Subject: [PATCH 75/87] Let facets take command line args from repo config --- .diffenv/config.yaml | 21 +++++++++++++- README.md | 31 ++++++++++++++++++++- diffenv/facets/directory/listing | 47 ++++++++++++++++++++------------ diffenv/facets/shell/envvars | 10 ++++++- diffenv/main.py | 12 ++++++-- example_config.yaml | 4 --- 6 files changed, 97 insertions(+), 28 deletions(-) delete mode 100644 example_config.yaml diff --git a/.diffenv/config.yaml b/.diffenv/config.yaml index e13ebf7..16bd92e 100644 --- a/.diffenv/config.yaml +++ b/.diffenv/config.yaml @@ -1,7 +1,26 @@ +# currently there is only one relevant part of the config, facets facets: + # you can simply list a category of facet that you want + # since it's a nested yaml dictionary / map, don't forget the colon python: + # or you can list all the way down to the facet within a category + nodejs: + node-version: git: os: shell: - diffenv-version: + # you can also provide command line arguments as list to the facet + # in this case it's a whitelist of environment variables + envvars: + - DISPLAY + - USER + - PATH + - PWD + - HOME + - SHELL + - COLORTERM + - TERM directory: + # in this case we restrict how deep we recur into child directories + listing: 1 + diffenv-version: diff --git a/README.md b/README.md index 24b1469..cafa42f 100644 --- a/README.md +++ b/README.md @@ -170,7 +170,36 @@ The facet file itself needs to be excutable (`chmod +x `). You can limit which facets are run with a yaml file saved in `.diffenv/config.yaml` -See `example_config.yaml` for more information. +Here's an example config: + +```yaml +# currently there is only one relevant part of the config, facets +facets: + # you can simply list a category of facet that you want + # since it's a nested yaml dictionary / map, don't forget the colon + python: + # or you can list all the way down to the facet within a category + nodejs: + node-version: + git: + os: + shell: + # you can also provide command line arguments as list to the facet + # in this case it's a whitelist of environment variables + envvars: + - DISPLAY + - USER + - PATH + - PWD + - HOME + - SHELL + - COLORTERM + - TERM + directory: + # in this case we restrict how deep we recur into child directories + listing: 1 +``` + ## Contributing to diffenv diff --git a/diffenv/facets/directory/listing b/diffenv/facets/directory/listing index 8a9bdd2..82559b2 100755 --- a/diffenv/facets/directory/listing +++ b/diffenv/facets/directory/listing @@ -14,6 +14,11 @@ from collections import OrderedDict MAX_FILE_SIZE_HASH = 1024 * 1024 # 1 MB +if len(sys.argv) > 1: + depth = int(sys.argv[1]) +else: + depth = 0 + def md5(fname): """ Get md5 hash of file. See: https://stackoverflow.com/a/3431838 """ @@ -24,27 +29,33 @@ def md5(fname): return hash_md5.hexdigest() -def file_info(path): - filepath = str(path.absolute()) - file_size_bytes = os.path.getsize(filepath) - file_mod_time = os.path.getmtime(filepath) - if path.is_dir(): - return ', '.join([str(file_size_bytes), - str(file_mod_time), 'DIR']) - else: - file_hash = ("-" * 32) if ( - file_size_bytes > MAX_FILE_SIZE_HASH) else md5(filepath) - - return ', '.join( - [str(file_size_bytes), str(file_mod_time)[:16], file_hash]) - - -def collect_dir_info(path): - return OrderedDict([(p.name or '.', file_info(p)) +def file_info(path, depth): + try: + filepath = str(path.absolute()) + file_size_bytes = os.path.getsize(filepath) + file_mod_time = os.path.getmtime(filepath) + if path.is_dir(): + if depth < 1: + return ', '.join([str(file_size_bytes), + str(file_mod_time), 'DIR']) + else: + return collect_dir_info(path, depth - 1) + else: + file_hash = ("-" * 32) if ( + file_size_bytes > MAX_FILE_SIZE_HASH) else md5(filepath) + + return ', '.join( + [str(file_size_bytes), str(file_mod_time)[:16], file_hash]) + except FileNotFoundError as e: + return "deleted" + + +def collect_dir_info(path, depth): + return OrderedDict([(p.name or '.', file_info(p, depth)) for p in sorted(list(path.iterdir()), reverse=True) if p.name != '.git']) -json.dump(collect_dir_info(pathlib.Path('.')), +json.dump(collect_dir_info(pathlib.Path('.'), depth), sys.stdout) diff --git a/diffenv/facets/shell/envvars b/diffenv/facets/shell/envvars index 97a4cd9..8baf5b5 100755 --- a/diffenv/facets/shell/envvars +++ b/diffenv/facets/shell/envvars @@ -15,6 +15,11 @@ from collections import OrderedDict # Switched to json as it needs no librarires # yaml = YAML() +if len(sys.argv) > 1: + whitelist = sys.argv[1:] +else: + whitelist = None + def filter_sensitive_vars(env_var: Tuple[str, str]): """ @@ -43,5 +48,8 @@ def filter_sensitive_vars(env_var: Tuple[str, str]): env_vars = os.environ.items() -filtered_env_vars = list(map(filter_sensitive_vars, env_vars)) +# if whitelist is given only print vars in whitelist +filtered_env_vars = [(k, v) for k, v in map(filter_sensitive_vars, env_vars) + if whitelist is None or k in whitelist] + json.dump(OrderedDict(sorted(filtered_env_vars)), sys.stdout) diff --git a/diffenv/main.py b/diffenv/main.py index c828a66..0ae688d 100644 --- a/diffenv/main.py +++ b/diffenv/main.py @@ -24,14 +24,18 @@ git_toplevel = None -def run_facet(path): +def run_facet(path, args=None): """ Run a facet and return the results as a Python object """ + # Package single string args up as list + if args and not isinstance(args, list): + args = [args] + args = list(map(str, args or [])) if not os.access(path, os.X_OK): sys.stderr.write("ERROR: Facet is not executable: %s" % path) return "WARNING: Skipping non-executable facet: %s" % path try: process = subprocess.Popen( - [path], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + [path] + args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = process.communicate() out_decoded = out.decode("utf-8").strip() if err: @@ -135,7 +139,9 @@ def collect_env(facets, whitelist): """ if isinstance(facets, str): # Actually run the facet and return the results - return run_facet(facets) + # in this case facets is a path to the facet executable + # and whitelist is a list of arguments (potentially) + return run_facet(facets, whitelist) elif whitelist is None or isinstance(whitelist, str): for subdir in list(facets.keys()): facets[subdir] = collect_env(facets[subdir], whitelist) diff --git a/example_config.yaml b/example_config.yaml deleted file mode 100644 index a030bc2..0000000 --- a/example_config.yaml +++ /dev/null @@ -1,4 +0,0 @@ -facets: - nodejs: - node-version: - shell: From 5bec4233574c89a527278bdcc6fe30b0f3ae9134 Mon Sep 17 00:00:00 2001 From: Stan James Date: Fri, 16 Aug 2019 22:45:38 +0200 Subject: [PATCH 76/87] add hash example to readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cafa42f..f93b263 100644 --- a/README.md +++ b/README.md @@ -21,8 +21,8 @@ shell: envvars: EDITOR: sublw GIT_EDITOR: subl -w - API_ENDPOINT: http://api.lvh.me:4000 PRISMA_ENDPOINT: http://prisma:4466 + GOOGLE_API_KEY(HASHED): 603ade004ce4bb13c3f66bc1644164ca(HASH) os: timezone: 0200 version: Darwin 18.7.0 x86_64 From d8cce5f87e54ba664c3cfbb8645b7a12be2ef008 Mon Sep 17 00:00:00 2001 From: Gabriel Pickard Date: Mon, 19 Aug 2019 22:34:29 +0200 Subject: [PATCH 77/87] Facet one-liners #40 --- README.md | 5 ++++- bin/diffenv | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f93b263..dcc8e9b 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,7 @@ $ diffenv --help usage: diffenv [-h] [-o OUTPUT] [-c COMPARE] [--add-hooks] [--share] [--issue] [--post POST] [--config CONFIG] [--ignore-config] [--no-color] - [--no-paging] [--version] + [--no-paging] [--version] [-f FACET] Diff your total environment. Run without any params to simply output current environment state as YAML. @@ -152,8 +152,11 @@ optional arguments: --no-color don't color diff output --no-paging don't use less for paging output --version display version and exit + -f FACET, --facet FACET + run a specific facet More information and source code at https://github.com/error-central/diffenv + ``` ## Customization diff --git a/bin/diffenv b/bin/diffenv index fadbd2c..e5a2151 100755 --- a/bin/diffenv +++ b/bin/diffenv @@ -52,6 +52,7 @@ parser.add_argument('--no-paging', parser.add_argument('--version', action='store_true', help="display version and exit") +parser.add_argument('-f', '--facet', help='run a specific facet') args = parser.parse_args() @@ -112,6 +113,15 @@ try: except: user_config = None config = (git_config or user_config or default_config) + + if args.facet: + # The user has specified one facet to execute + # so overwrite the config facets + facets_agg = None + for facet_name in reversed(args.facet.split(':')): + facets_agg = {facet_name: facets_agg} + config['facets'] = facets_agg + facets = main.get_all_facets() whitelist = config['facets'] From d62cf912725a8326d7831325652c9005e1b1501e Mon Sep 17 00:00:00 2001 From: Stan James Date: Wed, 21 Aug 2019 15:58:33 +0200 Subject: [PATCH 78/87] clarify --issue option --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dcc8e9b..4b71416 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ python: ```bash #$ diffenv --issue -# Browser will open with new issue +# Browser will open a Github issue with env data automatically added: ``` Screen Shot 2019-08-14 at 6 43 06 PM From 3174c4ad076412d6ea94c67c515f60f109a62c0b Mon Sep 17 00:00:00 2001 From: Gabriel Pickard Date: Wed, 21 Aug 2019 19:05:07 +0200 Subject: [PATCH 79/87] Update README.md --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 4b71416..dc6173b 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,16 @@ os: ``` (Simplified example. See [full example](https://raw.githubusercontent.com/error-central/diffenv/master/examples/gabe_env.yaml) here) +You can also use diffenv to find out things like installed packages or current environment variables with a one-liner: + +```bash +# get all python-relevant information +diffenv --facet python + +# list environment variables +diffenv -f shell:envvars +``` + ### Share your environment with co-worker ``` #$ diffenv --share @@ -72,6 +82,10 @@ python: ### Include environment in submitted issues +If you are an open-source project maintainer you can use diffenv to structure the submission of bugreports. Tell your users to specify the conditions under which their bug occurs by sending along their diffenv output. This way you can get significantly more detailled insight from the get-go without having to go back and forth with the reporter of the bug. + +For github issues we provide a handy way to submit a new issue and include a local diffenv dump directly from the command line. + ```bash #$ diffenv --issue From 90b9c3f6478dd1e9b6342d0a930d16ebba1370ff Mon Sep 17 00:00:00 2001 From: Stan James Date: Sat, 24 Aug 2019 10:01:40 +0200 Subject: [PATCH 80/87] Readme formatting fix + re-phrasing --- README.md | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index dc6173b..5b7c3c7 100644 --- a/README.md +++ b/README.md @@ -31,13 +31,13 @@ os: ``` (Simplified example. See [full example](https://raw.githubusercontent.com/error-central/diffenv/master/examples/gabe_env.yaml) here) -You can also use diffenv to find out things like installed packages or current environment variables with a one-liner: +You can also get just specific facets: ```bash -# get all python-relevant information +# Get all python-relevant information diffenv --facet python -# list environment variables +# List environment variables diffenv -f shell:envvars ``` @@ -190,19 +190,25 @@ You can limit which facets are run with a yaml file saved in `.diffenv/config.ya Here's an example config: ```yaml -# currently there is only one relevant part of the config, facets +# Currently there is only one relevant part of the config, facets. facets: - # you can simply list a category of facet that you want - # since it's a nested yaml dictionary / map, don't forget the colon + # If you give the name of a directory, it will run all facets in it. + # In this case, we'll run every facet within `python`. python: - # or you can list all the way down to the facet within a category + + # ...or you can list all the way down to the facet within a directory. + # Here we'll only run the `node-version` facet. nodejs: node-version: + git: + os: + shell: - # you can also provide command line arguments as list to the facet - # in this case it's a whitelist of environment variables + # You can also provide command line arguments as list to the facet. + # In this case we pass the `shell` facet a whitelist of environment + # variables to show. envvars: - DISPLAY - USER @@ -213,7 +219,7 @@ facets: - COLORTERM - TERM directory: - # in this case we restrict how deep we recur into child directories + # In this case we restrict how deep we recur into child directories listing: 1 ``` From 2b1829dfcd3ffcf0ad5c5fe263196d41185b66a9 Mon Sep 17 00:00:00 2001 From: Stan James Date: Mon, 26 Aug 2019 17:59:52 +0200 Subject: [PATCH 81/87] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dc6173b..b0b4545 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ diffenv gathers and compares development environments. It defines a simple standard for storing a complete picture of an environment -as a structured collection of "facets" such as "python", "shell", +as a structured collection of facets such as "python", "shell", "git", etc. ![output](https://user-images.githubusercontent.com/673455/62836101-182d1200-bc60-11e9-95c7-1f52dfb197b7.gif) From 9380482218483f7fe92a58ca301099644e34589e Mon Sep 17 00:00:00 2001 From: Stan James Date: Mon, 26 Aug 2019 18:00:31 +0200 Subject: [PATCH 82/87] spelling fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b0b4545..568cb60 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ python: ### Include environment in submitted issues -If you are an open-source project maintainer you can use diffenv to structure the submission of bugreports. Tell your users to specify the conditions under which their bug occurs by sending along their diffenv output. This way you can get significantly more detailled insight from the get-go without having to go back and forth with the reporter of the bug. +If you are an open-source project maintainer you can use diffenv to structure the submission of bug reports. Tell your users to specify the conditions under which their bug occurs by sending along their diffenv output. This way you can get significantly more detailed insight from the get-go without having to go back and forth with the reporter of the bug. For github issues we provide a handy way to submit a new issue and include a local diffenv dump directly from the command line. From 90f5bc0757e42456c4b5a438ac320b3871d7704f Mon Sep 17 00:00:00 2001 From: Gabriel Pickard Date: Sun, 13 Oct 2019 23:44:17 +0200 Subject: [PATCH 83/87] Version bump --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 8a840ac..2412cc1 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ def readme(): setup( name='diffenv', - version='0.2.6', + version='0.2.7', author='Stan James, Gabriel Pickard', author_email='wanderingstan@gmail.com, wergomat@gmail.com', url='http://github.com/error-central/diffenv', From 95390e228cc906ecef9ad48bcb817f61dfeef49c Mon Sep 17 00:00:00 2001 From: Gabriel Pickard Date: Wed, 26 Feb 2020 12:16:20 -0600 Subject: [PATCH 84/87] Accept line delineated JSON output from facets --- diffenv/main.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/diffenv/main.py b/diffenv/main.py index 0ae688d..f9560d0 100644 --- a/diffenv/main.py +++ b/diffenv/main.py @@ -51,14 +51,18 @@ def run_facet(path, args=None): # Try to parse JSON return json.loads(out_decoded) # NOTE: We're throwing away stderr if present - except ValueError as e: + except json.decoder.JSONDecodeError as e: + # maybe it's a multiline JSON try: - # If that fails, try to parse YAML - return yaml.load(out_decoded) + return [json.loads(line) for line in out_decoded.split('\n')] + except ValueError as e: + try: + # If that fails, try to parse YAML + return yaml.load(out_decoded) # NOTE: We're throwing away stderr if present - except ScannerError as e: - # If that fails, return raw output - return LiteralScalarString(out_decoded) + except ScannerError as e: + # If that fails, return raw output + return LiteralScalarString(out_decoded) except subprocess.CalledProcessError as e: return LiteralScalarString("ERROR: Problem running %s: %e" % (path, e)) From 7e511dd05936f4aaaec7c7879b03d88d3ddd6b7a Mon Sep 17 00:00:00 2001 From: Gabriel Pickard Date: Wed, 26 Feb 2020 12:18:06 -0600 Subject: [PATCH 85/87] Docker facets --- diffenv/facets/docker/docker-ps | 3 +++ diffenv/facets/docker/inspect-running-instances | 6 ++++++ diffenv/facets/docker/running-instances | 3 +++ 3 files changed, 12 insertions(+) create mode 100755 diffenv/facets/docker/docker-ps create mode 100755 diffenv/facets/docker/inspect-running-instances create mode 100755 diffenv/facets/docker/running-instances diff --git a/diffenv/facets/docker/docker-ps b/diffenv/facets/docker/docker-ps new file mode 100755 index 0000000..c33bf95 --- /dev/null +++ b/diffenv/facets/docker/docker-ps @@ -0,0 +1,3 @@ +#!/bin/bash + +docker ps --format='{{json .}}' diff --git a/diffenv/facets/docker/inspect-running-instances b/diffenv/facets/docker/inspect-running-instances new file mode 100755 index 0000000..5d99a67 --- /dev/null +++ b/diffenv/facets/docker/inspect-running-instances @@ -0,0 +1,6 @@ +#!/bin/bash + +for instance in `docker ps -q | sort -V` +do + docker inspect --format '{{json .}}' $instance +done diff --git a/diffenv/facets/docker/running-instances b/diffenv/facets/docker/running-instances new file mode 100755 index 0000000..4433545 --- /dev/null +++ b/diffenv/facets/docker/running-instances @@ -0,0 +1,3 @@ +#!/bin/bash + +docker ps -q | sort -V | sed -e 's/^/- /' From 91cc41319771bfd8222d4e604e60a7d7083b4beb Mon Sep 17 00:00:00 2001 From: Gabriel Pickard Date: Mon, 2 Mar 2020 13:11:18 -0600 Subject: [PATCH 86/87] Bump version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 2412cc1..e01cec9 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ def readme(): setup( name='diffenv', - version='0.2.7', + version='0.2.8', author='Stan James, Gabriel Pickard', author_email='wanderingstan@gmail.com, wergomat@gmail.com', url='http://github.com/error-central/diffenv', From d2da178607f9064e6068b0c32e1176fd6c2e3ed1 Mon Sep 17 00:00:00 2001 From: Gabriel Pickard Date: Mon, 2 Mar 2020 13:51:28 -0600 Subject: [PATCH 87/87] Get rid of transfer.sh, it seems broken --- bin/diffenv | 6 +++--- setup.py | 2 +- tests/tests.py | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/diffenv b/bin/diffenv index e5a2151..d62877f 100755 --- a/bin/diffenv +++ b/bin/diffenv @@ -37,7 +37,7 @@ parser.add_argument( parser.add_argument( '--post', - default='https://transfer.sh', + default='https://file.io', help='POST env to specific URL when sharing; must be used with --share') parser.add_argument('--config', help='load config from specific file') parser.add_argument('--ignore-config', @@ -197,8 +197,8 @@ try: upload_url = args.post sys.stderr.write("\033[K") sys.stderr.write("Uploading...\r") - r = requests.post(upload_url, files={'env.yaml': env_string}) - share_url = r.text + r = requests.post(upload_url, files={'file': env_string}).json() + share_url = r['link'] sys.stderr.write("\033[K") print("\033[K") print('Your env was uploaded to: ' + share_url) diff --git a/setup.py b/setup.py index e01cec9..a975414 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ def readme(): setup( name='diffenv', - version='0.2.8', + version='0.2.9', author='Stan James, Gabriel Pickard', author_email='wanderingstan@gmail.com, wergomat@gmail.com', url='http://github.com/error-central/diffenv', diff --git a/tests/tests.py b/tests/tests.py index 386b962..3ada68d 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -52,6 +52,7 @@ def test_sharing(self): # Get the url # 5th line Should be e.g. `diffenv --compare https://transfer.sh/15xMWL/diff` diff_command = result_lines[5] + print(result_lines) self.assertEqual(diff_command[:26], "diffenv --compare https://") process = subprocess.Popen(