omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    stash pip updated to handle dependencies and more

    Pythonista
    pip stash
    5
    12
    10174
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ywangd
      ywangd last edited by ywangd

      I have largely re-written the pip command. The new features are:

      • Automatically install dependencies recursively. My favorite test case is pip install boto3.

      • Install from github repo, e.g. pip install selectel/pyte. Note that the hosted code must conform to standard Python package structure.

      • Install from an URL pointing to an archive file or a local archive file, e.g. pip install https://github.com/selectel/pyte/archive/master.zip. Again the code must conform to Python package structure.

      The changes are available in the latest StaSh and can be retrieved running selfupdate (for Pythonista 3, use selfupdate py3).

      Please let me know if you run into any issues.

      1 Reply Last reply Reply Quote 1
      • khilnani
        khilnani last edited by

        practically works for me. Not sure if its just me but I just updated to stash version 0.6.6 and seem to get an error when installing boto3

        thanks!!!

        based on botocore it depends on

        python-dateutil>=2.1,<3.0.0
        

        When installing boto3 that in turn looks for botocore and its dependencies, i get the error:

        Installing dependency: dateutil[('>=', '2.1'), ('<', '3.0.0')]
        Querying PyPI ...
        Error: No matches found: dateutil
        

        full log:

        [~/Documents]$ version
        StaSh v0.6.6
        Pythonista 2.0 (200003)
        iOS 9.3.1 (64-bit iPhone7,1)
        root: ~/Documents/site-packages/stash
        stash.py: 2016-04-11 21:24:49
        SELFUPDATE_BRANCH: master
        BIN_PATH:
          ~/Documents/bin
          ~/Documents/site-packages/stash/bin
        [~/Documents]$ pip install boto3
        Querying PyPI ...
        Downloading package ...
        Opening: https://pypi.python.org/packages/source/b/boto3/boto3-1.3.0.tar.gz
        Save as: /private/var/mobile/Containers/Data/Application/CFAF9225-3194-4889-BDF9-E0AF370BFDC5/tmp/boto3-1.3.0.tar.gz (79996 bytes)
             79996  [100.00%]
        Extracting archive file ...
        Archive extracted.
        Running setup file ...
        Package installed: boto3
        Installing dependency: botocore[('>=', '1.4.1'), ('<', '1.5.0')]
        Querying PyPI ...
        Downloading package ...
        Opening: https://pypi.python.org/packages/source/b/botocore/botocore-1.4.11.tar.gz
        Save as: /private/var/mobile/Containers/Data/Application/CFAF9225-3194-4889-BDF9-E0AF370BFDC5/tmp/botocore-1.4.11.tar.gz (2455881 bytes)
           2455881  [100.00%]
        Extracting archive file ...
        Archive extracted.
        Running setup file ...
        Package installed: botocore
        Installing dependency: jmespath[('>=', '0.7.1'), ('<', '1.0.0')]
        Querying PyPI ...
        Downloading package ...
        Opening: https://pypi.python.org/packages/source/j/jmespath/jmespath-0.9.0.tar.gz
        Save as: /private/var/mobile/Containers/Data/Application/CFAF9225-3194-4889-BDF9-E0AF370BFDC5/tmp/jmespath-0.9.0.tar.gz (20855 bytes)
             20855  [100.00%]
        Extracting archive file ...
        Archive extracted.
        Running setup file ...
        Package installed: jmespath
        Installing dependency: dateutil[('>=', '2.1'), ('<', '3.0.0')]
        Querying PyPI ...
        Error: No matches found: dateutil
        
        1 Reply Last reply Reply Quote 0
        • JonB
          JonB last edited by

          sigh! there are a few edge cases in the pep, and this is one of them..

          1 Reply Last reply Reply Quote 0
          • JonB
            JonB last edited by

            replace the parsed= line (1022 in pip.py) with

                package_name   = '^([a-z0-9]|[a-z0-9][a-z0-9._-]*[a-z0-9])'
                parsed = re.findall(package_name+version_one,requirement)
            

            I will submit a pull request here soon.

            khilnani 1 Reply Last reply Reply Quote 1
            • Phuket2
              Phuket2 last edited by

              Not sure it's been mentioned before or not. But when in stash, if you use the auto correct/suggestion on the keyboard (I am only using apple keyboard) it goes horribly wrong.

              ywangd 1 Reply Last reply Reply Quote 1
              • khilnani
                khilnani @JonB last edited by

                @JonB Thanks!! I applied the change locally and it installed boto3 all the way through.

                1 Reply Last reply Reply Quote 0
                • ywangd
                  ywangd last edited by

                  Thanks @JonB for fixing this issue. I have also merged the pull request to the master branch. It can be retrieved with selfupdate -f.

                  1 Reply Last reply Reply Quote 0
                  • ywangd
                    ywangd @Phuket2 last edited by

                    @Phuket2 You are right. The QuickType indeed causes chaos to the terminal. I always hide the QuickType bar. So I wasn't aware of this issue. After looking into it briefly, it does NOT seem possible to fix it. I guess you'll just have to hide it (swipe down on the bar).

                    I tried to disable it programmatically but 2.0 app store version crashes on following method

                    setAutocorrectionType_(1)
                    

                    It does work in both of the Betas. I'll have it added when a new official version is out.

                    Phuket2 1 Reply Last reply Reply Quote 0
                    • omz
                      omz last edited by

                      @ywangd You can work around the crash in 2.0 like this:

                      ObjCInstanceMethod(textview, 'setAutocorrectionType:')(1)
                      
                      ywangd 1 Reply Last reply Reply Quote 2
                      • ywangd
                        ywangd @omz last edited by

                        @omz That did the trick! Thanks!

                        1 Reply Last reply Reply Quote 0
                        • khilnani
                          khilnani last edited by

                          the quick responses are really appreciated!

                          1 Reply Last reply Reply Quote 0
                          • Phuket2
                            Phuket2 @ywangd last edited by Phuket2

                            @ywangd, no problems I understand. The main reason to bring it up is mainly a support issue. I have used the autocorrect buttons a few times. And something fails, like selfupdate. But it didn't really fail, just got some strange input. Easy to jump to the conclusion that stash is not working.

                            Edit-Great to see @omz gave a way forward

                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post
                            Powered by NodeBB Forums | Contributors