Code Monkey home page Code Monkey logo

yolk's Introduction

yolk 0.4.3

You can install yolk with pip install yolk or via your distro's package manager, if available.

As of 0.0.7 yolk is in Gentoo's Portage tree as dev-python/yolk and a plugin for Portage named dev-python/yolk-portage. The portage plugin shows you which Python packages were installed via Portage and which were installed directly with pip (or easy_install). Check out that plugin and make one for your favorite distro. It's a great way to find Python cruft.

Yolk is a Python tool for obtaining information about installed Python packages and querying packages avilable on PyPI (Python Package Index).

You can see which packages are active, non-active or in development mode and show you which have newer versions available by querying PyPI.

Usage Examples:

$ yolk -l
     List all installed Python packages

$ yolk -a
     List only the activated packages installed (Activated packages are normal packages on sys.path you can import)

$ yolk -n
     List only the non-activated (--multi-version) packages installed

$ yolk -l -f License,Author nose==1.0
     Show the license and author for version 1.0 of the package `nose`

$ yolk --entry-map nose
     Show entry map for the nose package

$ yolk --entry-points nose.plugins
     Show all setuptools entry points for nose.plugins

These options query PyPI:

$ yolk -U pkg_name
     Shows if an update for pkg_name is available by querying PyPI

$ yolk -U
     Checks PyPI to see if any installed Python packages have updates available.

$ yolk -F Paste
     Download source tarball for latest version of Paste to your current directory

$ yolk -F Paste -T svn
     Do a subversion checkout for Paste to a directory named Paste_svn in your current directory.

$ yolk -L 2
     Show list of CheeseShop releases in the last two hours

$ yolk -C 2
     Show detailed list of changes in the CheeseShop in the last two hours

$ yolk -M Paste==1.0
     Show all the metadata for Paste version 1.0

$ yolk -M Paste
     Show all the metadata for the latest version of Paste listed on PyPi

$ yolk -D cheesecake
     Show all (source, egg, svn) URL's for the latest version of cheesecake packages

 $ yolk -T source -D cheesecake
     Show only source code releases for cheesecake

 $ yolk -H twisted
     Launches your web browser at Twisted's home page
  • Use yolk inside your virtualenv to see which packages are installed.
  • Upgrade all installed Python packages:

Warning: You only want to do this inside a virtualenv. If you're using Linux, use your package manager to install Python packages globally whenever possible. Think twice before upgrading all packages system-wide on OSX.

$ pip install -U yolk -U | awk '{print $1}'

0.4.3: Added missing documentation and license files

0.4.2: Fix for -C when an integer isn't supplied

Fix for --entry-map from Jesus Rivero (Neurogeek) [email protected]. Thanks, Jesus!

Switch to BSD license from GPL-2

0.4.1: Fix for -f fields

Add check for integer with -L

0.4.0: Added http proxy support for XML-RPC

Added case-insensitive search for -f

Non-existent packages with -S no longer show entire index (bug was with PyPI)

Fixed exception when package has no metadata

0.3.0: Added -C and -L options for new PyPI XML-RPC methods changelog and updated_releases

Always check package name cache on disk before querying PyPi to see if a package exists and has proper case.

Added -F option to download source, egg or subversion checkouts.

Removed -L RSS feed option because the new updated_releases XML-RPC method is much nicer

Fixed '-D -T egg' so it won't return source if no egg is available

Major refactoring.

Removed dependency on elementtree

0.2.0: Added 'svn' type for -T

A kablillion bug fixes

0.1.0: You can now use -f with -M

More accurate URL's with -D using pip

Ability to check for a single package with -U

Uses std Python logging module

Fixed bug so we have correct exit codes

0.0.7: New options: --entry-map and -entry-points

Improved results with --download-links

New plugin system. First plugin available: yolk-portage for Gentoo Linux.

-v option is now --version

-v is now a new option: --verbose

Many bug fixes.

0.0.6: Fix Windows problem which showed all pkgs in develop mode

on some systems.

Fix bad interpreter shebang in rss_feed.py example

Start using nose unit tests from setup.py

Use restructuredtext in docstrings

0.0.5: Show packages installed in 'development' mode.

Improved output of -l, -n and -a. You can get the previous (<=0.0.4) output by adding '-f Summary'

