ppqs 2.0.0__tar.gz → 2.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ppqs
3
- Version: 2.0.0
3
+ Version: 2.0.2
4
4
  Summary: Python project quick scripts
5
5
  Author-email: Karl Wette <karl.wette@anu.edu.au>
6
6
  License-Expression: MIT
@@ -135,8 +135,8 @@ where:
135
135
  --help`. Default is `Run {name} script` where `name` is the script name.
136
136
 
137
137
  * `print-header` *(optional)*: If true, print a header before running each
138
- command in the script. The header consists of the command to be run, centred
139
- on the console and padded with `*`s. Default is false.
138
+ command in the script. The header consists of the script name and the command
139
+ to be run, centred on the console and padded with `*`s. Default is false.
140
140
 
141
141
  The default value of some options may be overridden in the
142
142
  `[tool.ppqs.defaults]` section, e.g.
@@ -119,8 +119,8 @@ where:
119
119
  --help`. Default is `Run {name} script` where `name` is the script name.
120
120
 
121
121
  * `print-header` *(optional)*: If true, print a header before running each
122
- command in the script. The header consists of the command to be run, centred
123
- on the console and padded with `*`s. Default is false.
122
+ command in the script. The header consists of the script name and the command
123
+ to be run, centred on the console and padded with `*`s. Default is false.
124
124
 
125
125
  The default value of some options may be overridden in the
126
126
  `[tool.ppqs.defaults]` section, e.g.
@@ -1,10 +1,10 @@
1
1
  [build-system]
2
- requires = ["setuptools"]
2
+ requires = ["setuptools>=64.0"]
3
3
  build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ppqs"
7
- version = "2.0.0"
7
+ version = "2.0.2"
8
8
  description = "Python project quick scripts"
9
9
  authors = [
10
10
  { name = "Karl Wette", email = "karl.wette@anu.edu.au" },
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ppqs
3
- Version: 2.0.0
3
+ Version: 2.0.2
4
4
  Summary: Python project quick scripts
5
5
  Author-email: Karl Wette <karl.wette@anu.edu.au>
6
6
  License-Expression: MIT
@@ -135,8 +135,8 @@ where:
135
135
  --help`. Default is `Run {name} script` where `name` is the script name.
136
136
 
137
137
  * `print-header` *(optional)*: If true, print a header before running each
138
- command in the script. The header consists of the command to be run, centred
139
- on the console and padded with `*`s. Default is false.
138
+ command in the script. The header consists of the script name and the command
139
+ to be run, centred on the console and padded with `*`s. Default is false.
140
140
 
141
141
  The default value of some options may be overridden in the
142
142
  `[tool.ppqs.defaults]` section, e.g.
@@ -12,7 +12,7 @@ else: # pragma: no cover
12
12
  import tomli as tomllib
13
13
 
14
14
  __author__ = "Karl Wette"
15
- __version__ = "2.0.0"
15
+ __version__ = "2.0.2"
16
16
 
17
17
 
18
18
  class MissingPyProjectError(Exception):
@@ -202,7 +202,7 @@ def print_help(project_name, scripts):
202
202
  )
203
203
 
204
204
 
205
- def run_script(script, argv, cwd):
205
+ def run_script(script_name, script, argv, cwd):
206
206
  """
207
207
  Run a script.
208
208
  """
@@ -210,17 +210,19 @@ def run_script(script, argv, cwd):
210
210
  for command in script["commands"]:
211
211
  cmd = []
212
212
 
213
- # Replace "..." in command with arguments
214
213
  for arg in command:
215
214
  if arg == "...":
215
+
216
+ # Replace "..." in command with arguments
216
217
  cmd.extend(argv)
218
+
217
219
  else:
218
220
  cmd.append(arg)
219
221
 
220
222
  # Print header
221
223
  if script["print-header"]:
222
224
  cmd_str = " ".join(cmd)
223
- print(f" ppqs: {cmd_str} ".center(col_width, "*"))
225
+ print(f" ppqs {script_name}: {cmd_str} ".center(col_width, "*"), flush=True)
224
226
 
225
227
  # Run command
226
228
  retn = subprocess.run(cmd, stdin=subprocess.DEVNULL, shell=False, cwd=cwd)
@@ -246,7 +248,7 @@ def regular_cli(argv):
246
248
  raise InvalidScriptError(pyproject_path, msg)
247
249
  else:
248
250
  cwd = pyproject_path.parent
249
- run_script(scripts[argv[0]], argv[1:], cwd)
251
+ run_script(argv[0], scripts[argv[0]], argv[1:], cwd)
250
252
 
251
253
 
252
254
  def cli(*argv):
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes