Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Windows Installer script #13269

Merged
merged 21 commits into from
Oct 16, 2020
Merged

PR: Windows Installer script #13269

merged 21 commits into from
Oct 16, 2020

Conversation

dalthviz
Copy link
Member

@dalthviz dalthviz commented Jul 12, 2020

Description of Changes

Add a config file to use pynsist to create Windows installer

Steps to build:

  • Create an env with python 3.6.8 and pynsist (you should use only pip to install packages in this env):

  • Install the packages listed in the installer.cfg file in the env:

    • autopep8
    • diff_match_patch
    • intervaltree
    • numpydoc
    • pandocfilters
    • pathtools
    • pyrsistent
    • rope
    • watchdog
    • wrapt
  • The rest of packages listed are accessible via the pywin32 wheel but needed here to prevent a NoModuleFoundError while starting the console kernel using the default interpreter (the one embedded in the installer):

    • win32api
    • win32security
    • ntsecuritycon
  • Over the root of the repo run pynsist installer.cfg

pynsist env packages and versions

alabaster==0.7.12
autopep8==1.5.3
Babel==2.8.0
certifi==2020.6.20
chardet==3.0.4
colorama==0.4.3
diff-match-patch==20181111
distlib==0.3.1
docutils==0.16
idna==2.10
imagesize==1.2.0
intervaltree==3.0.2
Jinja2==2.11.2
MarkupSafe==1.1.1
numpydoc==1.1.0
packaging==20.4
pandocfilters==1.4.2
pathtools==0.1.2
pip==20.1.1
pycodestyle==2.6.0
Pygments==2.6.1
pynsist==2.5.1
pyparsing==2.4.7
pyrsistent==0.16.0
pytz==2020.1
pywin32==228
pywin32-ctypes==0.2.0
requests==2.24.0
requests-download==0.1.2
rope==0.17.0
setuptools==47.3.1.post20200622
six==1.15.0
snowballstemmer==2.0.0
sortedcontainers==2.2.2
Sphinx==3.1.2
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==1.0.3
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.4
toml==0.10.1
urllib3==1.25.9
watchdog==0.10.3
wheel==0.34.2
wincertstore==0.2
wrapt==1.12.1
yarg==0.1.9

Install preview

image

image

image

image

image

image

Uninstall preview

image

Issue(s) Resolved

Fixes #13145

Affirmation

By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.

I certify the above statement is true and correct: dalthviz

@dalthviz dalthviz requested a review from ccordoba12 July 12, 2020 19:36
@dalthviz dalthviz self-assigned this Jul 12, 2020
@goanpeca
Copy link
Member

That is pretty cool @dalthviz. Maybe it would be good (later on) to a check in here https://github.com/spyder-ide/spyder/blob/master/spyder/tests/test_dependencies_in_sync.py so that the config file remains in sync as well.

@dalthviz
Copy link
Member Author

Note: Mu script to create the config file dynamically and run the build process: https://github.com/mu-editor/mu/blob/master/win_installer.py

@CAM-Gerlach
Copy link
Member

CAM-Gerlach commented Jul 13, 2020

After running Spyder for a while (overnight, just under 24 hours) I Alt-Tabbed to it to notice a bunch of kernel died messages displayed in the Spyder error dialog. It wasn't sleeping that did it since it worked just fine a few hours ago, well after I'd hibernated my machine overnight.

