chocolatey-community / chocolatey-package-requests

Please submit your package requests as issues here
Apache License 2.0
96 stars 18 forks source link

RFM - pycharm-community #199

Closed szaiser closed 5 years ago

szaiser commented 7 years ago

Pycharm (Community) is a lightweight IDE for Python & Scientific development .

https://chocolatey.org/packages/PyCharm-community

I am searching for a new maintainer. SHA-256 checksums and direct links to each version are provided on the download page, time requested for maintaining this package is minimal.

pintman commented 7 years ago

Could you explain briefly or give a link to a resource on what has to be done to maintain this package?

pauby commented 7 years ago

@pintman I'd start here - if you are genuinely interested and this is your first package then I'm happy to help you along. Drop me a message.

klondikemarlen commented 6 years ago

I am interested. I am also way out of my depth :P. Do you have an example of an older ".nuspec" file for the package? So I can try and learn by example? Or a minimum use case example? Of this or another package? With an example .ps1 file as well if possible.

Disclaimer: This is my first package.

Since I use PyCharm Community and am getting tired of the update popup (from PyCharm itself) I decide I would like to take a stab at actually fixing the problem. :)

Edit: I found the .ps1 file examples. I can probably work with those. Now I am just looking for a version of the older ".nuspec" so I can make sure to keep the same formatting for everything.

dragon788 commented 6 years ago

Most packages have their source code listed in the left menu on the package page.

klondikemarlen commented 6 years ago

Thanks :) I found it.

klondikemarlen commented 6 years ago

Ok. I have a possibly working package (https://github.com/klondikemarlen/Chocolatey-Packages/tree/master/PyCharm-community). I am now waiting for the testing environment (https://github.com/chocolatey/chocolatey-test-environment) to download (I have really slow internet).

klondikemarlen commented 6 years ago

If anyone has a good bot tutorial I would love to read it. The difference between version seems very small. So it should be easy to update automatically for each edition as it comes out.

Edit: I found it. Wow. It is like an endless rabbit hole of automation :p https://chocolatey.org/docs/automatic-packages

klondikemarlen commented 6 years ago

I can't get the testing environment up. I keep getting image

Does anyone know if there is a bug tracker for the test suite? Since it says not to post issues on the main github. I tried reinstalling VirtualBox (am using vagrant 1.9.8, virtualbox 4.3.40) and Vagrant (I downgraded from vagrant 2.0.1 version). I even re-downloaded the Vagrant box thing that takes forever incase it was corrupted. I am running as Admin using powershell.

dragon788 commented 6 years ago

I'd recommend giving AppVeyor a try. I'll see if I can find the gist I had that provides a universal Chocolatey build script. The chocolatey-test-environment has its own GitHub repo under the chocolatey organization.

daLuiz commented 6 years ago

Someone on the PyCharm gallery page offered to work on this as well, he offered his source code for phpstorm, which is by the same publisher and should be quite similar. Maybe you can work together and / or use his code?

AdmiringWorm commented 6 years ago

@klondikemarlen I've not had any issue like that with using the test environment (and using the latest virtualbox and vagrant as well).

The error message mentions a log file, could be useful to look through that to see if it contains any more information.

pauby commented 6 years ago

The test environment is little more than a standard 2012 R2 server with Chocolatey installed.

If you're having a problems and need it sorted quickly just build a server yourself but it woudl be better, long term, to fix the Vagrant issues as it's a bit neater.

klondikemarlen commented 6 years ago

I updated everything to the latest version (despite what it said in https://github.com/chocolatey/chocolatey-test-environment#setup) and now vagrant up works (except that my memory is apparently too low).

@daLuiz I did see the phpstom guy's message and took a look at his code. It is too advanced for me at this stage. I am just trying to get the most basic version working. Then hopefully the knowledge will settle in an and I will be able to work out how to automate everything.

@dragon788 I did see that AppVeyor would help with automation. I'll check it out again when I have a basic manual update working.

@AdmiringWorm I will make sure to post the log next time (now that everything is working it has deleted the old log). It might have been a security update with Windows 10 (from my googling of the issue). The recommendation was to update VirtualBox.

Thanks for all the help and advice. I am very new at all this and it is sort of like trying to read an instruction manual written in Italian when I only learned some French in high school :P. I'm having fun though. :)

AdmiringWorm commented 6 years ago

@klondikemarlen when you're ready to become the maintainer of this package, please send out a message on the package page (using the Contact Site Admins) that you want to be added (make sure to also mention this issue).. Then we can get you added as the official maintainer of the package.

klondikemarlen commented 6 years ago

Roger that.

klondikemarlen commented 6 years ago

I am trying to interpret the requirement for this package. They are explained here https://www.jetbrains.com/help/pycharm/2016.1/requirements-for-pycharm.html.

However ... I don't really understand. Is JRE include? So this package has no dependencies? Or is it included but useless for development so I need it as a dependency?

Also I finally got the testing environment up and running. My /packages folder wasn't sharing the first few times. But I rebuilt it until it worked (and dropped the RAM to 3072 from 4096 as it was overloading my system).

klondikemarlen commented 6 years ago

I am have a working basic install ... now I am testing:

klondikemarlen commented 6 years ago

About the dependencies I believe python should probably be include (Python 2.4 or higher, Jython, PyPy or IronPython) see image

klondikemarlen commented 6 years ago

I couldn't get it to work so I reread though everything and made a new version (https://github.com/klondikemarlen/Chocolatey-Packages/commit/0ec93914488215e993e94f076d788e9b25747b90). Hopefully it will work better this time.

I still have a couple questions though: Does anyone know how to specify: <dependency id="python2 or python3? but only one is required?" version="2.4" />

And Do I need a "BeforeModify.ps1" script if it ends up being the same as my "Uninstall.ps1" script? Or is the fact that they are the same a sign that I don't understand?

klondikemarlen commented 6 years ago

Ok. I have a working version at https://github.com/klondikemarlen/Chocolatey-Packages/tree/master/PyCharm-community. I still don't know whether I should require python as a dependency or not. But it updates, install and uninstalls. At some point I would like to work with @mastacheata to get the whole thing automated. I will contact the Site Admins and try and become a maintainer :)

dragon788 commented 6 years ago

It's not a great practice to do a just in time package install so you may want to ask the user of they want python 2 or python 3 and show them the command for that version and let them know they need to install it after pycharm is installed. I suggest this route because last I knew running an install command to pull in another package directly in your own installer is frowned upon as it breaks the dependency chain and resolvability.

mastacheata commented 6 years ago

I wouldn't bundle python with the IDE. The IDE doesn't require Python at all to function properly and there's at least 4 different python for windows with a sizeable community (Official Python2 and Python3 as well as ActivePython 2 and 3) When coding Python I usually do that for fully remote projects, for example.

@klondikemarlen I'd suggest forking our mastacheata/chocolatey-phpstorm repo and building on top of that if you are fine with just the stable releases. (@Spunkie is my co-maintainer for PHPStorm and handles all the prerelease versions independently) It's MIT licensed, so just modify it to your likes. If the comments inside the PowerShell file aren't self-explanatory enough, I'm always here to help. It should be possible for anyone to modify that package within less than half an hour to work with any Jetbrains IDE. I even reached out to all maintainers of JetBrains IDEs on the chocolatey platform, but haven't heard back from a single one. :( Some even list Jetbrains themselves as a Maintainer, but they aren't really active on chocolatey at all.

klondikemarlen commented 6 years ago

@dragon788 and @mastacheata Thanks for the advice on not bundling Python with the install. I will take it under advisement.

Would I still include python as a package dependency? (or is that the same thing as bundling python?)

@dragon788 Do you have an example of some code that asks the user if they want to install an optional dependency? I really know nothing about PowerShell scripting. I am concerned about breaking the "choco upgrade all -y" silent interactionless update functionality.

@mastacheata I will take a look at your automator though I suspect it will take me many hours as I am new to PowerShell. Thanks for offering to explain if I get lost :)

mastacheata commented 6 years ago

The files have lots of comments in them. Start by adjusting the nuspec template and fill in your details. In the powershell file adjust the full name references to the phpstorm with pycharm and change the code parameter in the data URL to PCC (PyCharm Community) or PCP (PyCharm Professional) or even both (just use PCP,PCC as the code)

mastacheata commented 6 years ago

I've just taken over the RubyMine maintainership. That means you can easily check the differences between PHPStorm and RubyMine in my repo and use that to get a better understanding of what needs to be changed to adjust it to PyCharm.

This took me 2 hours because I first started off in a separate repository (mastacheata/chocolatey-rubymine) but then moved both projects into one repo and instead created two branches instead. (This allows to compare files in between)

klondikemarlen commented 6 years ago

Nice thinking on the file compare. I will take a look at that for sure! I just checked out the branch and got set up so far ... but I'll see if I can get it running tomorrow.

mastacheata commented 6 years ago

I've rewritten the history so you can really see what the changes are. This diff should include everything that needs to be changed for changing my auto-package repo into any of the other jetbrains tools.

https://github.com/mastacheata/chocolatey-packages/compare/phpstorm...rubymine

The CheckBuildUpdate.ps1 needed one unusual change for RubyMine because the Changelog/ReleaseNotes URL is based on the major Version and not on the specific version as is the case for PHPStorm. (i.e. RubyMine has a 2017.3 ReleaseNotes page collecting all EAP and minor verisons, but PHPStorm has one for 2017.3.2 and a different URL for 2017.3.1)

klondikemarlen commented 6 years ago

@mastacheata Cool :) I love branch compare.

