Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print frendlier messages when auto-install fails and auto-install globally #2304

Closed
wants to merge 1 commit into from

Conversation

theotherjimmy
Copy link
Contributor

No description provided.

@theotherjimmy theotherjimmy force-pushed the install-deps branch 2 times, most recently from b76a649 to 7dc684a Compare July 28, 2016 23:57
@0xc0170
Copy link
Contributor

0xc0170 commented Jul 29, 2016

how was this tested? previously it would catch an exception, now just a return?

@theotherjimmy
Copy link
Contributor Author

theotherjimmy commented Jul 29, 2016

previously it would catch an exception, now just a return?

The exception I was trying to catch would get caught(and backtraced) in the pip.main call. Instead of throwing an excetpion, pip.main will return a non-zero (truthy) value on failure.

how was this tested?

I uninstalled all of my dependencies, and ran test.py. It told me to use sudo, so I did. It then worked and I had all of my dependencies.
I also create a vurtual environment (with --no-site-packages) and it ran flawlessly in that without sudo

@bridadan
Copy link
Contributor

/morph test

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 561

All builds and test passed!

@sg-
Copy link
Contributor

sg- commented Jul 29, 2016

Should add these changes and revisit venv / local / global site-packages #2257

@screamerbg @theotherjimmy

@screamerbg
Copy link
Contributor

@theotherjimmy Is reload(site) needed here:

from tools.utils import install_from_pip
with open(join(ROOT, "requirements.txt")) as reqs:
    for req in reqs:
        install_from_pip(req)

import site
reload(site)

E.g. can we have it as part of install_from_pip() if modules are missing?

Otherwise LGTM

@theotherjimmy theotherjimmy force-pushed the install-deps branch 3 times, most recently from 0d2c5e4 to c75ff3a Compare August 2, 2016 23:39
@theotherjimmy
Copy link
Contributor Author

@screamerbg I think the new implementation does exactly that: only runs reload(site) when it's needed.

@bridadan
Copy link
Contributor

bridadan commented Aug 3, 2016

/morph test

@theotherjimmy
Copy link
Contributor Author

theotherjimmy commented Aug 3, 2016

An example.

mbedmicro/mbed [ virtualenv --no-site-packages .venv                                   ]  0 (19:08)
New python executable in .venv/bin/python
Installing setuptools, pip...done.
mbedmicro/mbed [ . ./.venv/bin/activate                                                ]  0 (19:10)
(.venv)mbedmicro/mbed [ python tools/get_config.py -t GCC_ARM -m K64F --source .       ]  1 (19:30)
The tools need the following packages that are not installed:
project-generator>=0.9.7,<0.10.0, 
project-generator-definitions>=0.2.26,<0.3.0, 
junit-xml, 
pyYAML, 
requests, 
mbed-ls>=0.2.13, 
mbed-host-tests>=0.2.18, 
mbed-greentea>=0.2.24

Would you like to install them now? (y/N)y
Installing project-generator>=0.9.7,<0.10.0
Installing project-generator-definitions>=0.2.26,<0.3.0
Installing junit-xml
Installing pyYAML
Installing requests
Installing mbed-ls>=0.2.13
Installing mbed-host-tests>=0.2.18
Installing mbed-greentea>=0.2.24
Scan: .
Scan: FEATURE_COMMON_PAL
Scan: FEATURE_UVISOR
Scan: FEATURE_BLE
Scan: FEATURE_CLIENT
Scan: FEATURE_IPV6
Scan: FEATURE_IPV4
Scan: FEATURE_STORAGE
Configuration parameters
------------------------
core.stdio-baud-rate = 9600 (macro name: "MBED_CONF_CORE_STDIO_BAUD_RATE")
rtos.present = 1 (macro name: "MBED_CONF_RTOS_PRESENT")
configuration-store.storage_disable = 0 (macro name: "CFSTORE_STORAGE_DISABLE")
core.stdio-convert-newlines = 0 (macro name: "MBED_CONF_CORE_STDIO_CONVERT_NEWLINES")

Macros
------
Defined with "macros": ['UNITY_INCLUDE_CONFIG_H']
Generated from configuration parameters: ['MBED_CONF_CORE_STDIO_BAUD_RATE=9600', 'MBED_CONF_RTOS_PRESENT=1', 'CFSTORE_STORAGE_DISABLE=0', 'MBED_CONF_CORE_STDIO_CONVERT_NEWLINES=0']

@bridadan
Copy link
Contributor

bridadan commented Aug 3, 2016

I think the prompting and verbiage is fine on this PR, I had trouble install the package junit-xml on my machine for whatever reason. It'd be good if someone else could test this PR? Probably another Windows and Mac machine would be best to get all coverage.

@mbed-bot
Copy link

mbed-bot commented Aug 3, 2016

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 585

Test Prep failed!

@bridadan
Copy link
Contributor

bridadan commented Aug 3, 2016

@theotherjimmy The prompt goofed up Travis :) We should either pipe yes to it or install the requirements first. I'd opt for the latter.

@sg-
Copy link
Contributor

sg- commented Aug 4, 2016

handled by mbed CLI ARMmbed/mbed-cli#310

@sg- sg- closed this Aug 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants