Giter Site home page Giter Site logo

changelogs's Introduction

Documentation Status Updates

A changelog finder and parser with command line interface for packages available on pypi, npm, rubygems and launchpad.net. Originally developed for pyup.io.

Installation

To install changelogs, run this command in your terminal:

$ pip install changelogs

Usage

To use changelogs in a Python project:

import changelogs

logs = changelogs.get("flask")
logs = changelogs.get("babel", vendor="npm")
logs = changelogs.get("bundler", vendor="npm")

Or, from the command line:

changelogs flask
changelogs babel npm
changelogs bundler gem

If you are on macOS, you can chain the open command:

changelogs babel npm >> babel.log && open babel.log

About

When trying to get a changelog for a given package, there are a bunch of problems:

  • There is no central place to store a changelog. If a project has a changelog, it's most likely somewhere in the git repo at all kinds of different places. This makes it hard to find.
  • The package index meta data often has no direct link to the git repo. This makes the repo hard to find.
  • There is no changelog standard. Everyone uses a different approach. This makes it hard to parse.

This project is trying to solve this by:

  • first querying the package vendor for package meta data like the homepage or docs URL.
  • if the meta data doesn't contain a valid URL to a repo, visit all available URLs and scrape them to find one.
  • if there is a valid repo URL, visit the repo and look for possible changelogs like Changes.txt, NEWS.md or history.rst.
  • fetch the content and somewhat try to parse it.

changelogs's People

Contributors

alexkiro avatar cakemanny avatar cclauss avatar harlekeyn avatar jayfk avatar jwomers avatar lb1c avatar rafaelpivato avatar rodrigobdz avatar sch227 avatar sneakypete81 avatar vepiphyte avatar yeisonvargasf 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

changelogs's Issues

requests.exceptions.MissingSchema: Invalid URL

Package: como

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/code.py", line 91, in runcode
    exec(code, self.locals)
  File "<console>", line 3, in <module>
  File "/usr/local/lib/python3.6/site-packages/celery/local.py", line 191, in __call__
    return self._get_current_object()(*a, **kw)
  File "/usr/local/lib/python3.6/site-packages/celery_once/tasks.py", line 134, in __call__
    return super(QueueOnce, self).__call__(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/celery/app/task.py", line 379, in __call__
    return self.run(*args, **kwargs)
  File "/app/pyupio/packages/tasks.py", line 295, in sync_changelog
    raise self.retry(exc=e, countdown=60)
  File "/usr/local/lib/python3.6/site-packages/celery/app/task.py", line 652, in retry
    raise_with_context(exc or Retry('Task can be retried', None))
  File "/app/pyupio/packages/tasks.py", line 277, in sync_changelog
    d['parsed_changelog'] = changelogs.get(name=name, functions=fns)
  File "/usr/local/lib/python3.6/site-packages/changelogs/changelogs.py", line 168, in get
    find_changelogs_fn=fns["find_changelogs"]
  File "/app/pyupio/packages/tasks.py", line 265, in patched_get_urls
    find_changelogs_fn=find_changelogs_fn, **kwargs
  File "/usr/local/lib/python3.6/site-packages/changelogs/pypi.py", line 63, in get_urls
    candidates=candidates)
  File "/usr/local/lib/python3.6/site-packages/changelogs/finder.py", line 208, in find_changelogs
    repos = set(find_repo_urls(session, name, candidates))
  File "/usr/local/lib/python3.6/site-packages/changelogs/finder.py", line 71, in find_repo_urls
    resp = session.get(_url)
  File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 501, in get
    return self.request('GET', url, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/opbeat/instrumentation/packages/base.py", line 63, in __call__
    args, kwargs)
  File "/usr/local/lib/python3.6/site-packages/opbeat/instrumentation/packages/base.py", line 220, in call_if_sampling
    return wrapped(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 474, in request
    prep = self.prepare_request(req)
  File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 407, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/usr/local/lib/python3.6/site-packages/requests/models.py", line 302, in prepare
    self.prepare_url(url, params)
  File "/usr/local/lib/python3.6/site-packages/requests/models.py", line 382, in prepare_url
    raise MissingSchema(error)
requests.exceptions.MissingSchema: Invalid URL 'como.cwoebker.com': No schema supplied. Perhaps you meant http://como.cwoebker.com?

AttributeError: 'NoneType' object has no attribute 'xpath'

Package: django-selenium-test-runner

AttributeError: 'NoneType' object has no attribute 'xpath'
  File "celery/app/trace.py", line 367, in trace_task
    R = retval = fun(*args, **kwargs)
  File "celery_once/tasks.py", line 134, in __call__
    return super(QueueOnce, self).__call__(*args, **kwargs)
  File "celery/app/trace.py", line 622, in __protected_call__
    return self.run(*args, **kwargs)
  File "pyupio/packages/tasks.py", line 270, in sync_changelog
    d['parsed_changelog'] = changelogs.get(name=name, functions=fns)
  File "changelogs/changelogs.py", line 168, in get
    find_changelogs_fn=fns["find_changelogs"]
  File "pyupio/packages/tasks.py", line 257, in patched_get_urls
    d['urls'], d['repos'] = get_urls(session, name, data, find_changelogs_fn, **kwargs)
  File "changelogs/pypi.py", line 78, in get_urls
    candidates=new_candidates)
  File "changelogs/finder.py", line 208, in find_changelogs
    repos = set(find_repo_urls(session, name, candidates))
  File "changelogs/finder.py", line 74, in find_repo_urls
    for link in frozenset([str(l) for l in tree.xpath("//a/@href")]):

