Skip to content

README.md needs instructions for how to manually update the lib for developers #287

Closed

Description

@ensonic

Seriously, either keep it simple or tell people how to do it. I've tried:

# on the ev3
mkdir ev3dev
# on development laptop:
<make changes>
scp ev3dev/*.py robot@ev3dev.local:ev3dev/
# on ev3
sudo mv *.py /usr/lib/python3/dist-packages/ev3dev/

but after that I only get python errors (e.g. instantiating motors fails).

Activity

  1. changed the title [-]README.mc needs instructions for how to manually update the lib for developers[/-] [+]README.md needs instructions for how to manually update the lib for developers[/+] on Jan 29, 2017
  2. ddemidov commented on Jan 29, 2017

    @ddemidov
    Member

    What I do in order to test things out, is

    ssh robot@ev3dev
    git clone https://github.com/rhempel/ev3dev-lang-python
    cd ./ev3dev-lang-python
    

    Now, you can do your changes to the local copy. When you do

    import ev3dev.ev3 as ev3

    while in the ev3dev-lang-python folder, it should import from local folder instead of from system-installed one.

  3. ensonic commented on Jan 29, 2017

    @ensonic
    ContributorAuthor

    Unfortunately this won't work for installed stuff. The openrobertalab is a package with a service run by systemd.

  4. ddemidov commented on Jan 29, 2017

    @ddemidov
    Member

    Well, the installed stuff is installed with apt-get, so I guess the only correct way to test things would be to uninstall the system package first, then run ./setup.py install from the cloned repo.

  5. ensonic commented on Jan 29, 2017

    @ensonic
    ContributorAuthor

    Nah, just need to get the right files to the right locations. I'll check the layout of the src tree and the installed files.

  6. WasabiFan commented on Jan 29, 2017

    @WasabiFan
    Member

    It sounds like you're looking for the equivalent of npm link from the JavaScript world... I can't seem to find anything similar in Python package managers though.

  7. dwalton76 commented on Jan 30, 2017

    @dwalton76
    Collaborator

    You can do

    ssh robot@ev3dev
    git clone https://github.com/rhempel/ev3dev-lang-python
    cd ./ev3dev-lang-python
    sudo python3 setup.py install
    

    Then whenever you make changes run the "sudo python3 setup.py install" again

  8. dwalton76 commented on Jan 30, 2017

    @dwalton76
    Collaborator

    @ensonic can you confirm that does the trick for openrobertalab

  9. ensonic commented on Feb 2, 2017

    @ensonic
    ContributorAuthor

    @dwalton76 if I follow your instructions, it will be installed to /usr/local/lib/python3.4/dist-packages/ where as the debian package is in /usr/lib/python3/dist-packages/. That usually is a recipe for disaster (especially so since setup.py cannot easily uninstall stuff). But it seems to be only one single file:
    /usr/local/lib/python3.4/dist-packages/python_ev3dev-0.8.0.post32-py3.4.egg

    Besides the concern of having multiple versions installed, python seems to pickup the /usr/local/ one. Verified by looking for the new Sound.get_volume() api.

  10. dwalton76 commented on Feb 2, 2017

    @dwalton76
    Collaborator

    Right you do end up with two copies which is not ideal but I've never run into issues with it since the copy in /usr/local/lib/python3.4/dist-packages/ is found first via your PYTHON_PATH. I just rm -rf the /usr/local/lib/python3.4/dist-packages/ copy if I want to go back to using the version installed via the deb. Most of the time I just end up using the copy installed via setup.py though as I'm continuing to do dev on it.

    You could always uninstall the copy from the debian package to avoid having two copies.

  11. ensonic commented on Feb 2, 2017

    @ensonic
    ContributorAuthor

    I can't uninstall the python library, since that will install packages depending on it. I'll send a PR for the docs with the gist of this thread.

  12. WasabiFan commented on Sep 19, 2017

    @WasabiFan
    Member

    I believe this is the currently recommented list of options:

    • Update PYTHONPATH
    • Do development from the directory of a local copy of the library (current working directory is searched for modules)

    Feel free to update this with more. I'm not going to close this immediately as it would be nice to add complete instructions to the README.

  13. dlech commented on Sep 19, 2017

    @dlech
    Member

    no underscore in PYTHONPATH environment variable name.

  14. WasabiFan commented on Sep 19, 2017

    @WasabiFan
    Member

    Updated. I could've sworn there was one 🤔

  15. WasabiFan commented on Dec 19, 2018

    @WasabiFan
    Member

    It looks like this was mostly resolved so I'm going to close the issue. Please reopen or submit a PR if there is a change that's still needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions