Development and Pipeline

Development and Pipeline

Development and Pipeline

Connecting mainframe application developers to discuss efficiently creating and maintaining z/OS applications

 View Only
  • 1.  Does PYDEV work with IBM developer for z/OS

    Posted Thu April 28, 2022 04:56 AM

    I am trying to use IBM developer for z/OS for the first time to edit Python files on z/OS.

    Ive installed pydev, and it says it is installed.  When I follow https://www.vogella.com/tutorials/Python/article.html it says
    go Window  Preference  Pydev  Interpreter Python menu.

    Under Windows, Preference, I do not have Pydev. 
    If I try to edit  x.py file on z/OS it invokes gedit on my linux machine, so it looks like Pydev is not picked up.

    Is this supported? 
    Can I use IDz to edit my python files in  USS on z/os

    Colin



    ------------------------------
    Colin Paice
    ------------------------------


  • 2.  RE: Does PYDEV work with IBM developer for z/OS

    Posted Fri April 29, 2022 07:55 PM

    Hello Colin,

    I have gotten PyDev 8.2.0 installed on IBM Developer for z/OS 15.0.4, so I am listing my step-by-step here.

    Note / Disclaimer: PyDev is not currently officially supported by the IBM Developer for z/OS product. IBM Developer for z/OS support cases will not be accepted if there is an issue with install or usage only related to PyDev installed as it is considered a third party plugin installation at this time.

    I am not sure how you obtained PyDev or what version you are using, so I will assume you are obtaining from the PyDev releases directly and ended up with the latest PyDev 9.3.0.
    The PyDev Installation site https://www.pydev.org/manual_101_install.html does note that without Java 11 as the base for the install, the install or update process may appear to work but PyDev will not show up correctly in the target installation; I think this is what was happening if you were to install any current PyDev version.
    PyDev requires Java 11 and Eclipse 4.6 (Neon) in order to run, and only supports Python 2.6 onwards.
    According to the documentation on PyDev Install the success of the install will highly depend on the version of PyDev that you installed and the target version of Eclipse and Java.
    The latest PyDev requires Java 11, and so isn't compatible with IDz.  IDz 15.0 is on Aqua 3.2 which is a release based on an updated Eclipse 4.8 running on IBM Java 8.

    Based on this information, you may need uninstall PyDev you have installed, and then install a lower version of PyDev to succeed.
    To uninstall the PyDev if parts were still installed, go to Help -> About -> Installation Details in the Installation History tab panel can let you go back to what you had installed prior to the PyDev install, or you can uninstall from the Installed Software tab by selecting the PyDev options you installed and clicking Uninstall ... 


    PyDev 8.2.0 from February 2021 seems to be the last version before the Java 11 requirement according to the PyDev Install page and PyDev Releases https://www.pydev.org/history_pydev.html

    PyDev 8.2.0 is on the PyDev GitHub for install at https://github.com/fabioz/Pydev/releases/tag/pydev_8_2_0

    My installation experience:   (
    Hopefully this is helpful to get you going with PyDev on IDz.)

        1. I unzipped the file to my directory as /usr/mitchell/PyDev.8.2.0
        2. You should be able to install directly in the IDz via the
    Help -> Install New Software... wizard.
        3. Press Add... and in the dialog press Local.
        4. Choose the folder of the unzipped file from the PyDev install download and press
    Open.
        5. The result for me was a
    Location: file:/usr/mitchell/PyDev.8.2.0/
        6. I added PyDev 8.2.0 in Name: so I could find it again later and pressed Add.
        7. You won't really see anything different, but that is expected. There is a checkbox at the bottom
    Group items by category: that when you uncheck will reveal three options.

                   PyDev for Eclipse 8.2.0.202102211157
                   PyDev for Eclipse Developer Resources 8.2.0.202102211157
                   PyDev Mylyn Integration 0.6.0

    1. I think you only need the first one. You can select the second one too. Do not select the third option; Mylyn isn't installed and it will fail...

    2. Press Next >

    3. It will start Calculating requirements and dependencies. This will take quite a while. and will seem even longer than it takes because the UI will not be usable...

    4. Eventually you will be provided with the Install Details panel.

    5. Press Next > and you will be presented with the License text.

    6. To advance, you have to select the radio button for I accept the terms of the license agreements.

    7. You can then press Finish.

    8. It will start Installing Software, you may see a progress bar or Installing Software (NN%)...

      - You may get a pop-up dialog for a Security warning for unsigned content with Details >> showing the PyDev source was included with the install of PyDev for Eclipse Developer Resources if you selected that option.

      - The dialog asks to Install anyway or Cancel. (If you cancel, you will need to go back and restart the install but only select option PyDev for Eclipse. )

    9. You will then be asked by the Software Updates dialog if you would like to restart.

      - Pressing Restart Now will restart the IDz workbench and allow the install changes to take affect.

      - If you need to finish or close or disconnect or save something first, select No, finish and close out the work, and then go to File -> Restart

    10. The restart may take a while as the plugins and features renegotiate.

    11. Going to the Help -> About -> Installation Details in the Installed Software tab panel should show PyDev for Eclipse, and searching Py in the Plugins tab should show several Brainwy Software Ltda provided plugins with python and pydev in the name.

    12. If you close out the Installation Details and the About, you can check the file associations now...

      20. Window -> Preferences -> General -> Editors -> File Associations should have a File types: entry for *.py and the Associated Editors: section should list Python Editor as one of the options.
      21.
    Window -> Preferences -> PyDev should also be populated with preferences for Editor, Interpreters, PyUnit, and Scripting i.

      22. If you don't set up Python via the preferences, on the first Python file interaction you may get a message that the Python interpreter is not currently configured.

     Note: I am unsure as to the PyDev Capabilities needs or if they were explicitly defined, so you may need to go into
    General->Capabilities
    and enable some (or Enable All) of the Capabilities to get the desired functionality.


    Note that you can edit Python files inside the base IDz install with some of the generic file editors installed, it will not have Python specific language knowledge such as content assist or syntax highlighting.

        1. To allow Python files to be edited internally, by setting the Window -> Preferences -> General -> Editors -> File Associations.
        2 .Here you can choose to change the O
    pen associated files with: option from System Editor; if none Text Editor to Text Editor as one option.
        3 . Another option is in the
    File types: section press Add... and then in the dialog that comes up type *.py and then press OK.
    (If you get a dialog message that says a file type
    *.py already exists that is OK: this means PyDev registered as an editor which is fine. )
        4. In the
    Associated editors: section press Add... and select the Internal editors radio button option.
        5. I would recommend then choosing
    Generic Text Editor, Text Editor, System z LPEX Editor, or z Systems LPEX Editor but there are several other options that may work for you.
        6. Note that you can
    Add... more than one editor to a a single file type, at which point if you right click on the *.py files you will have an option of which editor to use.
        7. The one that is used when you double click or
    right click -> Open is the one you set to default, which you can adjust in this section by selection of one of the editors and then pressing the Default button.
        8. Press
    Apply and Close when complete, and the Python files should now be associated with an internal editor.

    I hope this was all helpful to getting to editing Python files in IDz.

    Regards,



    ------------------------------
    Gerald Mitchell
    Gerald.Mitchell@ibm.com
    ------------------------------



  • 3.  RE: Does PYDEV work with IBM developer for z/OS

    Posted Sat April 30, 2022 07:05 AM

    Hi Gerald,

    Those instructions worked a treat, and I could get it working.

    May I point my blog to your comments ( or copy the text and say they came from you)

    I could use the editor to edit the files - that worked file, (the scroll bars are a little dodgy, but otherwise it worked ok).

    I could not get "run" or "debug" to work,as it assumed I was going to run it on Linux!  One of the reasons for looking into this was to  see what was viable.

    Overall idz is viable; without pydev I can use the local editor for the files, and that can handle python source.
    (One thing I noticed there seems to be no locking of the source files.  I can edit a file using ispf, edit it using idz, save it from idz, save it from ispf, and overwrite the id/z saved version.)

    regards

    Colin



    ------------------------------
    Colin Paice
    ------------------------------