WARNING:traitlets:kernel died: 25.000317811965942
WARNING:traitlets:kernel died: 25.000558853149414
WARNING:traitlets:kernel died: 25.000378608703613
WARNING:traitlets:kernel died: 25.000738620758057
WARNING:traitlets:kernel died: 25.000408411026
WARNING:traitlets:kernel died: 25.000534534454346
WARNING:traitlets:kernel died: 25.00008273124695
WARNING:traitlets:kernel died: 25.00048279762268
WARNING:traitlets:kernel died: 25.000229597091675
WARNING:traitlets:kernel died: 25.000161170959473
WARNING:traitlets:kernel died: 25.00059723854065
WARNING:traitlets:kernel died: 25.000696897506714
WARNING:traitlets:kernel died: 25.000181913375854
WARNING:traitlets:kernel died: 25.000733613967896
WARNING:traitlets:kernel died: 25.00044870376587
WARNING:traitlets:kernel died: 25.000993728637695
WARNING:traitlets:kernel died: 25.001917600631714
WARNING:traitlets:kernel died: 25.000560522079468
WARNING:traitlets:kernel died: 25.00059938430786
WARNING:traitlets:kernel died: 25.000408411026
WARNING:traitlets:kernel died: 25.000707387924194
WARNING:traitlets:kernel died: 25.00164246559143
WARNING:traitlets:kernel died: 25.000696659088135
WARNING:traitlets:kernel died: 25.000885248184204
WARNING:traitlets:kernel died: 25.00081753730774
WARNING:traitlets:kernel died: 25.00010919570923
WARNING:traitlets:kernel died: 25.000953435897827
WARNING:traitlets:kernel died: 25.00110149383545
WARNING:traitlets:kernel died: 25.0007107257843
WARNING:traitlets:kernel died: 25.000843286514282
WARNING:traitlets:kernel died: 25.000173330307007
WARNING:traitlets:kernel died: 25.00023651123047
WARNING:traitlets:kernel died: 25.00019383430481
WARNING:traitlets:kernel died: 25.000600576400757
WARNING:traitlets:kernel died: 25.00117039680481
WARNING:traitlets:kernel died: 25.000552892684937
WARNING:traitlets:kernel died: 25.000967025756836
WARNING:traitlets:kernel died: 25.00054430961609
WARNING:traitlets:kernel died: 25.00081181526184
WARNING:traitlets:kernel died: 25.000672340393066
WARNING:traitlets:kernel died: 25.00098156929016
WARNING:traitlets:kernel died: 25.000234603881836
WARNING:traitlets:kernel died: 25.000261545181274
WARNING:traitlets:kernel died: 25.00013566017151
WARNING:traitlets:kernel died: 25.001861333847046
WARNING:traitlets:kernel died: 25.000725984573364
WARNING:traitlets:kernel died: 25.00050687789917
WARNING:traitlets:kernel died: 25.0009822845459
WARNING:traitlets:kernel died: 25.000676155090332
WARNING:traitlets:kernel died: 25.00008726119995
WARNING:traitlets:kernel died: 25.0003604888916
WARNING:traitlets:kernel died: 25.000072717666626
WARNING:traitlets:kernel died: 25.000608682632446
WARNING:traitlets:kernel died: 25.00062394142151
WARNING:traitlets:kernel died: 25.00038981437683
WARNING:traitlets:kernel died: 25.000670433044434
WARNING:traitlets:kernel died: 25.00079870223999
WARNING:traitlets:kernel died: 25.00016140937805
WARNING:traitlets:kernel died: 25.00027871131897
WARNING:traitlets:kernel died: 25.000457048416138
WARNING:traitlets:kernel died: 25.00019645690918
WARNING:traitlets:kernel died: 25.000744819641113
WARNING:traitlets:kernel died: 25.00090503692627
WARNING:traitlets:kernel died: 25.000311136245728
WARNING:traitlets:kernel died: 25.000154733657837
WARNING:traitlets:kernel died: 25.00049352645874
WARNING:traitlets:kernel died: 25.000920057296753
WARNING:traitlets:kernel died: 25.000486850738525
WARNING:traitlets:kernel died: 25.000757217407227
WARNING:traitlets:kernel died: 25.00036096572876
WARNING:traitlets:kernel died: 25.000699758529663
WARNING:traitlets:kernel died: 25.000062465667725
WARNING:traitlets:kernel died: 25.000980854034424
WARNING:traitlets:kernel died: 25.0001380443573
WARNING:traitlets:kernel died: 25.000208616256714
WARNING:traitlets:kernel died: 25.000223636627197
WARNING:traitlets:kernel died: 25.000954627990723
WARNING:traitlets:kernel died: 25.000035762786865
WARNING:traitlets:kernel died: 25.000953435897827
WARNING:traitlets:kernel died: 25.000855684280396
WARNING:traitlets:kernel died: 25.0000638961792
WARNING:traitlets:kernel died: 25.000029802322388
WARNING:traitlets:kernel died: 25.000022172927856
WARNING:traitlets:kernel died: 25.001601219177246
WARNING:traitlets:kernel died: 25.000206470489502
WARNING:traitlets:kernel died: 25.000497341156006
WARNING:traitlets:kernel died: 25.000311851501465
WARNING:traitlets:kernel died: 25.00100016593933
WARNING:traitlets:kernel died: 25.00032114982605
WARNING:traitlets:kernel died: 25.000164270401
WARNING:traitlets:kernel died: 25.00072407722473
WARNING:traitlets:kernel died: 25.000962257385254
WARNING:traitlets:kernel died: 25.000003576278687
WARNING:traitlets:kernel died: 25.000168085098267
WARNING:traitlets:kernel died: 25.000884771347046
WARNING:traitlets:kernel died: 25.00078272819519
WARNING:traitlets:kernel died: 25.000739336013794
WARNING:traitlets:kernel died: 25.000574588775635
WARNING:traitlets:kernel died: 25.000324726104736
WARNING:traitlets:kernel died: 25.000882148742676
WARNING:traitlets:kernel died: 25.000868558883667
WARNING:traitlets:kernel died: 25.000792741775513
WARNING:traitlets:kernel died: 25.00083899497986
WARNING:traitlets:kernel died: 25.000658750534058
WARNING:traitlets:kernel died: 25.000510215759277
WARNING:traitlets:kernel died: 25.000666856765747
WARNING:traitlets:kernel died: 25.000141620635986
WARNING:traitlets:kernel died: 25.000385999679565
WARNING:traitlets:kernel died: 25.00021767616272
WARNING:traitlets:kernel died: 25.000516891479492
WARNING:traitlets:kernel died: 25.000365495681763
WARNING:traitlets:kernel died: 25.000500440597534
WARNING:traitlets:kernel died: 25.00055956840515
WARNING:traitlets:kernel died: 25.00017213821411
WARNING:traitlets:kernel died: 25.00096368789673
WARNING:traitlets:kernel died: 25.000452756881714
WARNING:traitlets:kernel died: 25.000370740890503
WARNING:traitlets:kernel died: 25.00098967552185
WARNING:traitlets:kernel died: 25.000138521194458
WARNING:traitlets:kernel died: 25.000421047210693
WARNING:traitlets:kernel died: 25.000799894332886
WARNING:traitlets:kernel died: 25.00098180770874
WARNING:traitlets:kernel died: 25.000519037246704
WARNING:traitlets:kernel died: 25.00186252593994
WARNING:traitlets:kernel died: 25.00022840499878
WARNING:traitlets:kernel died: 25.000646352767944
WARNING:traitlets:kernel died: 25.000561952590942
WARNING:traitlets:kernel died: 25.001819610595703
WARNING:traitlets:kernel died: 25.00037145614624
WARNING:traitlets:kernel died: 25.000406742095947
WARNING:traitlets:kernel died: 25.000548601150513
WARNING:traitlets:kernel died: 25.000961303710938
WARNING:traitlets:kernel died: 25.001017570495605
WARNING:traitlets:kernel died: 25.00013756752014
WARNING:traitlets:kernel died: 25.00011157989502
WARNING:traitlets:kernel died: 25.00001335144043
WARNING:traitlets:kernel died: 25.000226259231567
WARNING:traitlets:kernel died: 25.000449419021606
WARNING:traitlets:kernel died: 25.00070309638977
WARNING:traitlets:kernel died: 25.000441074371338
WARNING:traitlets:kernel died: 25.000019073486328
WARNING:traitlets:kernel died: 25.00025963783264
WARNING:traitlets:kernel died: 25.000449657440186
WARNING:traitlets:kernel died: 25.000144004821777
WARNING:traitlets:kernel died: 25.001649856567383
WARNING:traitlets:kernel died: 25.00066065788269
WARNING:traitlets:kernel died: 25.00028395652771
WARNING:traitlets:kernel died: 25.00089716911316
WARNING:traitlets:kernel died: 25.00008797645569
WARNING:traitlets:kernel died: 25.00063967704773
WARNING:traitlets:kernel died: 25.00072455406189
WARNING:traitlets:kernel died: 25.00045347213745
WARNING:traitlets:kernel died: 25.000978469848633
WARNING:traitlets:kernel died: 25.000839471817017
WARNING:traitlets:kernel died: 25.00033450126648
WARNING:traitlets:kernel died: 25.00005054473877
WARNING:traitlets:kernel died: 25.000789880752563
WARNING:traitlets:kernel died: 25.00074291229248
WARNING:traitlets:kernel died: 25.000929832458496
WARNING:traitlets:kernel died: 25.00077748298645
WARNING:traitlets:kernel died: 25.0002338886261
WARNING:traitlets:kernel died: 25.000183582305908
WARNING:traitlets:kernel died: 25.000804901123047
WARNING:traitlets:kernel died: 25.000414848327637
WARNING:traitlets:kernel died: 25.000467538833618
WARNING:traitlets:kernel died: 25.00089693069458
WARNING:traitlets:kernel died: 25.000577688217163
WARNING:traitlets:kernel died: 25.000620126724243
WARNING:traitlets:kernel died: 25.000420570373535
WARNING:traitlets:kernel died: 25.000087022781372
WARNING:traitlets:kernel died: 25.00037956237793
WARNING:traitlets:kernel died: 25.000139474868774
WARNING:traitlets:kernel died: 25.000527143478394
WARNING:traitlets:kernel died: 25.0000901222229
WARNING:traitlets:kernel died: 25.000847101211548
WARNING:traitlets:kernel died: 25.00026249885559
WARNING:traitlets:kernel died: 25.00096559524536
WARNING:traitlets:kernel died: 25.001622676849365
WARNING:traitlets:kernel died: 25.000226497650146
WARNING:traitlets:kernel died: 25.000132083892822
WARNING:traitlets:kernel died: 25.000048637390137
WARNING:traitlets:kernel died: 25.00094723701477
WARNING:traitlets:kernel died: 25.000768899917603
WARNING:traitlets:kernel died: 25.000966548919678
WARNING:traitlets:kernel died: 25.000123739242554
WARNING:traitlets:kernel died: 25.000431299209595
WARNING:traitlets:kernel died: 25.000971794128418
WARNING:traitlets:kernel died: 25.000707149505615
WARNING:traitlets:kernel died: 25.00079107284546
WARNING:traitlets:kernel died: 25.001530408859253
WARNING:traitlets:kernel died: 25.000340700149536
WARNING:traitlets:kernel died: 25.000378131866455
WARNING:traitlets:kernel died: 25.000171422958374
WARNING:traitlets:kernel died: 25.00078058242798
WARNING:traitlets:kernel died: 25.000567197799683
WARNING:traitlets:kernel died: 25.000612020492554
WARNING:traitlets:kernel died: 25.000697135925293
WARNING:traitlets:kernel died: 25.000696659088135
WARNING:traitlets:kernel died: 25.000917673110962
WARNING:traitlets:kernel died: 25.000213623046875
WARNING:traitlets:kernel died: 25.00062322616577
WARNING:traitlets:kernel died: 25.000240325927734
WARNING:traitlets:kernel died: 25.000319004058838
WARNING:traitlets:kernel died: 25.00068950653076
WARNING:traitlets:kernel died: 25.00004291534424
WARNING:traitlets:kernel died: 25.00028920173645
WARNING:traitlets:kernel died: 25.000560522079468
WARNING:traitlets:kernel died: 25.000930070877075
WARNING:traitlets:kernel died: 25.000874757766724
WARNING:traitlets:kernel died: 25.00013780593872
WARNING:traitlets:kernel died: 25.00079584121704
WARNING:traitlets:kernel died: 25.00010585784912
WARNING:traitlets:kernel died: 25.00034761428833
WARNING:traitlets:kernel died: 25.000688076019287
WARNING:traitlets:kernel died: 25.000427961349487
WARNING:traitlets:kernel died: 25.00031876564026
WARNING:traitlets:kernel died: 25.000828504562378
WARNING:traitlets:kernel died: 25.00026822090149
WARNING:traitlets:kernel died: 25.000065326690674
WARNING:traitlets:kernel died: 25.00081753730774
WARNING:traitlets:kernel died: 25.00007653236389
WARNING:traitlets:kernel died: 25.001023769378662
WARNING:traitlets:kernel died: 25.000197172164917
WARNING:traitlets:kernel died: 25.000603675842285
WARNING:traitlets:kernel died: 25.000445127487183
WARNING:traitlets:kernel died: 25.00079345703125
WARNING:traitlets:kernel died: 25.00004553794861
WARNING:traitlets:kernel died: 25.00010395050049
WARNING:traitlets:kernel died: 25.000043630599976
WARNING:traitlets:kernel died: 25.00071430206299
WARNING:traitlets:kernel died: 25.000715494155884
WARNING:traitlets:kernel died: 25.00036382675171
WARNING:traitlets:kernel died: 25.000154972076416
WARNING:traitlets:kernel died: 25.000518321990967
WARNING:traitlets:kernel died: 25.00002932548523
WARNING:traitlets:kernel died: 25.000593662261963
WARNING:traitlets:kernel died: 25.000142097473145
WARNING:traitlets:kernel died: 25.000312566757202
WARNING:traitlets:kernel died: 25.000463008880615
WARNING:traitlets:kernel died: 25.00040555000305
WARNING:traitlets:kernel died: 25.000410079956055
WARNING:traitlets:kernel died: 25.00057864189148
WARNING:traitlets:kernel died: 25.000066995620728
WARNING:traitlets:kernel died: 25.000537157058716
WARNING:traitlets:kernel died: 25.000534057617188
WARNING:traitlets:kernel died: 25.00061559677124
WARNING:traitlets:kernel died: 25.000643491744995
WARNING:traitlets:kernel died: 25.001888751983643
WARNING:traitlets:kernel died: 25.00058937072754
WARNING:traitlets:kernel died: 25.00047516822815
WARNING:traitlets:kernel died: 25.0003399848938
WARNING:traitlets:kernel died: 25.000336408615112
WARNING:traitlets:kernel died: 25.000282049179077
WARNING:traitlets:kernel died: 25.000248193740845
WARNING:traitlets:kernel died: 25.000190496444702
WARNING:traitlets:kernel died: 25.000377655029297
WARNING:traitlets:kernel died: 25.00067710876465
WARNING:traitlets:kernel died: 25.00006628036499
WARNING:traitlets:kernel died: 25.00000500679016
WARNING:traitlets:kernel died: 25.00047993659973
WARNING:traitlets:kernel died: 25.000937938690186
WARNING:traitlets:kernel died: 25.001116275787354
WARNING:traitlets:kernel died: 25.000727653503418
WARNING:traitlets:kernel died: 25.00083565711975
WARNING:traitlets:kernel died: 25.000475883483887
WARNING:traitlets:kernel died: 25.000163793563843
WARNING:traitlets:kernel died: 25.000969409942627
WARNING:traitlets:kernel died: 25.00085997581482
WARNING:traitlets:kernel died: 25.000762701034546
WARNING:traitlets:kernel died: 25.00088596343994
WARNING:traitlets:kernel died: 25.000885248184204
WARNING:traitlets:kernel died: 25.000362873077393
WARNING:traitlets:kernel died: 25.0009822845459
WARNING:traitlets:kernel died: 25.000858783721924
WARNING:traitlets:kernel died: 25.000597953796387
WARNING:traitlets:kernel died: 25.00132155418396
WARNING:traitlets:kernel died: 25.00024914741516
WARNING:traitlets:kernel died: 25.000701665878296
WARNING:traitlets:kernel died: 25.000895977020264
WARNING:traitlets:kernel died: 25.000900268554688
WARNING:traitlets:kernel died: 25.0000319480896
WARNING:traitlets:kernel died: 25.000540494918823
WARNING:traitlets:kernel died: 25.000956058502197
WARNING:traitlets:kernel died: 25.00083065032959
WARNING:traitlets:kernel died: 25.000726461410522
WARNING:traitlets:kernel died: 25.000394582748413
WARNING:traitlets:kernel died: 25.000314235687256
WARNING:traitlets:kernel died: 25.00091791152954
WARNING:traitlets:kernel died: 25.00039529800415
WARNING:traitlets:kernel died: 25.000102043151855
WARNING:traitlets:kernel died: 25.001901149749756
WARNING:traitlets:kernel died: 25.00019145011902
WARNING:traitlets:kernel died: 25.00022315979004
WARNING:traitlets:kernel died: 25.000369787216187
WARNING:traitlets:kernel died: 25.000754594802856
WARNING:traitlets:kernel died: 25.000345945358276
WARNING:traitlets:kernel died: 25.000727653503418
WARNING:traitlets:kernel died: 25.000006675720215
WARNING:traitlets:kernel died: 25.000465154647827

