Giter VIP home page Giter VIP logo

devpi-findlinks's Introduction

devpi-findlinks: find-links view for devpi-server

This plugin adds a new view to each index which lists all packages uploaded on that index or any index inherited except root/pypi.

Installation

devpi-findlinks needs to be installed alongside devpi-server.

You can install it with:

pip install devpi-findlinks

There is no configuration needed as devpi-server will automatically discover the plugin through calling hooks using the setuptools entry points mechanism.

Usage

In a default installation with a user named user1 which has an index named dev, the view would be accessible at http://localhost:3141/user1/dev/+findlinks.

Use such an url with the --find-links option of pip or easy_install.

The view uses absolute URLs, to make it possible to use this view via proxy at any location for migration of old environments.

devpi-findlinks's People

Contributors

fschulze avatar msabramo avatar ufo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

devpi-findlinks's Issues

Support more recent devpi-server version (which uses sha256 instead of md5)

Hi,

we're using devpi-server-2.2.2:
File ".../lib/python2.7/site-packages/devpi_findlinks/main.py", line 50, in findlinks_view
elif entry.md5:
AttributeError: unreadable attribute

I bluntly changed that line(s) of code to:
elif hasattr(entry, "sha256") and entry.sha256:

Well, the exception is gone, but there still aren't any checksums in the generated hyperlinks :\

Regards

error with link.eggfragment with devpi version 5.10

When asking for /{user}/{index}/+findlinks I get the following error:

`2019-11-21 19:44:52,512 ERROR Exception while serving /ploneteam/prod/+findlinks
Traceback (most recent call last):
File "/Dades/pypi/venv_pypi/lib/python3.6/site-packages/pyramid/tweens.py", line 13, in _error_handler
response = request.invoke_exception_view(exc_info)
File "/Dades/pypi/venv_pypi/lib/python3.6/site-packages/pyramid/view.py", line 779, in invoke_exception_view
raise HTTPNotFound
pyramid.httpexceptions.HTTPNotFound: The resource could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Dades/pypi/venv_pypi/lib/python3.6/site-packages/waitress/channel.py", line 356, in service
task.service()
File "/Dades/pypi/venv_pypi/lib/python3.6/site-packages/waitress/task.py", line 172, in service
self.execute()
File "/Dades/pypi/venv_pypi/lib/python3.6/site-packages/waitress/task.py", line 440, in execute
app_iter = self.channel.server.application(environ, start_response)
File "/Dades/pypi/venv_pypi/lib/python3.6/site-packages/devpi_server/views.py", line 151, in call
return self.app(environ, start_response)
File "/Dades/pypi/venv_pypi/lib/python3.6/site-packages/pyramid/router.py", line 270, in call
response = self.execution_policy(environ, self)
File "/Dades/pypi/venv_pypi/lib/python3.6/site-packages/pyramid/router.py", line 279, in default_execution_policy
return request.invoke_exception_view(reraise=True)
File "/Dades/pypi/venv_pypi/lib/python3.6/site-packages/pyramid/view.py", line 778, in invoke_exception_view
reraise_(*exc_info)
File "/Dades/pypi/venv_pypi/lib/python3.6/site-packages/pyramid/compat.py", line 179, in reraise
raise value
File "/Dades/pypi/venv_pypi/lib/python3.6/site-packages/pyramid/router.py", line 277, in default_execution_policy
return router.invoke_request(request)
File "/Dades/pypi/venv_pypi/lib/python3.6/site-packages/pyramid/router.py", line 249, in invoke_request
response = handle_request(request)
File "/Dades/pypi/venv_pypi/lib/python3.6/site-packages/devpi_server/views.py", line 175, in request_log_handler
response = handler(request)
File "/Dades/pypi/venv_pypi/lib/python3.6/site-packages/devpi_server/views.py", line 211, in request_tx_handler
response = handler(request)
File "/Dades/pypi/venv_pypi/lib/python3.6/site-packages/pyramid/tweens.py", line 43, in excview_tween
response = _error_handler(request, exc)
File "/Dades/pypi/venv_pypi/lib/python3.6/site-packages/pyramid/tweens.py", line 17, in _error_handler
reraise(*exc_info)
File "/Dades/pypi/venv_pypi/lib/python3.6/site-packages/pyramid/compat.py", line 179, in reraise
raise value
File "/Dades/pypi/venv_pypi/lib/python3.6/site-packages/pyramid/tweens.py", line 41, in excview_tween
response = handler(request)
File "/Dades/pypi/venv_pypi/lib/python3.6/site-packages/pyramid/router.py", line 148, in handle_request
registry, request, context, context_iface, view_name
File "/Dades/pypi/venv_pypi/lib/python3.6/site-packages/pyramid/view.py", line 667, in _call_view
response = view_callable(context, request)
File "/Dades/pypi/venv_pypi/lib/python3.6/site-packages/pyramid/config/views.py", line 188, in attr_view
return view(context, request)
File "/Dades/pypi/venv_pypi/lib/python3.6/site-packages/pyramid/config/views.py", line 214, in predicate_wrapper
return view(context, request)
File "/Dades/pypi/venv_pypi/lib/python3.6/site-packages/pyramid/viewderivers.py", line 401, in viewresult_to_response
result = view(context, request)
File "/Dades/pypi/venv_pypi/lib/python3.6/site-packages/devpi_findlinks/main.py", line 40, in findlinks_view
if link.eggfragment:
File "/Dades/pypi/venv_pypi/lib/python3.6/site-packages/devpi_server/model.py", line 1243, in getattr
raise AttributeError(name)
AttributeError: eggfragment
`
ELink object doesn't have eggfragment property.

As a workaround I modified devpi_findlinks/main.py lines 40+
key = link.basename
# if link.eggfragment:
# key = link.eggfragment
# else:
# key = link.basename

AttributeError on list_projectnames_perstage

When using the +findlinks view with devpi-server 4.1.0 I am getting the following traceback:

Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/waitress/channel.py", line 338, in service
task.service()
File "/usr/local/lib/python2.7/dist-packages/waitress/task.py", line 169, in service
self.execute()
File "/usr/local/lib/python2.7/dist-packages/waitress/task.py", line 399, in execute
app_iter = self.channel.server.application(env, start_response)
File "/usr/local/lib/python2.7/dist-packages/devpi_server/views.py", line 146, in call
return self.app(environ, start_response)
File "/usr/local/lib/python2.7/dist-packages/pyramid/router.py", line 236, in call
response = self.invoke_subrequest(request, use_tweens=True)
File "/usr/local/lib/python2.7/dist-packages/pyramid/router.py", line 211, in invoke_subrequest
response = handle_request(request)
File "/usr/local/lib/python2.7/dist-packages/devpi_server/views.py", line 169, in request_log_handler
response = handler(request)
File "/usr/local/lib/python2.7/dist-packages/devpi_server/views.py", line 204, in request_tx_handler
response = handler(request)
File "/usr/local/lib/python2.7/dist-packages/pyramid/tweens.py", line 62, in excview_tween
reraise(_attrs['exc_info'])
File "/usr/local/lib/python2.7/dist-packages/pyramid/tweens.py", line 22, in excview_tween
response = handler(request)
File "/usr/local/lib/python2.7/dist-packages/pyramid/router.py", line 158, in handle_request
view_name
File "/usr/local/lib/python2.7/dist-packages/pyramid/view.py", line 547, in call_view
response = view_callable(context, request)
File "/usr/local/lib/python2.7/dist-packages/pyramid/viewderivers.py", line 393, in attr_view
return view(context, request)
File "/usr/local/lib/python2.7/dist-packages/pyramid/viewderivers.py", line 371, in predicate_wrapper
return view(context, request)
File "/usr/local/lib/python2.7/dist-packages/pyramid/viewderivers.py", line 413, in viewresult_to_response
result = view(context, request)
File "/usr/local/lib/python2.7/dist-packages/devpi_findlinks/main.py", line 25, in findlinks_view
for stage, names in context.stage.op_sro("list_projectnames_perstage"):
File "/usr/local/lib/python2.7/dist-packages/devpi_server/model.py", line 512, in op_sro
yield stage, getattr(stage, opname)(
*kw)
AttributeError: 'PrivateStage' object has no attribute 'list_projectnames_perstage'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.