More sanity checking for various options.

Don't throw exception if there is no package metadata

0.0.4: Added -U option to query PyPI for new versions of packages you have
installed
  • setuptools (Distribute preferred)
  • elementtree (For RSS feed option extra_requires [RSS]) (included in Python >=2.5)

yolk's People

Contributors

cakebread avatar mbologna avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yolk's Issues

Detect upgrade version

I'm not able to detect the new version of Django package
My tests:

(devel)a427137@prometeo:/src/km/dj/gfor2$ yolk -S name=Django | grep (1.4)
Django (1.4):
(devel)a427137@prometeo:
/src/km/dj/gfor2$ yolk -l | grep Django
Django - 1.3.1 - active
(devel)a427137@prometeo:/src/km/dj/gfor2$ yolk -U
No newer packages found at The Cheese Shop
(devel)a427137@prometeo:
/src/km/dj/gfor2$ yolk -U Django
You have the latest version installed.

Debian wheezy/sid
Linux prometeo 3.2.0-2-amd64 #1 SMP Tue Mar 20 18:36:37 UTC 2012
Two Intel Unknown 1200MHz processors, 7182.27 total bogomips, 3956M RAM
System library 2.13.0
Yolk 0.4.3
Python 2.7.2
Vitualenv 1.7

Yolk works fine previously (just few days before I upgraded some packages)

xmlrpc bug in python 2.7.1

There is a bug in the with xmlrpclib.py in python 2.7.1:

File "/usr/lib/python2.7/site-packages/yolk/pypi.py", line 65, in request
  return(self.parse_response(fhandle)) 
File "/usr/lib64/python2.7/xmlrpclib.py", line 1449, in parse_response 
  if response.getheader("Content-Encoding", "") == "gzip":  
AttributeError: addinfourl instance has no attribute 'getheader' 

Here is somebody else's patch:
https://bitbucket.org/dbinit/yolk/src/5f679466e2d0/yolk/pypi.py

yolk.__main__ missing to call package via "-m

ATM if you try to invoke yolk with the launcher:

py -2 -m yolk numpy
you will get:

C:\Python27\python.exe: No module named yolk.__main__; 'yolk' is a package and cannot be directly executed

Support multiple python versions

I'd like yolk behaving like pip when multiple python versions are available. Right now if I have python 2.7 and python 3.3 I cannot use yolk to list packages in each of them.

I suppose that having yolk2.7 and yolk3.3 would be a good alternative.

Syntax Error: Invalid Syntax on line 262 of python36\lib\site-packages\yolk\cli.py

