skilleter-thingy 0.0.43__py3-none-any.whl → 0.0.44__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of skilleter-thingy might be problematic. Click here for more details.

@@ -14,7 +14,7 @@ import sys
14
14
  import argparse
15
15
  import os
16
16
 
17
- import thingy.git2 as git
17
+ import pygit2
18
18
 
19
19
  ################################################################################
20
20
 
@@ -30,6 +30,7 @@ def main():
30
30
  help='If we are already at the top of the working tree, look for a parent directory with a repo control file (.repo directory or .mrconfig file) and output that directory.')
31
31
  parser.add_argument('level', nargs='?', type=int, default=0, help='Number of levels below the top-level directory to report')
32
32
  args = parser.parse_args()
33
+
33
34
  try:
34
35
  start_dir = os.getcwd()
35
36
  except FileNotFoundError:
@@ -38,7 +39,7 @@ def main():
38
39
 
39
40
  # Try to get the current working tree
40
41
 
41
- working_tree = git.working_tree(start_dir)
42
+ working_tree = pygit2.discovery_repository(start_dir)
42
43
 
43
44
  # If we are in a working tree and also looking for the parent working
44
45
  # tree, check if we are at the top of the current tree, and, if so,
@@ -50,7 +51,7 @@ def main():
50
51
  if os.path.samefile(working_tree, current_directory):
51
52
  os.chdir('..')
52
53
 
53
- working_tree = git.working_tree()
54
+ working_tree = pygit2.discovery_repository()
54
55
 
55
56
  # If we are also looking for a multi-repo control file or directory, and haven't
56
57
  # found the git working tree root scan up the tree until we find one.
@@ -0,0 +1,86 @@
1
+ #!/usr/bin/env python3
2
+
3
+ import os
4
+ import stat
5
+ import argparse
6
+
7
+ ################################################################################
8
+
9
+ TEMPLATE = \
10
+ """#!/usr/bin/env bash
11
+
12
+ set -e
13
+
14
+ ################################################################################
15
+
16
+ VENV_NAME=$(basename "$0")
17
+ VENV_DIR=__venv__
18
+
19
+ GREEN="\e[42m"
20
+ NORMAL="\e[0m"
21
+
22
+ ################################################################################
23
+
24
+ function box()
25
+ {
26
+ echo -e "${GREEN}################################################################################${NORMAL}"
27
+ echo -e "${GREEN}# $@${NORMAL}"
28
+ echo -e "${GREEN}################################################################################${NORMAL}"
29
+ }
30
+
31
+ ################################################################################
32
+
33
+ box "Creating & activating $VENV_NAME virtual environment"
34
+
35
+ python3 -m venv $VENV_DIR
36
+
37
+ source $VENV_DIR/bin/activate
38
+
39
+ if [[ -f requirements.txt ]]
40
+ then
41
+ box "Installing/Upgrading packages"
42
+
43
+ python3 -m pip install -r requirements.txt
44
+ fi
45
+
46
+ box "Running ${VENV_NAME} script"
47
+
48
+ python3 ./${VENV_NAME}.py "$@"
49
+
50
+ deactivate
51
+ """
52
+
53
+ ################################################################################
54
+
55
+ def main():
56
+ """Create the venv script and make it executable"""
57
+
58
+ parser = argparse.ArgumentParser(description='Create a script to run Python code in a virtual environment')
59
+ parser.add_argument('name', nargs=1, help='Name of the script to create')
60
+
61
+ args = parser.parse_args()
62
+
63
+ with open(args.name[0], 'wt') as scriptfile:
64
+ scriptfile.write(TEMPLATE)
65
+
66
+ statinfo = os.stat(args.name[0])
67
+
68
+ os.chmod(args.name[0], statinfo.st_mode|stat.S_IXUSR|stat.S_IXGRP|stat.S_IXOTH)
69
+
70
+ ################################################################################
71
+
72
+ def venv_create():
73
+ """Entry point"""
74
+
75
+ try:
76
+ main()
77
+
78
+ except KeyboardInterrupt:
79
+ sys.exit(1)
80
+ except BrokenPipeError:
81
+ sys.exit(2)
82
+
83
+ ################################################################################
84
+
85
+ if __name__ == '__main__':
86
+ venv_create()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: skilleter_thingy
3
- Version: 0.0.43
3
+ Version: 0.0.44
4
4
  Summary: A collection of useful utilities, mainly aimed at making Git more friendly
5
5
  Author-email: John Skilleter <john@skilleter.org.uk>
6
6
  Project-URL: Home, https://skilleter.org.uk
@@ -17,7 +17,7 @@ skilleter_thingy/git_mr.py,sha256=BCE68hhz2bV0zwHkEv5tyfRY0aXoUdb_aJ-yWYDu_Wo,30
17
17
  skilleter_thingy/git_parent.py,sha256=D47D01dPs6kActusA0ircJYTv8tBjDoe8MzMpJVWJpA,2683
18
18
  skilleter_thingy/git_review.py,sha256=1_vGcEgy6TvzoXIIDqsOeRZ4qeweDeNPuLwDQsEH08k,51769
