Menu

#487 Adapt spock to itango 0.1.1 (separated from PyTango 9.2)

Jul16
resolved
None
spock
feature-request
2016-09-06
2016-06-27
No

From PyTango 9.2 on itango will be a separate project.
Spock uses itango - it register itango as IPython's extension.

Spock code referring to the PyTango.ipython module should refer to itango module if PyTango >= 9.2 is in use.
These are the following calls:

import PyTango.ipython

PyTango.ipython.get_ipython_dir # optional
PyTango.ipython.get_ipython_profiles # optional
PyTango.ipython.init_ipython

# in the load_config:
i_app = config.BaseIPythonApplication
extensions = getattr(i_app, 'extensions', [])
extensions.extend(["PyTango.ipython", "sardana.spock"])

Discussion

  • Carlos Falcon

    Carlos Falcon - 2016-08-04

    A patch has been sent to the list.

     
  • Carlos Falcon

    Carlos Falcon - 2016-08-04
    • status: waiting --> active
    • assigned_to: Carlos Falcon
     
  • Zbigniew Reszela

    • status: active --> resolved
     
  • Zbigniew Reszela

    In the setup.py we should specify an extra itango requirement in case one wants to use Sardana with PyTango >= 9.2.0.
    Since Sardana depends on the PyTango >= 7.2.3 this dependecy must be conditional and AFAIK it is not possible to condition the requirements neither in distuils nor in setuptools.

    One solution could be to take a profit of the "provides" information. This would require PyTango (7 and 8) to provide itango, and re-creating its PyPI packages... Having that we could set requirements for Sardana as following: PyTango >= 7.2.6 and itango. But I think it will also require some tricks and manual forcing of versions when installing Sardana and PyTango < 9.2.6 with pip.

    For that reason we have decided to not specify the itango requirement on the pip level yet, and wait for dropping the support to PyTango < 9.2.6.

    After migrating the setup.py to setuptools, we could explore the possibility to use extra_requires, but this would still be a workaround...

     
  • Vincent Michel

    Vincent Michel - 2016-09-05

    For the record, here is the tempory fix we used in our sardana fork:

    -import PyTango.ipython
    +try:  # PyTango >= 9.2
    +    import itango
    +except ImportError:  # PyTango <= 8.1.8
    +    import PyTango.ipython as itango
    
     
  • Vincent Michel

    Vincent Michel - 2016-09-05

    One solution could be to take a profit of the "provides" information. This would require PyTango (7 and 8) to provide itango, and re-creating its PyPI packages... Having that we could set requirements for Sardana as following: PyTango >= 7.2.6 and itango. But I think it will also require some tricks and manual forcing of versions when installing Sardana and PyTango < 9.2.6 with pip.

    Another solution (though a bit ugly) is to use pytango >= 7.2.6 and itango == 0.1.2 (itango < 0.1.3 should be compatbile with pytango < 9.2.0). Then you'll be able to update to pytango >= 9.2.0 and itango once you decide to drop tango8 support.

    Let me know if you interested in this solution, I'll have to run some tests first :)

     
    • Zbigniew Reszela

      Another solution (though a bit ugly) is to use pytango >= 7.2.6 and itango == 0.1.2 (itango < 0.1.3 should be compatbile with pytango < 9.2.0).

      I'm not sure if I understand it well. Does it mean that the following two scnearios would work correctly:
      1. sardana & pytango 7.2.6 & itango 0.1.2
      2. sardana & pytango 9.2.0 & itango 0.1.2

       
  • Vincent Michel

    Vincent Michel - 2016-09-05

    Does it mean that the following two scnearios would work correctly:
    1. sardana & pytango 7.2.6 & itango 0.1.2
    2. sardana & pytango 9.2.0 & itango 0.1.2

    I think so, it's only a copy paste of the old PyTango.ipython module, though we have to make sure of that before you make a decision. The only problem with this approach is that it creates some kind of duplication by having itango installed in 2 different places.

     
  • Zbigniew Reszela

    It sounds promising. One question, why not setting the sardana's dependency to pytango >= 7.2.6 and itango >= 0.1.2.
    This will still allow users to stay with PyTango 7 and will allow to eventually upgrade to the higher itango version in the future.

     
    • Vincent Michel

      Vincent Michel - 2016-09-05

      why not setting the sardana's dependency to pytango >= 7.2.6 and itango >= 0.1.2

      Because itango > 0.1.2 is not compatible with pytango < 9.2.0.

      However, I just checked and pytango >= 9.2 is a requirement of itango since the first release, so this solution is not gonna work... --'

      Maybe I can make a release of itango 0.1.4 with support for older pytango. For instance, itango/__init__.py could do something like this:

       try:
           import tango
       except ImportError:  # PyTango <= 8.1.8
           from PyTango.ipython import *
           __path__ = []
       else:  # PyTango >= 9.2
           [...] # itango imports
      

      Then you can simply add itango >= 0.1.4 in the sardana requirements. You sould also be able to use import itango everywhere in sardana transparently. What do you think?

       

      Last edit: Vincent Michel 2016-09-05
  • Zbigniew Reszela

    I think this should work, but we would need to perform tests. We are starting now the release process which includes exhaustive tests.
    How long will it take to you to prepare th itango 0.1.4?

     
    • Vincent Michel

      Vincent Michel - 2016-09-06

      I could make this release very quick, but I'd like to include a few other fixes. I can get it ready in 1 to 3 days, is that ok?

       
      • Zbigniew Reszela

        To be honest, the sooner the better:) since we need to perform the manual tests in several environments and this takes time... The target is to release Sardana during this week. I don't want to push you, but the maximum we could wait is 1 day.

        One shortcut could be that you push to github the itango 0.1.4 "release branch" with the changes necessary for Sardana and we do the tests by installing it with python setup.py install. This will give you time to do other release works meanwhile we perfrom the tests... and we could wait for itango 0.1.4 on PyPI until let's say Friday.
        What do you think?

         
        • Vincent Michel

          Vincent Michel - 2016-09-06

          See PR#4: https://github.com/tango-cs/itango/pull/4
          Would you mind to validate it?

           
          • Zbigniew Reszela

            Many thanks Vincent for so fast implementation!
            I have already replied in the PR.