Skip to content
This repository was archived by the owner on Dec 23, 2021. It is now read-only.

Users/t anmah/simulation dependency checker fix #169

Merged
merged 5 commits into from
Jan 22, 2020

Conversation

andreamah
Copy link
Contributor

Description:

Fixed automated package installer for Python libraries needed for custom adafruit_circuitplayground.express library.

  • Fixed pywin32 requirements version for Python 3.8
  • Improved error handling for Python package installation; used to fail silently, but now pops up with an error message.
  • More robust way of checking whether package installation failed; now checks for presence of ./out/python_libs to see if installation failed.
  • improved README + etc. docs for new dependency workflow (no more need to pip install packages globally).

Type of change

  • [ x ] Bug fix (non-breaking change which fixes an issue)

Limitations:

Sound functionality still fails on Mac OS. Issue already recorded on backlog item 28661.

Testing:

  • Manual testing (test with/without dependencies installed prior, test with bad requirements.txt, tested on Mac OS, and Windows.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

Copy link

@nasadigital nasadigital left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid work, very neat solution :)

applicationinsights==0.11.9
python-socketio==4.3.1
requests==2.22.0
pywin32>=224

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it would make sense to fix pywin32's version to 224 in case there are breaking changes in future versions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pywin32 can't download version 224 on Python 3.8 :(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for clarifying!
What about fixing it to a newer version? Are new versions compatible with Python 3.7?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested pywin32 ver 227 on python 3.7 and it seemed to work! I'll fix it to ver 227.

Copy link
Contributor

@isadorasophia isadorasophia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job! ⚡️

README.md Outdated
install by typing the following commands in a console: `pip install requests`
- _**Application Insights**_
install by typing the following commands in a console: `pip install applicationinsights`
- Python Modules for Deploy to Device
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not on the scope of this PR, so don't worry! I wonder if we should move these install instructions from the README.md and just point to the install.md instead? Otherwise we just have dupe information (or we can make the whole README overwhelming for new users).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the instructions were here beforehand too (or at least the pip install commands). But yeah, it would maybe be a good idea to move all installation-related stuff to install.md for clarity (I noticed that lots of parts repeat between docs)

Copy link
Contributor

@isadorasophia isadorasophia Jan 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup -- you just followed the pattern of what we have before, so it's all good! However, I think it might be worth adding a work item to do that in the future? (basically linking stuff at README so it's more doc-based).

Copy link

@nasadigital nasadigital left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for applying fixes!
LGTM :)

- If you're on Windows, use the following command in the console to install pywin32: `pip install pywin32`

- Python Modules for Simulation
- **Note:** On extension activation, you will be prompted with a popup message asking if you want the modules to be automatically installed for you. The following Python modules should be downloaded when you select "yes" on the prompt message. **If modules are not installed correctly, please use the "pip install" commands listed below.**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this note be at the top/or placed somewhere else because it also applies to "Deploying to Device"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a suggestion on how we can address this, instead of having these two topics, we can have something along these lines:
(I guess the same goes for the text on Install.md and developers-setup.md)

  • Python Modules for Deploying to Device
  • Python Modules for Simulation

We can just have:

  • (Notes here)
    • Python Modules
      • Pywin32 (only windows etc)
        Running the simulator:
      • (list extra modules here)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to make it clearer with the newest commit. Is it a bit more organized now?

- If you're on Windows, use the following command in the console to install pywin32: `pip install pywin32`

- Python Modules for Simulation
- **Note:** On extension activation, you will be prompted with a popup message asking if you want the modules to be automatically installed for you. The following Python modules should be downloaded when you select "yes" on the prompt message. **If modules are not installed correctly, please use the "pip install" commands listed below.**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a suggestion on how we can address this, instead of having these two topics, we can have something along these lines:
(I guess the same goes for the text on Install.md and developers-setup.md)

  • Python Modules for Deploying to Device
  • Python Modules for Simulation

We can just have:

  • (Notes here)
    • Python Modules
      • Pywin32 (only windows etc)
        Running the simulator:
      • (list extra modules here)

@andreamah andreamah merged commit 33ad456 into dev Jan 22, 2020
@vandyliu vandyliu deleted the users/t-anmah/simulation-dependency-checker-fix branch January 23, 2020 03:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants