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

How to experiment with local changes #2786

Closed
jcoatgoogle opened this issue Nov 30, 2016 · 10 comments
Closed

How to experiment with local changes #2786

jcoatgoogle opened this issue Nov 30, 2016 · 10 comments
Assignees

Comments

@jcoatgoogle
Copy link

My goal is simple: be able to make local changes, and then use veneer with those local changes. Per the contributor documents, I'm trying to use tox, but not really succeeding.

If I do tox -e py27 --recreate --notest from the root directory, then it doesn't pick up any changes.

If I do tox -e py27 --recreate --notest from datastore/ (this is the code I am changing), then my changes are picked up, but they don't work

$ .tox/py27/bin/python
Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from google.cloud import datastore
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "~/oss/git/google-cloud-python/datastore/.tox/py27/local/lib/python2.7/site-packages/google/cloud/datastore/__init__.py", line 53, in <module>
    from google.cloud.datastore.client import Client
  File ~/oss/git/google-cloud-python/datastore/.tox/py27/local/lib/python2.7/site-packages/google/cloud/datastore/client.py", line 23, in <module>
    from google.cloud.datastore._http import Connection
  File "~/oss/git/google-cloud-python/datastore/.tox/py27/local/lib/python2.7/site-packages/google/cloud/datastore/_http.py", line 24, in <module>
    from google.cloud import connection as connection_module
ImportError: cannot import name connection

I would appreciate any guidance on how to make this work!

@waprin
Copy link
Contributor

waprin commented Nov 30, 2016

I'm still trying to understand everything as well, but what I usually do is just

cd datastore
pip install .

To just install the package into my local virtualenv. Maybe there are hidden gotchas but it usually works for me.

@daspecster
Copy link
Contributor

@jcoatgoogle, it looks like you have multiple versions of the library installed and the wrong one is getting picked up.

The ImportError: cannot import name connection issue is actually from a switch that was made in the last release I believe. A simple thing to try would be to delete your .tox directories in root as well as in the sub-packages and then run tox -e py27 --recreate --notest.

@jcoatgoogle
Copy link
Author

Merging master and deleting all the .tox's seems to have worked. Thank you both. Will reopen if I run into any more issues! <3

@daspecster
Copy link
Contributor

Glad to hear!

If you run .tox/py27/bin/pip freeze in the root and in the sub-package you can probably see the library versions that are fighting.

@dhermes
Copy link
Contributor

dhermes commented Dec 2, 2016

@jcoatgoogle Thanks a lot for reporting and for slogging through to the finish line. Sorry you ran into this, we're still smoothing out sharp corners after we switching from gcloud to google.cloud and now are in the land of Python namespace packages.

@jcoatgoogle
Copy link
Author

Hm, this started failing again. I tried deleting all the .tox directories, but the issue I'm seeing is that I have a change to datastore/ which depends on a change in core/, but I'm not able to see the change in core/. It's weird because it was working...alas, I rebased in master, but I'm curious if there's a way to properly deal with that? I've checked the site-packages and the change is in fact not reflected in the new file... not sure if something changed, or if I somehow got lucky earlier?!

To unblock myself I can just manually copy the files into site-packages... is this sort of thing supported?

Thanks again

@jcoatgoogle
Copy link
Author

I tried to reopen this but it won't let me :S

@jcoatgoogle jcoatgoogle reopened this Dec 6, 2016
@jcoatgoogle
Copy link
Author

oh wait now it will. I think github was having issues...

@dhermes
Copy link
Contributor

dhermes commented Dec 6, 2016

@jcoatgoogle Resolving #2785 should cover this, no? Can we close this and just move over there?

@jcoatgoogle
Copy link
Author

Happy to move this conversation there

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

No branches or pull requests

4 participants