Newbie starting to work with packages. I can create and load a package. However, when I come to update my package, I find the procedure very laborious. This is what I'm currently doing;
- Update package in Mathematica front end and save.
- Delete the current version at $UserBaseDirectory/Applications. (If I omit this step, the old version will not be overwritten by the new version despite the steps below.)
File/Install Package and point to updated source file.
Needs["MyPackage`"]
Is there a simpler/more correct way of doing this as this seems very tedious, error-prone and frankly, incorrect? (The Update button in the front end doesn't seem to do anything other than update the list of functions)
Thanks in advance.
$Path
during development, and forget about$UserBaseDirectory/Applications
. $\endgroup$ – Leonid Shifrin Dec 5 '19 at 22:00$Path
modification didn't point to your package directory (FindFile
gives a quick test to confirm). The "standard" way to packages uses WolframWorkbench (WW) that handles all the path manipulations automatically in testing and then as part of its "build" ports the package to the Applications folder. Installing WW at this point may be overkill though and at any rate, many developers prefer their own workflow; also, I believe there is some native package support on the way. Perhaps in the interim ... $\endgroup$ – Ronald Monson Dec 7 '19 at 11:34$Path
should be pretty straightforward and you could then write a script to port/copy into the Applications folder when "building". $\endgroup$ – Ronald Monson Dec 7 '19 at 11:35Initialize
,InitializationValue
and friends for this purpose.On WW, If familiar with similar IDE's, IMO, it can be quickly useful (and even occasionally otherwise) but coming in cold, there are also (more?) advantages to building workflows in the front-end by harnessing its unique features. $\endgroup$ – Ronald Monson Dec 8 '19 at 0:20