XMLSyntaxError: line 3: b'htmlParseStartTag: invalid element name'

Package: gcloud-storage-api

XMLSyntaxError: line 3: b'htmlParseStartTag: invalid element name'
  File "celery/app/trace.py", line 367, in trace_task
    R = retval = fun(*args, **kwargs)
  File "celery_once/tasks.py", line 134, in __call__
    return super(QueueOnce, self).__call__(*args, **kwargs)
  File "celery/app/trace.py", line 622, in __protected_call__
    return self.run(*args, **kwargs)
  File "pyupio/packages/tasks.py", line 270, in sync_changelog
    d['parsed_changelog'] = changelogs.get(name=name, functions=fns)
  File "changelogs/changelogs.py", line 168, in get
    find_changelogs_fn=fns["find_changelogs"]
  File "pyupio/packages/tasks.py", line 257, in patched_get_urls
    d['urls'], d['repos'] = get_urls(session, name, data, find_changelogs_fn, **kwargs)
  File "changelogs/pypi.py", line 78, in get_urls
    candidates=new_candidates)
  File "changelogs/finder.py", line 208, in find_changelogs
    repos = set(find_repo_urls(session, name, candidates))
  File "changelogs/finder.py", line 73, in find_repo_urls
    tree = etree.HTML(resp.content)
  File "src/lxml/lxml.etree.pyx", line 3161, in lxml.etree.HTML (src/lxml/lxml.etree.c:77178)
  File "src/lxml/parser.pxi", line 1830, in lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:116674)
  File "src/lxml/parser.pxi", line 1718, in lxml.etree._parseDoc (src/lxml/lxml.etree.c:115324)
  File "src/lxml/parser.pxi", line 1090, in lxml.etree._BaseParser._parseDoc (src/lxml/lxml.etree.c:109723)
  File "src/lxml/parser.pxi", line 584, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:103584)
  File "src/lxml/parser.pxi", line 694, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:105238)
  File "src/lxml/parser.pxi", line 633, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:104323)

Initial Update

Hi ๐Ÿ‘Š

This is my first visit to this fine repo, but it seems you have been working hard to keep all dependencies updated so far.

Once you have closed this issue, I'll create seperate pull requests for every update as soon as I find one.

That's it for now!

Happy merging! ๐Ÿค–

Use PyPI API to keep version lists up to date

In a few cases, the changelogs page for a package showed an out of date version as the "latest", presumably since that was the last version for which a changelog could be found.

In cases where no new changelog could be found, I think it would be less confusing if empty placeholders were added for the newer releases, using PyPI as the source of truth for which versions exist.

For example for https://pyup.io/changelogs/graphene/ :

v2.0:
unable to load changelog! (file issue link)

v1.0.5

  • Improved behavior of NdbConnectionField when ...

Linking to github compare view

For github-hosted projects, there are usually tagged version numbers. For certain projects we like to review the code difference based off of these tagged versions, so having a direct link to the github compare view for version updates would be useful (especially when there's no changelog)

For example, here is a link that compares Django 1.10.1 to 1.10.2's release.

pyup not finding changelog

  • changelogger version: 0.5.0
  • Python version: 3.5.2
  • Operating System: macOS Sierra

Description

I'm maintain a couple of PyPI packages (webassets-elm, for example) but everytime pyup opens a PR (in repositories that use my package) it says it can't find any changelog.

What I Did

I installed changelogs and tested it, but always had an empty stdout. My changelog is the CHANGELOG file in the root of the repo, but I tried renaming and moving it all around (no success):

$ ls -laGh | grep CHANGELOG
-rw-r--r--@  1 cuducos  staff   362B Jan 27 13:17 CHANGELOG
$ changelogs webassets_elm
$ git mv CHANGELOG changelog.md
$ changelogs webassets_elm
$ gt mv changelog.md changelog
$ changelogs webassets_elm
$ git mv changelog.md webassets_elm/CHANGELOG
$ changelogs webassets_elm
$

Am I missing anything or is this a bug?

TypeError: string indices must be integers

Package: monasca-events-api

TypeError: string indices must be integers
  File "celery/app/trace.py", line 367, in trace_task
    R = retval = fun(*args, **kwargs)
  File "celery_once/tasks.py", line 134, in __call__
    return super(QueueOnce, self).__call__(*args, **kwargs)
  File "celery/app/trace.py", line 622, in __protected_call__
    return self.run(*args, **kwargs)
  File "pyupio/packages/tasks.py", line 270, in sync_changelog
    d['parsed_changelog'] = changelogs.get(name=name, functions=fns)
  File "changelogs/changelogs.py", line 189, in get
    _depth=_depth+1)
  File "changelogs/changelogs.py", line 177, in get
    get_head_fn=fns["get_head"]
  File "changelogs/launchpad.py", line 79, in parse
    return {e["version"]: e["changelog"] for e in content["entries"]

TypeError: expected string or bytes-like object

Package: ots

TypeError: expected string or bytes-like object
  File "celery/app/trace.py", line 367, in trace_task
    R = retval = fun(*args, **kwargs)
  File "celery_once/tasks.py", line 134, in __call__
    return super(QueueOnce, self).__call__(*args, **kwargs)
  File "celery/app/trace.py", line 622, in __protected_call__
    return self.run(*args, **kwargs)
  File "pyupio/packages/tasks.py", line 270, in sync_changelog
    d['parsed_changelog'] = changelogs.get(name=name, functions=fns)
  File "changelogs/changelogs.py", line 168, in get
    find_changelogs_fn=fns["find_changelogs"]
  File "pyupio/packages/tasks.py", line 257, in patched_get_urls
    d['urls'], d['repos'] = get_urls(session, name, data, find_changelogs_fn, **kwargs)
  File "changelogs/pypi.py", line 76, in get_urls
    new_candidates = changelogs.url_re.findall(data["info"]["description"])

pylib changelog

pyup.io finds a changelog for pylib (aka py), but it doesn't contain the newest 1.4.33 release. Maybe it picks up the changelog from before the BitBucket -> GitHub migration of py somehow?

The official changelog is this one or this one FWIW, and they contain 1.4.33.

XMLSyntaxError: line 738: b'Tag path invalid'

Package: 'gomobile.xhtmlmp'

XMLSyntaxError: line 738: b'Tag path invalid'
  File "celery/app/trace.py", line 367, in trace_task
    R = retval = fun(*args, **kwargs)
  File "celery_once/tasks.py", line 134, in __call__
    return super(QueueOnce, self).__call__(*args, **kwargs)
  File "celery/app/trace.py", line 622, in __protected_call__
    return self.run(*args, **kwargs)
  File "pyupio/packages/tasks.py", line 270, in sync_changelog
    d['parsed_changelog'] = changelogs.get(name=name, functions=fns)
  File "changelogs/changelogs.py", line 168, in get
    find_changelogs_fn=fns["find_changelogs"]
  File "pyupio/packages/tasks.py", line 257, in patched_get_urls
    d['urls'], d['repos'] = get_urls(session, name, data, find_changelogs_fn, **kwargs)
  File "changelogs/pypi.py", line 63, in get_urls
    candidates=candidates)
  File "changelogs/finder.py", line 208, in find_changelogs
    repos = set(find_repo_urls(session, name, candidates))
  File "changelogs/finder.py", line 73, in find_repo_urls
    tree = etree.HTML(resp.content)
  File "src/lxml/lxml.etree.pyx", line 3161, in lxml.etree.HTML (src/lxml/lxml.etree.c:77178)
  File "src/lxml/parser.pxi", line 1830, in lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:116674)
  File "src/lxml/parser.pxi", line 1718, in lxml.etree._parseDoc (src/lxml/lxml.etree.c:115324)
  File "src/lxml/parser.pxi", line 1090, in lxml.etree._BaseParser._parseDoc (src/lxml/lxml.etree.c:109723)
  File "src/lxml/parser.pxi", line 584, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:103584)
  File "src/lxml/parser.pxi", line 694, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:105238)
  File "src/lxml/parser.pxi", line 633, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:104323)

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.