Traceback (most recent call last):
File "C:\Users\fpatel\AppData\Local\Programs\Python\Python36\Scripts\yolk-script.py", line 11, in
load_entry_point('yolk==0.4.3', 'console_scripts', 'yolk')()
File "c:\users\fpatel\appdata\local\programs\python\python36\lib\site-packages\pkg_resources_init_.py", line 480, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "c:\users\fpatel\appdata\local\programs\python\python36\lib\site-packages\pkg_resources_init_.py", line 2693, in load_entry_point
return ep.load()
File "c:\users\fpatel\appdata\local\programs\python\python36\lib\site-packages\pkg_resources_init_.py", line 2324, in load
return self.resolve()
File "c:\users\fpatel\appdata\local\programs\python\python36\lib\site-packages\pkg_resources_init_.py", line 2330, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "c:\users\fpatel\appdata\local\programs\python\python36\lib\site-packages\yolk\cli.py", line 262
print " %s %s (%s)" % (project_name, dist.version,

Add the notice about unmaintained project

According to #27, this project is no longer maintained. I suggest adding the corresponding notice to README.md and redirect developers to yolk3d, if you do not want to receive such pull requests and issues in the future.
If you want, I can prepare this very last pull request myself. This is essential, dude.

yolk -U raises HTTPTooManyRequests error

Simply after I enter yolk -U into the command line, it stay quite for a while and then an error is raised, showing:

$ yolk -U
Checking you-get
Traceback (most recent call last):
  File "~/.local/bin/yolk", line 8, in <module>
    sys.exit(main())
  File "~/.local/lib/python3.8/site-packages/yolk/cli.py", line 1171, in main
    my_yolk.run()
  File "~/.local/lib/python3.8/site-packages/yolk/cli.py", line 224, in run
    return getattr(self, action)()
  File "~/.local/lib/python3.8/site-packages/yolk/cli.py", line 254, in show_updates
    for (project_name, version, newest) in _updates(
  File "~/.local/lib/python3.8/site-packages/yolk/cli.py", line 1117, in _updates
    results = pool.map(worker_function, names)
  File "/usr/lib/python3.8/multiprocessing/pool.py", line 364, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/usr/lib/python3.8/multiprocessing/pool.py", line 771, in get
    raise self._value
  File "/usr/lib/python3.8/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/usr/lib/python3.8/multiprocessing/pool.py", line 48, in mapstar
    return list(map(*args))
  File "~/.local/lib/python3.8/site-packages/yolk/cli.py", line 1109, in worker_function
    (project_name, versions) = pypi.query_versions_pypi(
  File "~/.local/lib/python3.8/site-packages/yolk/pypi.py", line 147, in query_versions_pypi
    versions = self.package_releases(pypi_pkg)
  File "~/.local/lib/python3.8/site-packages/yolk/pypi.py", line 197, in package_releases
    return self.xmlrpc.package_releases(package_name)
  File "/usr/lib/python3.8/xmlrpc/client.py", line 1109, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python3.8/xmlrpc/client.py", line 1450, in __request
    response = self.__transport.request(
  File "~/.local/lib/python3.8/site-packages/yolk/pypi.py", line 67, in request
    return self.parse_response(fhandle)
  File "/usr/lib/python3.8/xmlrpc/client.py", line 1341, in parse_response
    return u.close()
  File "/usr/lib/python3.8/xmlrpc/client.py", line 655, in close
    raise Fault(**self._stack[0])
xmlrpc.client.Fault: <Fault -32500: 'HTTPTooManyRequests: The action could not be performed because there were too many requests by the client. Limit may reset in 1 seconds.'>

show location of packages

It would be cool if there were some way to show where it found the packages. I don't see such a capability in the documentation.

In the class Distributions (defined in yolklib.py),in the method get_distributions(), the value of package.location is what we want. I have not looked at the whole system enough to know how to get this information to the report, though.

https needed on pypi

yolk -U kontocheck
dies with:
urllib2.HTTPError: HTTP Error 403: Must access using HTTPS instead of HTTP

I am using yolk version 0.4.3

Python 3.x

Thanks for the 0.4.3 update. Any chance you could build in 2to3 to the setup so that it works on both python 2.x and 3.x?

Docs missing from tarball

All of the doc files in the repository, including the license and man page, are missing in the tarball published on pypy.

Slow checking for updates

Hello,

yolk -U is very slow in my location (Poland), same goes for pip so I changed my mirror to http://f.pypi.python.org/simple (more mirrors: http://www.pypi-mirrors.org/ ).

In my pip.ini file (or pip.conf on Linux, http://www.pip-installer.org/en/latest/configuration.html#config-file ) I set:

[global]
index-url = http://f.pypi.python.org/simple

and now pip install is fast again.

Maybe yolk also can use default pip mirror for checking for updates?

Best regards,
Dobrosław Żybort

"development" mode issue

Yury Yurevich reported this:


Yolk doesn't cover the usecase when packages are installed in
non-default directory (and this directory in PYTHONPATH) -- yolk shows
such packages are installed in develop mode.

Attached patch corrects it.

Scan local directory

Interesting. Can yolk scan local directory to make a best guess about packages and versions and look up if they are up to date on PyPI? It is useful for scenarios where all project dependencies are committed to repository to avoid extra installing hassle.

Python 3.x not supported?

Traceback (most recent call last):
  File "/usr/bin/yolk", line 9, in <module>
    load_entry_point('yolk==0.4.3', 'console_scripts', 'yolk')()
  File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 558, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2682, in load_entry_point
    return ep.load()
  File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2355, in load
    return self.resolve()
  File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2361, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3.4/site-packages/yolk/cli.py", line 262
    print " %s %s (%s)" % (project_name, dist.version,
                      ^
SyntaxError: invalid syntax

yolk.__main__ missing to call package via "-m"

ATM if you try to invoke yolk with the launcher:

py -2 -m yolk numpy

you will get:

C:\Python27\python.exe: No module named yolk.main; 'yolk' is a package and cannot be directly executed

For compatibility it would awesome to make package callable just like any other tool package, eg, pip, pytest, pep8 etc etc

SyntaxError: invalid syntax

How can i fix it?

# yolk -V py2deb
Traceback (most recent call last):
  File "/usr/local/bin/yolk", line 7, in <module>
    from yolk.cli import main
  File "/usr/local/lib/python3.4/dist-packages/yolk/cli.py", line 262
    print " %s %s (%s)" % (project_name, dist.version,
                      ^
SyntaxError: invalid syntax

yolk-0.4.3 installed by pip3

Python 3 pickle error

I had installed yolk in a Python 3.2 virtualenv. Querying cheeseshop for a name, e.g.
yolk -S name=couch
results in this error:
File "/home/dm/myprojects/python3-env/lib/python3.2/site-packages/yolk/pypi.py", line 179, in query_cached_package_list
return pickle.load(open(self.pkg_cache_file, "r"))
TypeError: 'str' does not support the buffer interface

Solution:
Docs for pickle.load() state, file must return bytes. Saying "rb" instead of "r" for open() seems to do the trick, Similarly, in line 185 say "wb" instead of "w".

Cannot import MessageDict

Hi

I am trying to use yolk to list the versions of google-cloud-pubsub but am getting the following errors:

fcaldas@lipexingest:~$ yolk -V google-cloud-pubsub                                                                                                                                                                 
Traceback (most recent call last):
  File "/usr/local/bin/yolk", line 7, in <module>
    from yolk.cli import main
  File "/usr/local/lib/python2.7/dist-packages/yolk/cli.py", line 29, in <module>
    import pkg_resources
  File "/home/fcaldas/google_appengine/pkg_resources/__init__.py", line 3038, in <module>
    @_call_aside
  File "/home/fcaldas/google_appengine/pkg_resources/__init__.py", line 3022, in _call_aside
    f(*args, **kwargs)
  File "/home/fcaldas/google_appengine/pkg_resources/__init__.py", line 3066, in _initialize_master_working_set
    for dist in working_set
  File "/home/fcaldas/google_appengine/pkg_resources/__init__.py", line 3066, in <genexpr>
    for dist in working_set
  File "/home/fcaldas/google_appengine/pkg_resources/__init__.py", line 2597, in activate
    declare_namespace(pkg)
  File "/home/fcaldas/google_appengine/pkg_resources/__init__.py", line 2165, in declare_namespace
    _handle_ns(packageName, path_item)
  File "/home/fcaldas/google_appengine/pkg_resources/__init__.py", line 2100, in _handle_ns
    loader.load_module(packageName)
  File "/usr/lib/python2.7/pkgutil.py", line 246, in load_module
    mod = imp.load_module(fullname, self.file, self.filename, self.etc)
  File "/home/fcaldas/google-cloud-sdk/platform/google_appengine/google/cloud/logging/__init__.py", line 21, in <module>
    from google.cloud.logging.client import Client
  File "/home/fcaldas/google-cloud-sdk/platform/google_appengine/google/cloud/logging/client.py", line 38, in <module>
    from google.cloud.logging.handlers import CloudLoggingHandler
  File "/home/fcaldas/google-cloud-sdk/platform/google_appengine/google/cloud/logging/handlers/__init__.py", line 17, in <module>
    from google.cloud.logging.handlers.app_engine import AppEngineHandler
  File "/home/fcaldas/google-cloud-sdk/platform/google_appengine/google/cloud/logging/handlers/app_engine.py", line 24, in <module>
    from google.cloud.logging.handlers.handlers import CloudLoggingHandler
  File "/home/fcaldas/google-cloud-sdk/platform/google_appengine/google/cloud/logging/handlers/handlers.py", line 20, in <module>
    from google.cloud.logging.logger import _GLOBAL_RESOURCE
  File "/home/fcaldas/google-cloud-sdk/platform/google_appengine/google/cloud/logging/logger.py", line 17, in <module>
    from google.protobuf.json_format import MessageToDict
ImportError: cannot import name MessageToDict

Protobuf is currently installed and in version 3.4, any ideas on how to fix this?

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.