Forum Archive

stash pip updated to handle dependencies and more

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.

khilnani

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
JonB

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

JonB

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.

Phuket2

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.

khilnani

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

ywangd

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

ywangd

@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.

omz

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

ObjCInstanceMethod(textview, 'setAutocorrectionType:')(1)
ywangd

@omz That did the trick! Thanks!

khilnani

the quick responses are really appreciated!

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