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

Poet fails with HTTP Error 404 #67

Open
slokhorst opened this issue Jan 5, 2019 · 2 comments
Open

Poet fails with HTTP Error 404 #67

slokhorst opened this issue Jan 5, 2019 · 2 comments

Comments

@slokhorst
Copy link

slokhorst commented Jan 5, 2019

I'm trying to create a Brew formula for Gajim. I have grabbed the gajim source and am trying to run poet, but it fails:

# setup venv
python3 -m venv venv
source venv/bin/activate
# install dependencies
pip install keyring nbxmpp pyOpenSSL pyasn1 pyobjc pillow idna precis-i18n certifi cssutils
# download and install gajim
curl -O https://gajim.org/downloads/1.1/gajim-1.1.1.tar.bz2
tar xf gajim-1.1.1.tar.bz2
cd gajim-1.1.1
python setup.py install
# install and run poet
pip install homebrew-pypi-poet
poet -f gajim

Now poet fails with the following output:

Traceback (most recent call last):
  File "/Users/sebas/venv/bin/poet", line 11, in <module>
    sys.exit(main())
  File "/Users/sebas/venv/lib/python3.7/site-packages/poet/poet.py", line 243, in main
    print(formula_for(args.formula, args.also))
  File "/Users/sebas/venv/lib/python3.7/site-packages/poet/poet.py", line 161, in formula_for
    nodes = merge_graphs(make_graph(p) for p in [package] + also)
  File "/Users/sebas/venv/lib/python3.7/site-packages/poet/poet.py", line 187, in merge_graphs
    for g in graphs:
  File "/Users/sebas/venv/lib/python3.7/site-packages/poet/poet.py", line 161, in <genexpr>
    nodes = merge_graphs(make_graph(p) for p in [package] + also)
  File "/Users/sebas/venv/lib/python3.7/site-packages/poet/poet.py", line 147, in make_graph
    package_data = research_package(package, dependencies[package]['version'])
  File "/Users/sebas/venv/lib/python3.7/site-packages/poet/poet.py", line 80, in research_package
    with closing(urlopen("https://pypi.io/pypi/{}/json".format(name))) as f:
  File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 641, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 563, in error
    result = self._call_chain(*args)
  File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 503, in _call_chain
    result = func(*args)
  File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 755, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 641, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 563, in error
    result = self._call_chain(*args)
  File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 503, in _call_chain
    result = func(*args)
  File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 755, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 641, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 503, in _call_chain
    result = func(*args)
  File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

Am I using poet right? Any idea what's going wrong?

@tobywf
Copy link

tobywf commented Jan 29, 2019

I also got this. Due to how make_graph currently works, the package is being included in the dependencies, and therefore has to be on PyPI. This is somewhat incorrect, since the local package might have different deps, but also means it doesn't work with unreleased packages, making testing hard.

A quick fix is to change line 131 in poet.py:

- ignore = ['argparse', 'pip', 'setuptools', 'wsgiref']
+ ignore = ['argparse', 'pip', 'setuptools', 'wsgiref', pkg]

Edit: That change above might unblock you, but can break other scenarios. Sounds like this is a known problem, and #28 would solve this issue.

@jasonkarns
Copy link

I'm getting the same error. I'm not a python developer, but I'm familiar with homebrew. I'm attempting to create a tap+formula for a python utility written at my current client. The utility is not published anywhere. (It is installed via: pip install git+ssh://[email protected]/client/tool.git)

Knowing next to nothing about python, pip or how it handles dependencies (other than that it's seemingly perpetually painful?), what would be recommended next steps?

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

No branches or pull requests

3 participants