19
19
  skilleter_thingy/git_update.py,sha256=2SAGeqL2LjdsXTYak3nvPtNfhSOWJdXZfAUx6bqC8Qw,13972
20
- skilleter_thingy/git_wt.py,sha256=pe2VNmNZTlc4su9I1-xnDcui7QVBQ7X3kOIJWQrrfic,3128
20
+ skilleter_thingy/git_wt.py,sha256=T5_jTJjTWypiTq6zWCsonSGE6dl4iwpY9II6ScCbhVs,3139
21
21
  skilleter_thingy/gitcmp_helper.py,sha256=_3ji-PyIF2oI6a4zyUPjLeCFgAtACykxPpOrbjD6-aw,11245
22
22
  skilleter_thingy/gitprompt.py,sha256=SzSMd0EGI7ftPko80Q2PipwbVA-qjU1jsmdpmTCM5GI,8912
23
23
  skilleter_thingy/gl.py,sha256=9zbGpKxw6lX9RghLkdy-Q5sZlqtbB3uGFO04qTu1dH8,5954
@@ -37,6 +37,7 @@ skilleter_thingy/sysmon.py,sha256=XRZG6EVSzoVYan_N16qVB1l1RaU51uvLWlRA0CDjC54,11
37
37
  skilleter_thingy/tfm.py,sha256=3ejKNI2P65lGz-50mxRMxW_o5NmoeMDcmhji_0uALhI,33703
38
38
  skilleter_thingy/tfparse.py,sha256=u1IZH2J_WH1aORyMozKSI2JKok7_S1MMJhiobzmhlUI,2988
39
39
  skilleter_thingy/trimpath.py,sha256=IJU3zl4Hg08g0eU24LZyDlGfNa-5k-TZM5s9zR4OIdA,2385
40
+ skilleter_thingy/venv_create.py,sha256=QOoAfZblufVUCxZc66t39b_A5D0-hPGragkP1teB7mo,2072
40
41
  skilleter_thingy/window_rename.py,sha256=dCBgZqih_3YKHt35hsOAhARFp3QxOi8w8huC63sqJK8,3128
41
42
  skilleter_thingy/xchmod.py,sha256=F9_lxKuLqVlHHr3oBI3dkMoFOuwRzYDlpQMTmDcjpBI,4590
42
43
  skilleter_thingy/yamlcheck.py,sha256=FXylZ5NtHirDlPVhVEUZUZkTugVR-g51BbjaN06akAc,2868
@@ -58,9 +59,9 @@ skilleter_thingy/thingy/process.py,sha256=88pKHQZXBP1m3Ja7t3DtKJ4Njn7HS2OtcI0Z0i
58
59
  skilleter_thingy/thingy/run.py,sha256=051lGahG4liYLckQFpmSaGuE9Chd-lFdmJO85LdmeXE,12607
59
60
  skilleter_thingy/thingy/tfm_pane.py,sha256=40DmQeLMEUPiKKIJkgN1MEpIen00V70I1HB7Q6git44,19814
60
61
  skilleter_thingy/thingy/tidy.py,sha256=wzkyxzCsHXyY46G3Rjqu4ZrqiL8QMbRXyJEeYOmpy-o,5402
61
- skilleter_thingy-0.0.43.dist-info/LICENSE,sha256=ljOS4DjXvqEo5VzGfdaRwgRZPbNScGBmfwyC8PChvmQ,32422
62
- skilleter_thingy-0.0.43.dist-info/METADATA,sha256=JNXTCsuEenFxp_a2xM31w-P125GvfA6UJCAm4NQW348,5313
63
- skilleter_thingy-0.0.43.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
64
- skilleter_thingy-0.0.43.dist-info/entry_points.txt,sha256=IT6cZSbGHrd2UzIQbiMRotKiTJnYJBkESC4fAe8gjsE,2026
65
- skilleter_thingy-0.0.43.dist-info/top_level.txt,sha256=8-JhgToBBiWURunmvfpSxEvNkDHQQ7r25-aBXtZv61g,17
66
- skilleter_thingy-0.0.43.dist-info/RECORD,,
62
+ skilleter_thingy-0.0.44.dist-info/LICENSE,sha256=ljOS4DjXvqEo5VzGfdaRwgRZPbNScGBmfwyC8PChvmQ,32422
63
+ skilleter_thingy-0.0.44.dist-info/METADATA,sha256=LJ50JU50_euiz0igXs6KsMtUSVHcEXIqSHoo62qbV48,5313
64
+ skilleter_thingy-0.0.44.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
65
+ skilleter_thingy-0.0.44.dist-info/entry_points.txt,sha256=IT6cZSbGHrd2UzIQbiMRotKiTJnYJBkESC4fAe8gjsE,2026
66
+ skilleter_thingy-0.0.44.dist-info/top_level.txt,sha256=8-JhgToBBiWURunmvfpSxEvNkDHQQ7r25-aBXtZv61g,17
67
+ skilleter_thingy-0.0.44.dist-info/RECORD,,