However, there appeared to be no ill effects; the two kernels I had running (in the builtin env, and in my Anaconda 3.6 env) still worked normally. I also had a dead kernel still open with the error message as reported above in @dalthviz 's OP due to using a Python version != the Spyder runtime version, though it wasn't the active one...perhaps that had something to do with it.

@dalthviz
Copy link
Member Author

Note: Check installer creation using conda constructor

@dalthviz
Copy link
Member Author

Note: To use constructor. For menu generation (?)

@dalthviz
Copy link
Member Author

dalthviz commented Aug 4, 2020

Note: Check pyinstaller option

@dalthviz
Copy link
Member Author

dalthviz commented Aug 7, 2020

Update:

  • Constructor: Seems like the installed Spyder can only be launched from Navigator (using the generated shortcuts didn't work for me). Also, is possible to install stuff through Navigator since the Spyder installation show up as a new env, for example install the Anaconda Prompt in the env and then you have access from a command line to the env.

  • Pyinstaller: The generated .exe launches Spyder, however operations that use sys.executable inside Spyder fail as for exampel lauching the kernel or the LSP (since the generated .exe works as the interpreter and entry point to launch spyder). See [Question] How to use the packaged python interpreter within executable pyinstaller/pyinstaller#2490 .
    Also, further steps are needed to create and actual installer from the executable created.

@CAM-Gerlach
Copy link
Member

for exampel lauching the kernel or the LSP

You could potentially work around this by launching the LSP processes using multiprocessing instead of manually doing it with subprocess, and for the kernel you could either use multiprocessing or (as I believe @ccordoba12 has discussed) require users to select an external Python environment instead of the standalone, "private" one Spyder is using.

@ccordoba12
Copy link
Member

ccordoba12 commented Aug 7, 2020

Constructor: Seems like the installed Spyder can only be launched from Navigator (using the generated shortcuts didn't work for me). Also, is possible to install stuff through Navigator since the Spyder installation show up as a new env

Ok, this means that we can't use Constructor for the installer.

however operations that use sys.executable inside Spyder fail as for exampel lauching the kernel or the LSP (since the generated .exe works as the interpreter and entry point to launch spyder

This seems like a quite terrible limitation.

@ccordoba12
Copy link
Member

ccordoba12 commented Aug 7, 2020

You could potentially work around this by launching the LSP processes using multiprocessing instead of manually doing it with subprocess

That's not possible anymore because we switched to use QProcess instead of subprocess in 4.1.4

and for the kernel you could either use multiprocessing

I'm strongly -1 on this one because that would deviate us from the way kernels are handled by the vast majority of (if not all) Jupyter projects. In other words, that would be a terrible maintenance burden because, on top of maintaining of our own kernel, we'd need to maintain our own architecture as well.

or (as I believe @ccordoba12 has discussed) require users to select an external Python environment instead of the standalone, "private" one Spyder is using.

I also disagree with this because the installer wouldn't be usable for scientific computing without another Python installation. So it couldn't be deployed at large in schools or enterprise environments.

@dalthviz
Copy link
Member Author

Note: Try with cx_freeze 6.x

@dalthviz
Copy link
Member Author

Note: Try with py2exe

@dalthviz
Copy link
Member Author

dalthviz commented Sep 10, 2020

Note: Seems like the embedded version of Python 3.7.9 was released on August 17 so checking again I was able to create an installer with Python 3.7.9 (although seems like the restriction of the kernel needing to also use the same Python version persists)

Edit: Using pynsist

@dalthviz
Copy link
Member Author

dalthviz commented Sep 11, 2020

Note: Check Briefcase

Edit: Napari PR where they use Briefcase to create the installers (also show a way to setup Github Actions to attach elements to a release and trigger the build) - napari/napari#1289

Edit2: Available configuration params for Briefcase

@dalthviz
Copy link
Member Author

dalthviz commented Sep 15, 2020

@ccordoba12 checking Briefcase I was able to create the installer and do the installation. However the kernel wasn't able to start do an ModuleNotFoundError for win32api (something similar happened with pynsist but I was able to work around that by adding win32api and other modules in the packages section):

image

Checking a little bit seems like this issue explains some alternatives to tackle the error: beeware/briefcase#381

In terms of the installation something to notice is that the installation is always done in AppLocal (as far as I can tell), there is no uninstall method (you need to manually remove the dir where the installation was done and the shortcut from the main menu). Also I needed to change some things to add the Spyder install dir to be in the sys.path

The branch with the changes to build an installer is here: https://github.com/dalthviz/spyder/tree/briefcase_installer

Also, just in case some branches where I tested other packages:

@ccordoba12
Copy link
Member

Thanks @dalthviz for the update and your hard work on this!

What's your final conclusion? In other words, what installer method do you think we should use on Windows?

@dalthviz
Copy link
Member Author

dalthviz commented Sep 16, 2020

@ccordoba12 I think for now using pynsist is the way to achieve this (actually with the last commit I was able to created an installer that allows you to switch between interpreters without issues as far as I tested). In the future, unifying the installers with Briefcase could be a possibility but that needs some work (maybe we can help the Mu and Briefcase project folks somehow with the implementation changes needed over Briefcase with some of the stuff referenced here for example beeware/briefcase#381

Edit: Although probably another approach for the way to handle the PYTHONPATH is needed now that I see the failing tests.

@dalthviz
Copy link
Member Author

Note: Example GH Action to add assets to the release - https://github.com/napari/napari/pull/1289/files#diff-133717b789402c2a8618aa4f47d79ff2

@pep8speaks
Copy link

pep8speaks commented Oct 2, 2020

Hello @dalthviz! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2020-10-16 19:43:42 UTC

@dalthviz dalthviz force-pushed the installer branch 2 times, most recently from 1e40f0d to 79095f9 Compare October 6, 2020 17:05
@dalthviz
Copy link
Member Author

dalthviz commented Oct 6, 2020

Note: The creation installer workflow uploads an artifact to the workflow execution. As an example: https://github.com/spyder-ide/spyder/suites/1298474294/artifacts/20340090

From the GitHub UI it can be found in the workflow:
image

@ccordoba12 ccordoba12 added this to the v4.2.0 milestone Oct 6, 2020
@ccordoba12
Copy link
Member

Note: The creation installer workflow uploads an artifact to the workflow execution. As an example: https://github.com/spyder-ide/spyder/suites/1298474294/artifacts/20340090

That's pretty cool @dalthviz! Does that mean a new installer will be created per PR too?

@dalthviz
Copy link
Member Author

dalthviz commented Oct 7, 2020

Just in case, as a note: The workflow can be setup to generate the installer per PR or other types of events (for example tag event or release) However, if we end up adding a step that uses the GitHub API (for example uploading the generated artifact to the respective GitHub release) the workflow will only run once per event (for example only when the PR was first opened)

@dalthviz dalthviz changed the title [WIP] PR: Windows Installer script PR: Windows Installer script Oct 9, 2020
@dalthviz
Copy link
Member Author

dalthviz commented Oct 9, 2020

@ccordoba12 I think this is ready for review 👍

@dalthviz dalthviz requested review from ccordoba12 and removed request for ccordoba12 October 14, 2020 15:59
Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @dalthviz for your hard work on this! It is awesome!

spyder/plugins/ipythonconsole/utils/kernelspec.py Outdated Show resolved Hide resolved
spyder/plugins/ipythonconsole/utils/kernelspec.py Outdated Show resolved Hide resolved
spyder/plugins/ipythonconsole/utils/kernelspec.py Outdated Show resolved Hide resolved
NOTICE.txt Outdated Show resolved Hide resolved
installers/win_installer.py Outdated Show resolved Hide resolved
installers/win_installer.py Outdated Show resolved Hide resolved
installers/win_installer.py Outdated Show resolved Hide resolved
installers/win_installer.py Outdated Show resolved Hide resolved
Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @dalthviz! Another fantastic addition for 4.2!

@ccordoba12 ccordoba12 merged commit 24a255d into spyder-ide:4.x Oct 16, 2020
ccordoba12 added a commit that referenced this pull request Oct 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants