pingwizard 1.1.2__tar.gz → 1.1.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. {pingwizard-1.1.2 → pingwizard-1.1.4}/PKG-INFO +1 -1
  2. {pingwizard-1.1.2 → pingwizard-1.1.4}/pingwizard/gui_wizard.py +8 -13
  3. pingwizard-1.1.4/pingwizard/version.py +1 -0
  4. {pingwizard-1.1.2 → pingwizard-1.1.4}/pingwizard.egg-info/PKG-INFO +1 -1
  5. {pingwizard-1.1.2 → pingwizard-1.1.4}/tests/test_create_shortcut.py +3 -3
  6. {pingwizard-1.1.2 → pingwizard-1.1.4}/tests/test_gui_wizard.py +19 -16
  7. pingwizard-1.1.2/pingwizard/version.py +0 -1
  8. {pingwizard-1.1.2 → pingwizard-1.1.4}/LICENSE +0 -0
  9. {pingwizard-1.1.2 → pingwizard-1.1.4}/README.md +0 -0
  10. {pingwizard-1.1.2 → pingwizard-1.1.4}/pingwizard/__init__.py +0 -0
  11. {pingwizard-1.1.2 → pingwizard-1.1.4}/pingwizard/__main__.py +0 -0
  12. {pingwizard-1.1.2 → pingwizard-1.1.4}/pingwizard/assets/PINGMapper_Logo_small.png +0 -0
  13. {pingwizard-1.1.2 → pingwizard-1.1.4}/pingwizard/assets/PINGWizard_Logo.png +0 -0
  14. {pingwizard-1.1.2 → pingwizard-1.1.4}/pingwizard/assets/RockMapper_Logo.png +0 -0
  15. {pingwizard-1.1.2 → pingwizard-1.1.4}/pingwizard/check_available_updates.py +0 -0
  16. {pingwizard-1.1.2 → pingwizard-1.1.4}/pingwizard/create_shortcut.py +0 -0
  17. {pingwizard-1.1.2 → pingwizard-1.1.4}/pingwizard/environments.py +0 -0
  18. {pingwizard-1.1.2 → pingwizard-1.1.4}/pingwizard.egg-info/SOURCES.txt +0 -0
  19. {pingwizard-1.1.2 → pingwizard-1.1.4}/pingwizard.egg-info/dependency_links.txt +0 -0
  20. {pingwizard-1.1.2 → pingwizard-1.1.4}/pingwizard.egg-info/requires.txt +0 -0
  21. {pingwizard-1.1.2 → pingwizard-1.1.4}/pingwizard.egg-info/top_level.txt +0 -0
  22. {pingwizard-1.1.2 → pingwizard-1.1.4}/setup.cfg +0 -0
  23. {pingwizard-1.1.2 → pingwizard-1.1.4}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pingwizard
3
- Version: 1.1.2
3
+ Version: 1.1.4
4
4
  Summary: Light-weight interface for running PING ecosystem (PINGMapper, etc.)
5
5
  Author: Cameron Bodine
6
6
  Author-email: bodine.cs@gmail.email
@@ -157,9 +157,9 @@ def wizard():
157
157
  rm_gui_text = sg.Text("Map\nSubstrate", font=("Helvetica", 10, "bold"), size=(11, 2))
158
158
  rm_gui_btn = sg.Button("RockMapper", key="launch_rockmapper_gui",
159
159
  button_color="green", size=(10, 2), disabled=rmversion is None)
160
- rm_install_btn = sg.Button("Install", key="install_rockmapper",
161
- button_color="darkorange", size=(10, 2),
162
- disabled=rm_standard_installed)
160
+ rm_install_btn = sg.Button("Update" if rm_standard_installed else "Install",
161
+ key="install_rockmapper",
162
+ button_color="darkorange", size=(10, 2))
163
163
 
164
164
  gv_desc = sg.Text(
165
165
  "GhostVision ({}) - Detect and map derelict crab pots from side-scan sonar."
@@ -169,9 +169,9 @@ def wizard():
169
169
  button_color="green", size=(12, 2), disabled=gvversion is None)
170
170
  gv_download_btn = sg.Button("Download\nModel", key="ghostvision_download",
171
171
  size=(12, 2), disabled=gvversion is None)
172
- gv_install_btn = sg.Button("Install CPU", key="install_ghostvision",
173
- button_color="darkorange", size=(12, 2),
174
- disabled=gvversion is not None)
172
+ gv_install_btn = sg.Button("Update CPU" if gvversion is not None else "Install CPU",
173
+ key="install_ghostvision",
174
+ button_color="darkorange", size=(12, 2))
175
175
 
