Skip to content

Commit 8f3e4e5

Browse files
committed
Merge branch 'master' of github.com:3-manifolds/SnapPy
2 parents 6627ad0 + 30af2ec commit 8f3e4e5

14 files changed

Lines changed: 184 additions & 44 deletions

File tree

.github/workflows/linux.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ jobs:
1111
os: [ubuntu-20.04]
1212

1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v3
1515

16-
- uses: actions/setup-python@v2
16+
- uses: actions/setup-python@v3
1717
name: Install Python
1818
with:
19-
python-version: '3.8'
19+
python-version: '3.9'
2020

2121
- name: Install cibuildwheel
2222
run: |

.github/workflows/macos.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ jobs:
1111
os: [macos-11]
1212

1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v3
1515

16-
- uses: actions/setup-python@v2
16+
- uses: actions/setup-python@v3
1717
name: Install Python
1818
with:
19-
python-version: '3.8'
19+
python-version: '3.9'
2020

2121
- name: Install cibuildwheel
2222
run: |
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: macOS Older Python Wheels
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build_wheels:
7+
name: Build wheels on ${{ matrix.os }}
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
matrix:
11+
os: [macos-11]
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- uses: actions/setup-python@v3
17+
name: Install Python
18+
with:
19+
python-version: '3.9'
20+
21+
- name: Install cibuildwheel
22+
run: |
23+
python -m pip install cibuildwheel
24+
25+
- name: Build wheels
26+
run: |
27+
python -m cibuildwheel --output-dir wheelhouse
28+
env:
29+
# Skip Python 2.7, 3.5, 3.11, 32 bit Linux, and PyPy
30+
CIBW_SKIP: cp27-* cp35-* cp38-* cp39-* cp310-* cp311-* pp*
31+
CIBW_ARCHS_MACOS: x86_64
32+
CIBW_BEFORE_BUILD: >
33+
pip install cython FXrays low_index sphinx sphinx_rtd_theme &&
34+
pip install --pre --extra-index-url https://test.pypi.org/simple cypari &&
35+
pip install git+https://github.com/3-manifolds/PLink &&
36+
pip install git+https://github.com/3-manifolds/snappy_manifolds &&
37+
pip install git+https://github.com/3-manifolds/Spherogram
38+
CIBW_BEFORE_TEST: >
39+
pip install cython low_index &&
40+
pip install --pre --extra-index-url https://test.pypi.org/simple cypari &&
41+
pip install git+https://github.com/3-manifolds/PLink &&
42+
pip install git+https://github.com/3-manifolds/snappy_manifolds &&
43+
pip install git+https://github.com/3-manifolds/Spherogram
44+
CIBW_TEST_COMMAND: python -m snappy.test --skip-modern-opengl
45+
46+
- uses: actions/upload-artifact@v3
47+
with:
48+
name: snappy_macos_older_wheels
49+
path: ./wheelhouse/*.whl

.github/workflows/windows.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ jobs:
1111
os: [windows-latest]
1212

1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v3
1515

16-
- uses: actions/setup-python@v2
16+
- uses: actions/setup-python@v3
1717
name: Install Python
1818
with:
19-
python-version: '3.8'
19+
python-version: '3.9'
2020

2121
- name: Install cibuildwheel
2222
run: |

dev/release_tools/release_steps.rst

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,19 @@ Key tools:
66
1. Wheels for all three platforms are built using cibuildwheel as part
77
of an automatic GitHub action after each commit.
88

9-
2. The sdist tarballs are build by a GitHub action of the
9+
2. The sdist tarballs are built by a GitHub action of the
1010
"snappy_release" project.
1111

12-
3. The Windows app is also build by a GitHub action of
12+
3. The Windows and macOS apps is are built by a GitHub actions of
1313
"snappy_release".
1414

15-
4. Recent macOS apps have been built by Marc directly.
16-
17-
5. The script "test_pypi.py" is a key tool. It creates a virtual
15+
4. The script "test_pypi.py" is a key tool. It creates a virtual
1816
environment for testing a package posted on (test)pypi.python.org.
1917

20-
6. Testing done on virtual machines running in VMWare Fusion on
18+
5. Testing done on virtual machines running in VMWare Fusion on
2119
dehn.math.illinois.edu.
2220

23-
7. Nathan stores current and old versions in "~/Dropbox/pypi/".
21+
6. Nathan stores current and old versions in "~/Dropbox/pypi/".
2422

2523

2624
Warmup

opengl/CyOpenGL.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1357,7 +1357,7 @@ class OpenGLPerspectiveWidget(RawOpenGLWidget):
13571357
"""
13581358
Help message for the widget.
13591359
"""
1360-
InfoWindow(self, 'Viewer Help', self.help_text)
1360+
InfoWindow(self, 'Viewer Help', self.help_text, 'viewer_help')
13611361

13621362
def set_background(self, r, g, b):
13631363
"""

python/app.py

Lines changed: 65 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from .app_menus import add_menu, scut, open_html_docs
1616
from .browser import Browser
1717
from .horoviewer import HoroballViewer
18-
from .infowindow import about_snappy
18+
from .infowindow import about_snappy, InfoWindow
1919
from .polyviewer import PolyhedronViewer
2020
from .raytracing.inside_viewer import InsideViewer
2121
from .settings import Settings, SettingsDialog
@@ -64,12 +64,21 @@ def __init__(self):
6464
def add_bindings(self):
6565
self.window.bind('<<Paste>>', self.edit_paste)
6666

67+
def about_window(self):
68+
window = self.window
69+
if not hasattr(window, 'about_snappy'):
70+
window.about_snappy = about_snappy(window)
71+
else:
72+
window.about_snappy.deiconify()
73+
window.about_snappy.lift()
74+
window.about_snappy.focus_force()
75+
6776
def build_menus(self):
6877
window = self.window
6978
self.menubar = menubar = Tk_.Menu(window)
7079
Python_menu = Tk_.Menu(menubar, name="apple")
7180
Python_menu.add_command(label='About SnapPy...',
72-
command=lambda : about_snappy(window))
81+
command=self.about_window)
7382
if sys.platform == 'darwin':
7483
window.createcommand('::tk::mac::ShowPreferences', self.edit_settings)
7584
# By default, the Quit menu command terminates the Python process.
@@ -225,6 +234,7 @@ def __init__(self, manifold, root=None, main_window=None):
225234
self.settings = terminal.settings
226235
self.menu_title = self.title()
227236
self.register_window(self)
237+
self.dirichlet_viewer.help_button.configure(command=self.dirichlet_help)
228238

229239
def close(self, event=None):
230240
self.unregister_window(self)
@@ -234,6 +244,26 @@ def apply_settings(self):
234244
if self.inside_view:
235245
self.inside_view.apply_settings(self.main_window.settings)
236246

247+
def dirichlet_help(self):
248+
if not hasattr(self, 'polyhedron_help'):
249+
self.polyhedron_help = InfoWindow(self, 'Polyhedron Viewer Help',
250+
self.dirichlet_viewer.widget.help_text,
251+
'polyhedron_help')
252+
else:
253+
self.polyhedron_help.deiconify()
254+
self.polyhedron_help.lift()
255+
self.polyhedron_help.focus_force()
256+
257+
def horoball_help(self):
258+
if not hasattr(self, 'horoviewer_help'):
259+
self.horoviewer_help = InfoWindow(self, 'Horoball Viewer Help',
260+
self.horoball_viewer.widget.help_text,
261+
'horoviewer_help')
262+
else:
263+
self.horoviewer_help.deiconify()
264+
self.horoviewer_help.lift()
265+
self.horoviewer_help.focus_force()
266+
237267

238268
class SnapPyLinkEditor(LinkEditor, ListedWindow):
239269
def __init__(self, root=None, no_arcs=False, callback=None, cb_menu='',
@@ -322,16 +352,44 @@ class SnapPyPolyhedronViewer(PolyhedronViewer):
322352

323353
build_menus = dirichlet_menus
324354

325-
326-
class SnapPyInsideViewer(InsideViewer):
327-
328-
build_menus = inside_view_menus
355+
def __init__(self, *args, **kwargs):
356+
PolyhedronViewer.__init__(self, *args, **kwargs, main_window=terminal)
357+
self.help_button.configure(command=self.help_window)
358+
359+
def help_window(self):
360+
window = self.parent
361+
if not hasattr(window, 'polyhedron_help'):
362+
window.polyhedron_help = InfoWindow(window, 'Polyhedron Viewer Help',
363+
self.widget.help_text, 'polyhedron_help')
364+
else:
365+
window.polyhedron_help.deiconify()
366+
window.polyhedron_help.lift()
367+
window.polyhedron_help.focus_force()
329368

330369

331370
class SnapPyHoroballViewer(HoroballViewer):
332371

333372
build_menus = horoball_menus
334373

374+
def __init__(self, *args, **kwargs):
375+
HoroballViewer.__init__(self, *args, **kwargs, main_window=terminal)
376+
self.main_window = terminal
377+
378+
def help_window(self):
379+
window = self.parent
380+
if not hasattr(window, 'horoball_help'):
381+
window.horoball_help = InfoWindow(window, 'Horoball Viewer Help',
382+
self.widget.help_text, 'horoball_help')
383+
else:
384+
window.horoball_help.deiconify()
385+
window.horoball_help.lift()
386+
window.horoball_help.focus_force()
387+
388+
389+
class SnapPyInsideViewer(InsideViewer):
390+
391+
build_menus = inside_view_menus
392+
335393

336394
class SnapPySettings(Settings, ListedWindow):
337395
def __init__(self, terminal):
@@ -480,6 +538,7 @@ def main():
480538
LP.PolyhedronViewer = HP.PolyhedronViewer = SnapPyPolyhedronViewer
481539
LP.HoroballViewer = HP.HoroballViewer = SnapPyHoroballViewer
482540
snappy.ViewerWindow = SnapPyViewerWindow
541+
snappy.ViewerWindow.main_window = terminal
483542
snappy.InsideViewer = SnapPyInsideViewer
484543
snappy.InsideViewer.main_window = terminal
485544
LP.Browser = HP.Browser = SnapPyBrowser

python/app_menus.py

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,11 @@ def browser_menus(self):
236236
Creates a menubar attribute for the browser.
237237
"""
238238
self.menubar = menubar = Tk_.Menu(self)
239+
if sys.platform == 'darwin' and self.main_window is not None:
240+
Python_menu = Tk_.Menu(menubar, name='apple')
241+
Python_menu.add_command(label='About SnapPy...',
242+
command=self.main_window.about_window)
243+
menubar.add_cascade(label='SnapPy', menu=Python_menu)
239244
File_menu = Tk_.Menu(menubar, name='file')
240245
add_menu(self, File_menu, 'Open...', None, 'disabled')
241246
add_menu(self, File_menu, 'Save as...', self.save)
@@ -247,20 +252,21 @@ def browser_menus(self):
247252
menubar.add_cascade(label='View', menu=Tk_.Menu(menubar, name='view'))
248253
menubar.add_cascade(label='Window', menu=WindowMenu(menubar))
249254
help_menu = HelpMenu(menubar)
250-
251-
def dirichlet_help():
252-
InfoWindow(self, 'Viewer Help', self.dirichlet_viewer.widget.help_text)
253-
help_menu.extra_command(label=help_polyhedron_viewer_label, command=dirichlet_help)
254-
255-
def horoball_help():
256-
InfoWindow(self, 'Viewer Help', self.horoball_viewer.widget.help_text)
257-
help_menu.extra_command(label=help_horoball_viewer_label, command=horoball_help)
255+
help_menu.extra_command(label=help_polyhedron_viewer_label,
256+
command=self.dirichlet_help)
257+
help_menu.extra_command(label=help_horoball_viewer_label,
258+
command=self.horoball_help)
258259
menubar.add_cascade(label='Help', menu=help_menu)
259260

260261

261262
def plink_menus(self):
262263
"""Menus for the SnapPyLinkEditor."""
263264
self.menubar = menubar = Tk_.Menu(self.window)
265+
if sys.platform == 'darwin':
266+
Python_menu = Tk_.Menu(menubar, name='apple')
267+
Python_menu.add_command(label='About SnapPy...',
268+
command=self.main_window.about_window)
269+
menubar.add_cascade(label='SnapPy', menu=Python_menu)
264270
File_menu = Tk_.Menu(menubar, name='file')
265271
add_menu(self.window, File_menu, 'Open...', self.load)
266272
add_menu(self.window, File_menu, 'Save as...', self.save)
@@ -293,6 +299,11 @@ def dirichlet_menus(self):
293299
parent Toplevel.
294300
"""
295301
self.menubar = menubar = Tk_.Menu(self.parent)
302+
if sys.platform == 'darwin':
303+
Python_menu = Tk_.Menu(menubar, name='apple')
304+
Python_menu.add_command(label='About SnapPy...',
305+
command=self.main_window.about_window)
306+
menubar.add_cascade(label='SnapPy', menu=Python_menu)
296307
File_menu = Tk_.Menu(menubar, name='file')
297308
add_menu(self.master, File_menu, 'Open...', None, 'disabled')
298309
add_menu(self.master, File_menu, 'Save as...', None, 'disabled')
@@ -307,7 +318,7 @@ def dirichlet_menus(self):
307318
menubar.add_cascade(label='Edit ', menu=EditMenu(menubar, self.master.edit_actions))
308319
menubar.add_cascade(label='Window', menu=WindowMenu(menubar))
309320
help_menu = HelpMenu(menubar)
310-
help_menu.extra_command(label=help_polyhedron_viewer_label, command=self.widget.help)
321+
help_menu.extra_command(label=help_polyhedron_viewer_label, command=self.help_window)
311322
help_menu.activate([help_polyhedron_viewer_label, help_report_bugs_label])
312323
self.menubar.add_cascade(label='Help', menu=help_menu)
313324

@@ -318,6 +329,11 @@ def horoball_menus(self):
318329
master Toplevel.
319330
"""
320331
self.menubar = menubar = Tk_.Menu(self.master)
332+
if sys.platform == 'darwin':
333+
Python_menu = Tk_.Menu(menubar, name='apple')
334+
Python_menu.add_command(label='About SnapPy...',
335+
command=self.main_window.about_window)
336+
menubar.add_cascade(label='SnapPy', menu=Python_menu)
321337
File_menu = Tk_.Menu(menubar, name='file')
322338
add_menu(self.master, File_menu, 'Open...', None, 'disabled')
323339
add_menu(self.master, File_menu, 'Save as...', None, 'disabled')
@@ -328,7 +344,7 @@ def horoball_menus(self):
328344
menubar.add_cascade(label='Edit ', menu=EditMenu(menubar, self.master.edit_actions))
329345
menubar.add_cascade(label='Window', menu=WindowMenu(menubar))
330346
help_menu = HelpMenu(menubar)
331-
help_menu.extra_command(label=help_horoball_viewer_label, command=self.widget.help)
347+
help_menu.extra_command(label=help_horoball_viewer_label, command=self.help_window)
332348
help_menu.activate([help_horoball_viewer_label, help_report_bugs_label])
333349
self.menubar.add_cascade(label='Help', menu=help_menu)
334350

@@ -337,6 +353,11 @@ def inside_view_menus(self):
337353
"""Menus for the standalone Inside viewer. Called by the view Frame, not the
338354
master Toplevel."""
339355
self.menubar = menubar = Tk_.Menu(self.master)
356+
if sys.platform == 'darwin':
357+
Python_menu = Tk_.Menu(menubar, name='apple')
358+
Python_menu.add_command(label='About SnapPy...',
359+
command=self.main_window.about_window)
360+
menubar.add_cascade(label='SnapPy', menu=Python_menu)
340361
File_menu = Tk_.Menu(menubar, name='file')
341362
add_menu(self.master, File_menu, 'Open...', None, 'disabled')
342363
add_menu(self.master, File_menu, 'Save as...', None, 'disabled')

python/browser.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ class Browser(Tk_.Toplevel):
159159
a notebook with tabs that show numerical or graphical information
160160
about the manifold.
161161
"""
162-
163162
def __init__(self, manifold, root=None, main_window=None):
164163
if root is None:
165164
if Tk_._default_root:
@@ -747,6 +746,12 @@ def edit_copy(self):
747746
except:
748747
pass
749748

749+
def dirichlet_help(self):
750+
self.dirichlet_viewer.widget.help()
751+
752+
def horoball_help(self):
753+
self.horoball_viewer.widget.help()
754+
750755
def test(self):
751756
self.update_idletasks()
752757
print('Testing browser')

0 commit comments

Comments
 (0)