klondikemarlen commented 6 years ago

@mastacheata What does your helper.ps1 file do? https://github.com/mastacheata/chocolatey-packages/blob/phpstorm/tools/helper.ps1#L13. Does my (or well the choco new base code) do the same thing? https://github.com/klondikemarlen/chocolatey-packages-automatic/blob/pycharm_community/tools/chocolateyUninstall_template.ps1

I am pretty much done. I just need an AppVeyor account and a tonne of testing.

mastacheata commented 6 years ago

The helper.ps1 file only contains a function to look up the path / filename to the uninstaller in the registry. Looks like that is what Get-UninstallRegistryKey does in your Uninstall_template.ps1

dragon788 commented 6 years ago

Try linking this as your AppVeyor.yml file, https://gist.github.com/16d6e54ef086f1be22f91702f552f157

klondikemarlen commented 6 years ago

Ok. It is maybe working. I just need to wait until my cron thing runs. And I guess I should test everything ...

mastacheata commented 6 years ago

"It is maybe working", that's the attitude 🎉

mastacheata commented 6 years ago

@dragon788 I like that it tries to install the package, but it's lacking the deployment part, so you'd have to manually run the script at home and send it off to chocolatey again.

klondikemarlen commented 6 years ago

There is also this one ... though it has a lot of extra features. https://github.com/majkinetor/au-packages-template/blob/master/.appveyor.yml

mastacheata commented 6 years ago

Yeah, this majkinetor/au-packages-template is great if you want to know and use all features of chocolatey, appveyor and powershell at once., Though, you better have an extra life to learn what he does there. When I created the phpstorm thing I had no clue about PowerShell at all and this template was just too much at once to understand. I doubt I understand half of it even now.

klondikemarlen commented 6 years ago

+1 for needing extra life. This has been my introduction into PowerShell. Kind of exciting really. :)

dragon788 commented 6 years ago

@mastacheata it does require a manual deploy but you can do that from AppVeyor. Outside of AU I don't trust auto publishing to Chocolatey because if it does publish and get approved and then you find a bug you have to increment the version and go through the entire moderation process again. So what I do is use my appveyor.yml to build it and then add in the remote NuGet step to allow me to manually deploy to Chocolatey after a successful build and reviewing the log file.

The complexity of the AU script is largely because of how it intelligently finds the next version of a package from its download page which is also it's amazing strength for packages that get bumped periodically but don't really require a new installation method.

mastacheata commented 6 years ago

it does require a manual deploy but you can do that from AppVeyor. Outside of AU I don't trust auto publishing to Chocolatey because if it does publish and get approved and then you find a bug you have to increment the version and go through the entire moderation process again.

Yeah, but if you just check the results in AppVeyor and don't run it on your own machine, what's the point in delaying the deploy? AppVeyor already knows if everything went good or not. Either you verify the results on your own computer again, in which case you could skip the whole automated build stuff and just get a notification about new versions being available or you blindly trust AppVeyor, in which case you could just let it do the deployment automatically as well. That's the whole purpose of a Continuous Integration/Deployment process.

The complexity of the AU script is largely because of how it intelligently finds the next version of a package from its download page which is also it's amazing strength for packages that get bumped periodically but don't really require a new installation method.

I know the purpose of the AU template, but it tries to be a one size fits all solution and that's what makes it so increbibly complex. For the Jetbrains tools this could be so much more simple. Just check out the PHPStorm or RubyMine branches on my chocolatey-packages repo.

klondikemarlen commented 6 years ago

@srtlg See this thread about the automator. https://github.com/klondikemarlen/chocolatey-packages-automatic

mkevenaar commented 5 years ago

I am one of the current maintainers of this package, and it is automatically updated.

klondikemarlen commented 5 years ago

Do you want to take over as chief maintainer? Right now the only thing I'm doing is reading the notifications of each new release.

srtlg commented 5 years ago

On Thu, Apr 04, 2019 at 13:42 -0700, Marlen T. B. wrote:

Do you want to take over as chief maintainer? Right now the only thing I'm doing is reading the notifications of each new release. I can do that. Just I am not maintaining any official chocolatey package. Can you describe how you upload it?

mkevenaar commented 5 years ago

@srtlg I think that @klondikemarlen was asking me this.

I don’t mind having you on the package @klondikemarlen, please let me know if you want me to remove you.

klondikemarlen commented 5 years ago

@srtlg yeah, please drop me, thanks.

mkevenaar commented 5 years ago

@klondikemarlen I have removed you.