176
176
 
177
177
  #############
@@ -198,7 +198,8 @@ def wizard():
198
198
  else sg.Text("PW", font=("Helvetica", 48, "bold"), justification="center"))
199
199
  splash = [
200
200
  [sg.Push(), splash_logo, sg.Push()],
201
- [sg.Push(), sg.Text("PINGWizard: The Gateway to the", font=("Helvetica", 14)),
201
+ [sg.Push(), sg.Text("" \
202
+ "The Gateway to the", font=("Helvetica", 14)),
202
203
  sg.Text("PING Ecosystem", font=("Helvetica", 14, "underline"),
203
204
  text_color="blue", enable_events=True, key="-ECOSYSTEM_LINK-",
204
205
  tooltip=ecosystem_url),
@@ -346,15 +347,9 @@ def wizard():
346
347
  if event == "launch_rockmapper_gui" and rmversion is None:
347
348
  sg.popup_error("RockMapper was not found in a supported Conda environment.")
348
349
  continue
349
- if event == "install_rockmapper" and rm_standard_installed:
350
- sg.popup_error("RockMapper is already installed in a standard environment.")
351
- continue
352
350
  if event in ("launch_ghostvision_gui", "ghostvision_download") and gvversion is None:
353
351
  sg.popup_error("GhostVision was not found in a supported Conda environment.")
354
352
  continue
355
- if event == "install_ghostvision" and gvversion is not None:
356
- sg.popup_error("GhostVision is already installed in the ghostvision environment.")
357
- continue
358
353
 
359
354
  # Launch PINGMapper GUI
360
355
  if event == "launch_pingmapper_gui":
@@ -0,0 +1 @@
1
+ __version__ = '1.1.4'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pingwizard
3
- Version: 1.1.2
3
+ Version: 1.1.4
4
4
  Summary: Light-weight interface for running PING ecosystem (PINGMapper, etc.)
5
5
  Author: Cameron Bodine
6
6
  Author-email: bodine.cs@gmail.email
@@ -7,10 +7,10 @@ from pingwizard import create_shortcut
7
7
 
8
8
 
9
9
  class ShortcutTest(unittest.TestCase):
10
- def test_shortcut_targets_active_wizard_environment(self):
10
+ def test_shortcut_targets_pingwizard_environment(self):
11
11
  with tempfile.TemporaryDirectory() as directory:
12
12
  path = os.path.join(directory, 'PINGWizard.bat')
13
- with mock.patch.dict(os.environ, {'CONDA_PREFIX': r'Z:\conda\envs\pingwizard',
13
+ with mock.patch.dict(os.environ, {'CONDA_PREFIX': r'Z:\conda\envs\ping',
14
14
  'CONDA_EXE': 'conda'}), \
15
15
  mock.patch.object(create_shortcut.subprocess, 'run') as run, \
16
16
  mock.patch.object(create_shortcut, 'get_shortcut_location', return_value=directory), \
@@ -19,7 +19,7 @@ class ShortcutTest(unittest.TestCase):
19
19
  create_shortcut.create_shortcut()
20
20
  with open(path, encoding='utf-8') as file:
21
21
  content = file.read()
22
- self.assertIn('set "conda_env=Z:\\conda\\envs\\pingwizard"', content)
22
+ self.assertIn('set "conda_env=pingwizard"', content)
23
23
  self.assertIn('call "%conda_base%\\Scripts\\activate" "%conda_env%"', content)
24
24
  self.assertIn('if errorlevel 1', content)
25
25
 
@@ -109,7 +109,7 @@ class WizardTest(unittest.TestCase):
109
109
  self.assertEqual(buttons['test'], pm_disabled)
110
110
  self.assertFalse(buttons['pinginstaller'])
111
111
  self.assertEqual(buttons['launch_rockmapper_gui'], rm_disabled)
112
- self.assertEqual(buttons['install_rockmapper'], not rm_disabled)
112
+ self.assertFalse(buttons['install_rockmapper'])
113
113
  self.assertNotIn('install_rockmapper_gpu', buttons)
114
114
  if module:
115
115
  self.assertEqual(calls[0].args[0], [
@@ -171,15 +171,15 @@ class WizardTest(unittest.TestCase):
171
171
  else:
172
172
  start.assert_not_called()
173
173
  self.assertIn('--prune', sg.popup_yes_no.call_args.args[0])
174
- def test_rockmapper_install_availability(self):
174
+ def test_rockmapper_install_button_label(self):
175
175
  cases = (
176
- ([], False),
177
- ([('rockmapper_torch', '1')], True),
178
- ([('rockmapper', '1')], True),
179
- ([('rockmapper_torch_gpu', '2')], False),
180
- ([('rockmapper_torch', '1'), ('rockmapper_torch_gpu', '2')], True),
176
+ ([], 'Install'),
177
+ ([('rockmapper_torch', '1')], 'Update'),
178
+ ([('rockmapper', '1')], 'Update'),
179
+ ([('rockmapper_torch_gpu', '2')], 'Install'),
180
+ ([('rockmapper_torch', '1'), ('rockmapper_torch_gpu', '2')], 'Update'),
181
181
  )
182
- for variants, install_disabled in cases:
182
+ for variants, label in cases:
183
183
  with self.subTest(variants=variants):
184
184
  envs = {'pingmapper': [], 'ghostvision': [], 'rockmapper': [
185
185
  (r'Z:\conda\envs\{}'.format(name), version) for name, version in variants]}
@@ -189,10 +189,10 @@ class WizardTest(unittest.TestCase):
189
189
  sg.WIN_CLOSED = None
190
190
  sg.Window.return_value.read.return_value = ('exit_pingwizard', {})
191
191
  gui_wizard.wizard()
192
- buttons = {call.kwargs['key']: call.kwargs.get('disabled', False)
193
- for call in sg.Button.call_args_list}
194
- self.assertEqual(buttons['install_rockmapper'], install_disabled)
195
- self.assertNotIn('install_rockmapper_gpu', buttons)
192
+ button = next(call for call in sg.Button.call_args_list
193
+ if call.kwargs['key'] == 'install_rockmapper')
194
+ self.assertEqual(button.args[0], label)
195
+ self.assertFalse(button.kwargs.get('disabled', False))
196
196
 
197
197
  def test_installer_start_failure_is_reported(self):
198
198
  with mock.patch.object(gui_wizard, 'discover',
@@ -214,7 +214,7 @@ class WizardTest(unittest.TestCase):
214
214
  with self.subTest(event=event):
215
215
  buttons, calls, errors, envs = self.run_wizard({'ghostvision': '2'}, event)
216
216
  self.assertFalse(buttons[event])
217
- self.assertTrue(buttons['install_ghostvision'])
217
+ self.assertFalse(buttons['install_ghostvision'])
218
218
  self.assertEqual(calls[0].args[0], [
219
219
  'conda', 'run', '--no-capture-output', '--prefix',
220
220
  envs['ghostvision'][0][0], 'python', '-m', 'ghostvision', *args])
@@ -247,7 +247,7 @@ class WizardTest(unittest.TestCase):
247
247
  self.assertEqual(panels['panel_gv'].update.call_args_list,
248
248
  [mock.call(visible=True), mock.call(visible=False)])
249
249
 
250
- def test_ghostvision_install_refuses_existing_installation(self):
250
+ def test_ghostvision_install_button_updates_existing_installation(self):
251
251
  envs = {'pingmapper': [], 'rockmapper': [],
252
252
  'ghostvision': [(r'Z:\conda\envs\ghostvision', '2')]}
253
253
  with mock.patch.object(gui_wizard, 'discover',
@@ -255,11 +255,14 @@ class WizardTest(unittest.TestCase):
255
255
  mock.patch.object(gui_wizard, 'sg') as sg, \
256
256
  mock.patch.object(gui_wizard, '_start_installer') as start:
257
257
  sg.WIN_CLOSED = None
258
+ sg.popup_yes_no.return_value = 'Yes'
258
259
  sg.Window.return_value.read.side_effect = [
259
260
  ('install_ghostvision', {}), ('exit_pingwizard', {})]
260
261
  gui_wizard.wizard()
261
- start.assert_not_called()
262
- self.assertIn('already installed', sg.popup_error.call_args.args[0])
262
+ start.assert_called_once_with('conda', r'Z:\conda', 'ghostvision')
263
+ button = next(call for call in sg.Button.call_args_list
264
+ if call.kwargs['key'] == 'install_ghostvision')
265
+ self.assertEqual(button.args[0], 'Update CPU')
263
266
 
264
267
 
265
268
  class InstallerLaunchTest(unittest.TestCase):
@@ -1 +0,0 @@
1
- __version__ = '1.1.2'
File without changes
File without changes
File without changes
File without changes