Yelp / pyleus

Pyleus is a Python framework for developing and launching Storm topologies.
Apache License 2.0
404 stars 113 forks source link

development env broken #133

Closed imcom closed 9 years ago

imcom commented 9 years ago

when using the dev config as stated in document:

[build]
pypi_index_url: http://0.0.0.0:7778/simple/

I could not get rid of the error message:

New python executable in /var/folders/g6/75g37v6x3yz5gk91f_kxggs00000gn/T/tmp6Cyj4S/resources/pyleus_venv/bin/python
Installing setuptools, pip, wheel...done.
Collecting pyleus==0.3.0
  The repository located at 0.0.0.0 is not a trusted or secure host and is being ignored. If this repository is available via HTTPS it is recommended to use HTTPS instead, otherwise you may silence this warning and allow it anyways with '--trusted-host 0.0.0.0'.
  Could not find a version that satisfies the requirement pyleus==0.3.0 (from versions: )
No matching distribution found for pyleus==0.3.0
pyleus build: error: [VirtualenvError] Failed to install pyleus==0.3.0 package. Run with --verbose for detailed info.

when run pyleus build ...yaml the pip install would fail with the local pypi server.

I even tried to add --trusted-host to build.py and reinstall pyleus from source, but it is still a no go.

Please help to clarify how should I set up a dev environment.

I am going to open a pull request for adding some more config to topology, I really need a dev environment up and running ...

mzbyszynski commented 9 years ago

I had this same issue a while back. The problem is newer versions of pip have stopped trusting hosts by default, so the old local pypi workflow described in the docs will not work anymore.

I just submitted PR #134 that fixes this by added any explicitly defined pypi server as a trusted host when calling pip.

Hope that helps!

imcom commented 9 years ago

hi @mzbyszynski

I've tried your approach or a similar one,

I add --trusted-host 0.0.0.0 to the build command like this:

cmd = [os.path.join(self.path, "bin", "pip"), "install", package, "--trusted-host 0.0.0.0"]

but still got no luck ...and I did not see how is it different from your PR ... I mean technically they are identical right?

imcom commented 9 years ago

hi @mzbyszynski

Turns out, your approach or my dirty hack is working ... but it just does not work with virtualenv.

I re-installed the customized pyleus in the host env instead of a virtual one then I got things work out like a charm ...

when I used virtualenv, the binary pyleus I installed in virtual env seemed to be not called, and the one in host env was called instead ... it is confusing

mzbyszynski commented 9 years ago

Hmm, I believe virtualenv was working for me last time I tried with this fix. I did have to first do pip install /path/to/project/pyleus/dist/pyleus-0.2.4.tar.gz to in my virtual env first, before running any of the pyleus commands.