Commit cbbf7cd4 authored by SVN-Git Migration's avatar SVN-Git Migration

Imported Upstream version 1.8.0

parent f590b12e
*.png diff=imgdiff
dist/
objects.dot
objgraph.egg-info/
tmp/
.coverage
_build/
tags
build/
temp/
__pycache__/
.tox/
.toxbox/
*.py[co]
language: python
python:
- 2.6
- 2.7
- 3.2
- 3.3
install:
- sudo apt-get install graphviz
script:
- python tests.py
notifications:
email: false
......@@ -3,6 +3,24 @@ Changes
.. currentmodule:: objgraph
1.8.0 (2014-02-13)
------------------
- Moved to GitHub.
- Python 3.4 support (`LP#1270872 <http://launchpad.net/bugs/1270872>`_).
- New function: :func:`is_proper_module`.
- New ``shortnames`` argument for :func:`typestats`, :func:`most_common_types`,
:func:`show_most_common_types`, :func:`show_growth`, :func:`show_refs`,
and :func:`show_backrefs`.
:func:`count` and :func:`by_type` accept fully-qualified type names now.
Fixes `issue 4 <https://github.com/mgedmin/objgraph/issues/4>`_.
1.7.2 (2012-10-23)
------------------
......@@ -80,7 +98,7 @@ Changes
- Avoid test failures in uncollectable-garbage.txt (fixes `LP#686731
<http://launchpad.net/bugs/686731>`_).
- Added HACKING.txt.
- Added HACKING.txt (later renamed to HACKING.rst).
1.5.0 (2010-12-05)
......
......@@ -5,7 +5,7 @@ Hacking on objgraph
Start by geting the latest source with ::
bzr branch lp:objgraph
git clone https://github.com/mgedmin/objgraph
Run the test suite with ::
......@@ -21,13 +21,11 @@ e.g. by running ``make images`` and eyeballing the results (`imgdiff
Sending me patches
------------------
Bazaar branches and merge proposals are probably the best way to send me
patches. Or just attach the pathces to a bug in Launchpad. Or email them
to <marius@gedmin.as>.
GitHub pull requests are probably the best way to send me patches. Or just
email them to <marius@gedmin.as>.
I'd appreciate `bugs in launchpad
<https://bugs.launchpad.net/objgraph/+filebug>`_ for each proposed change, be
it a bug or a feature request.
I'd appreciate `issues in GitHub <https://github.com/mgedmin/objgraph/issues>`_
for each proposed change, be it a bug or a feature request.
Supported Python versions
......@@ -39,14 +37,16 @@ You can run the test suite for all supported Python versions with ::
make test-all-pythons
or with `detox <http://pypi.python.org/pypi/detox>`_.
or with `detox <http://pypi.python.org/pypi/detox>`_ (which will be faster,
since it runs the tests in parallel).
If a test fails, often the easiest way to debug is is to compare the output
visually ::
make images PYTHON=pythonX.Y
bzr diff --using imgdiff --diff-options="-H --eog" docs/image.png
bzr revert images/*.png images/*.dot
git config diff.imgdiff.command 'f() { imgdiff --eog -H $1 $2; }; f'
git diff docs/*.png
git checkout -- docs/*.png docs/*.dot
An easy way to get Pythons 2.4 through 2.7 (and 3.x) on Ubuntu is to use Felix
......@@ -93,19 +93,21 @@ To fully rebuild the documentation, run ::
make clean images docs
Please ``bzr revert`` the png files that haven't changed significantly. (Many
of the images include things like memory addresses which tend to change from
run to run.)
Please ``git checkout --`` the png files that haven't changed significantly.
(Many of the images include things like memory addresses which tend to change
from run to run.)
`imgdiff <http://pypi.python.org/pypi/imgdiff>`_ is useful for comparing the
images with their older versions::
bzr diff --using imgdiff docs/*.png
git config diff.imgdiff.command 'f() { imgdiff $1 $2; }; f'
git diff docs/*.png
It has a few options that may make the changes easier to see. I personally
like::
bzr diff --using imgdiff --diff-options="-H --eog" docs/*.png
git config diff.imgdiff.command 'f() { imgdiff --eog -H $1 $2; }; f'
git diff docs/*.png
When you add a new doctest file, remember to include it in ``docs/index.txt``.
......@@ -149,7 +151,7 @@ Then again this is useful for bits that *can't* use Sphinx extensions, like
the PyPI long description.
To preview the PyPI long description (which is generated by concatenating
``README.txt`` and ``CHANGES.txt``) with ``restview``, use this handy command::
``README.rst`` and ``CHANGES.rst``) with ``restview``, use this handy command::
make preview-pypi-description
......@@ -163,8 +165,8 @@ is tedious, and bash has tab-completion for makefile rules.
Making releases
---------------
You need write access to the PyPI package and to the Bazaar branch on
Launchpad. At the moment of this writing, this means you must be me.
You need write access to the PyPI package and to the Git branch on
GitHub. At the moment of this writing, this means you must be me.
Run ``make release`` and follow the instructions. It is safe to run this
command at any time: it never commits/pushes/uploads to PyPI, it just tells
......@@ -185,3 +187,6 @@ plugins installed. You can run ::
to be sure this is so, but it's not necessary -- ``make release`` will do this
every time.
(I've later written a standalone tool, `check-manifest
<https://pypi.python.org/pypi/check-manifest>`_ that can do this check for
every Python package.)
include Makefile
include *.txt
include *.rst
include tests.py
include tox.ini
include docs/*.txt
......@@ -7,3 +7,6 @@ include docs/*.dot
include docs/*.png
include docs/conf.py
include docs/_static/*.css
include .gitignore
include .gitattributes
include .travis.yml
PYTHON = python
FILE_WITH_VERSION = objgraph.py
FILE_WITH_CHANGELOG = CHANGES.txt
FILE_WITH_CHANGELOG = CHANGES.rst
VCS_STATUS = git status --porcelain
VCS_EXPORT = git archive --format=tar --prefix=tmp/tree/ HEAD | tar -xf -
VCS_DIFF_IMAGES = git diff docs/*.png
VCS_TAG = git tag
VCS_COMMIT_AND_PUSH = git commit -av -m "Post-release version bump" && git push && git push --tags
SUPPORTED_PYTHON_VERSIONS = 2.4 2.5 2.6 2.7 3.1 3.2 3.3
SUPPORTED_PYTHON_VERSIONS = 2.4 2.5 2.6 2.7 3.1 3.2 3.3 3.4
SPHINXOPTS =
SPHINXBUILD = sphinx-build
......@@ -62,13 +68,13 @@ dist:
.PHONY: distcheck
distcheck:
# Bit of a chicken-and-egg here, but if the tree is unclean, make
# distcheck will fail. Thankfully bzr lets me uncommit.
@test -z "`bzr status 2>&1|grep -v 'shelves exist'`" || { echo; echo "Your working tree is not clean" 1>&2; bzr status; exit 1; }
# distcheck will fail.
@test -z "`$(VCS_STATUS) 2>&1`" || { echo; echo "Your working tree is not clean" 1>&2; $(VCS_STATUS); exit 1; }
make dist
pkg_and_version=`$(PYTHON) setup.py --name`-`$(PYTHON) setup.py --version` && \
rm -rf tmp && \
mkdir tmp && \
bzr export tmp/tree && \
$(VCS_EXPORT) && \
cd tmp && \
tar xvzf ../dist/$$pkg_and_version.tar.gz && \
diff -ur $$pkg_and_version tree -x PKG-INFO -x setup.cfg -x '*.egg-info' && \
......@@ -96,8 +102,17 @@ releasechecklist:
echo "$(FILE_WITH_CHANGELOG) has no entry for $$ver_and_date"; exit 1; }
make distcheck
# Make sure $(VCS_DIFF_IMAGES) can work
.PHONY: config-imgdiff
config-imgdiff:
@test -z "`git config diff.imgdiff.command`" && git config diff.imgdiff.command 'f() { imgdiff --eog -H $$1 $$2; }; f' || true
.PHONY: imgdiff
imgdiff: config-imgdiff
$(VCS_DIFF_IMAGES)
.PHONY: release
release: releasechecklist
release: releasechecklist config-imgdiff
# I'm chicken so I won't actually do these things yet
@echo "It is a good idea to run"
@echo
......@@ -106,17 +121,17 @@ release: releasechecklist
@echo
@echo "about now. Then sanity-check the images with"
@echo
@echo " bzr diff --using=imgdiff --diff-options='-H --eog'"
@echo " $(VCS_DIFF_IMAGES)"
@echo
@echo "then either revert or commit the new images and run"
@echo
@echo " $(PYTHON) setup.py sdist register upload --unicode-description && bzr tag `$(PYTHON) setup.py --version`"
@echo " $(PYTHON) setup.py sdist register upload --unicode-description && $(VCS_TAG) `$(PYTHON) setup.py --version`"
@echo " make publish-docs"
@echo
@echo "Please increment the version number in $(FILE_WITH_VERSION)"
@echo "and add a new empty entry at the top of the changelog in $(FILE_WITH_CHANGELOG), then"
@echo
@echo ' bzr ci -m "Post-release version bump" && bzr push'
@echo ' $(VCS_COMMIT_AND_PUSH)'
@echo
.PHONY: publish-docs
......
Metadata-Version: 1.1
Name: objgraph
Version: 1.7.2
Version: 1.8.0
Summary: Draws Python object reference graphs with graphviz
Home-page: http://mg.pov.lt/objgraph/
Author: Marius Gedminas
......@@ -9,6 +9,9 @@ License: MIT
Description: Python Object Graphs
====================
.. image:: https://travis-ci.org/mgedmin/objgraph.png?branch=master
:target: https://travis-ci.org/mgedmin/objgraph
``objgraph`` is a module that lets you visually explore Python object graphs.
You'll need `graphviz <http://www.graphviz.org/>`_ if you want to draw
......@@ -50,12 +53,12 @@ Description: Python Object Graphs
Support and Development
-----------------------
The source code can be found in this Bazaar repository:
https://code.launchpad.net/~mgedmin/objgraph/trunk.
The source code can be found in this Git repository:
https://github.com/mgedmin/objgraph.
To check it out, use ``bzr branch lp:objgraph``.
To check it out, use ``git clone https://github.com/mgedmin/objgraph``.
Report bugs at https://bugs.launchpad.net/objgraph.
Report bugs at https://github.com/mgedmin/objgraph/issues.
......@@ -65,6 +68,24 @@ Description: Python Object Graphs
1.8.0 (2014-02-13)
------------------
- Moved to GitHub.
- Python 3.4 support (`LP#1270872 <http://launchpad.net/bugs/1270872>`_).
- New function: `is_proper_module`.
- New ``shortnames`` argument for `typestats`, `most_common_types`,
`show_most_common_types`, `show_growth`, `show_refs`,
and `show_backrefs`.
`count` and `by_type` accept fully-qualified type names now.
Fixes `issue 4 <https://github.com/mgedmin/objgraph/issues/4>`_.
1.7.2 (2012-10-23)
------------------
......@@ -142,7 +163,7 @@ Description: Python Object Graphs
- Avoid test failures in uncollectable-garbage.txt (fixes `LP#686731
<http://launchpad.net/bugs/686731>`_).
- Added HACKING.txt.
- Added HACKING.txt (later renamed to HACKING.rst).
1.5.0 (2010-12-05)
......
Python Object Graphs
====================
.. image:: https://travis-ci.org/mgedmin/objgraph.png?branch=master
:target: https://travis-ci.org/mgedmin/objgraph
``objgraph`` is a module that lets you visually explore Python object graphs.
You'll need `graphviz <http://www.graphviz.org/>`_ if you want to draw
......@@ -42,10 +45,10 @@ illustrated examples -- is in this series of blog posts:
Support and Development
-----------------------
The source code can be found in this Bazaar repository:
https://code.launchpad.net/~mgedmin/objgraph/trunk.
The source code can be found in this Git repository:
https://github.com/mgedmin/objgraph.
To check it out, use ``bzr branch lp:objgraph``.
To check it out, use ``git clone https://github.com/mgedmin/objgraph``.
Report bugs at https://bugs.launchpad.net/objgraph.
Report bugs at https://github.com/mgedmin/objgraph/issues.
.. include:: ../CHANGES.txt
.. include:: ../CHANGES.rst
.. include:: ../HACKING.txt
.. include:: ../HACKING.rst
......@@ -38,12 +38,11 @@ and we can see what holds it in memory
:alt: [graph of objects from which the canary is reachable]
:scale: 50%
Or we can examine just one of the reference chains leading straight a module.
Or we can examine just one of the reference chains leading straight to a module.
>>> import inspect
>>> objgraph.show_chain(
... objgraph.find_backref_chain(objgraph.by_type('Canary')[0],
... inspect.ismodule),
... objgraph.is_proper_module),
... filename='canary-chain.png')
Graph written to ....dot (11 nodes)
Image generated as canary-chain.png
......
.. include:: ../README.txt
.. include:: ../README.rst
:end-before: .. _history:
.. currentmodule:: objgraph
......@@ -97,15 +97,16 @@ It's easy to see :class:`MyBigFatObject` instances that appeared and were
not freed. I can pick one of them at random and trace the reference chain
back to one of the garbage collector's roots.
For simplicity's sake let's assume all of the roots are modules; if you've
any examples where that isn't true, I'd love to hear about them (although
see :ref:`leaking-objects`).
For simplicity's sake let's assume all of the roots are modules. ``objgraph``
provides a function, :func:`~objgraph.is_proper_module`, to check this. If
you've any examples where that isn't true, I'd love to hear about them
(although see :ref:`leaking-objects`).
>>> import inspect, random
>>> import random
>>> objgraph.show_chain(
... objgraph.find_backref_chain(
... random.choice(objgraph.by_type('MyBigFatObject')),
... inspect.ismodule),
... objgraph.is_proper_module),
... filename='chain.png')
Graph written to ...dot (13 nodes)
Image generated as chain.png
......@@ -183,7 +184,7 @@ More examples, that also double as tests
chain
quoting
.. include:: ../README.txt
.. include:: ../README.rst
:start-after: .. _history:
:end-before: .. _devel:
......@@ -195,7 +196,7 @@ And here's the change log
CHANGES
.. include:: ../README.txt
.. include:: ../README.rst
:start-after: .. _devel:
For more information, see :ref:`hacking`.
......
......@@ -13,11 +13,11 @@ Statistics
.. autofunction:: typestats([objects])
.. autofunction:: most_common_types([limit=10, objects])
.. autofunction:: most_common_types([limit=10, objects, shortnames=True])
.. autofunction:: show_most_common_types([limit=10, objects])
.. autofunction:: show_most_common_types([limit=10, objects, shortnames=True])
.. autofunction:: show_growth([limit=10, peak_stats={}])
.. autofunction:: show_growth([limit=10, peak_stats={}, shortnames=True])
Locating and Filtering Objects
......@@ -29,6 +29,8 @@ Locating and Filtering Objects
.. autofunction:: at
.. autofunction:: is_proper_module(obj)
Traversing and Displaying Object Graphs
---------------------------------------
......@@ -37,9 +39,9 @@ Traversing and Displaying Object Graphs
.. autofunction:: find_backref_chain(obj, predicate[, max_depth=20, extra_ignore=()])
.. autofunction:: show_chain(chain[, ..., highlight=None, filename=None, extra_info=None, refcounts=False])
.. autofunction:: show_chain(chain[, ..., highlight=None, filename=None, extra_info=None, refcounts=False, shortnames=True])
.. autofunction:: show_backrefs(objs[, max_depth=3, extra_ignore=(), filter=None, too_many=10, highlight=None, filename=None, extra_info=None, refcounts=False])
.. autofunction:: show_backrefs(objs[, max_depth=3, extra_ignore=(), filter=None, too_many=10, highlight=None, filename=None, extra_info=None, refcounts=False, shortnames=True])
.. autofunction:: show_refs(objs[, max_depth=3, extra_ignore=(), filter=None, too_many=10, highlight=None, filename=None, extra_info=None, refcounts=False])
.. autofunction:: show_refs(objs[, max_depth=3, extra_ignore=(), filter=None, too_many=10, highlight=None, filename=None, extra_info=None, refcounts=False, shortnames=True])
......@@ -2,7 +2,7 @@ Uncollectable garbage
---------------------
Objects that have a ``__del__`` method cannot be collected by the garbage
collector if they participate in a cycle.
collector if they participate in a cycle, prior to Python 3.4.
>>> class Nondestructible(list):
... def __del__(self):
......
Metadata-Version: 1.1
Name: objgraph
Version: 1.7.2
Version: 1.8.0
Summary: Draws Python object reference graphs with graphviz
Home-page: http://mg.pov.lt/objgraph/
Author: Marius Gedminas
......@@ -9,6 +9,9 @@ License: MIT
Description: Python Object Graphs
====================
.. image:: https://travis-ci.org/mgedmin/objgraph.png?branch=master
:target: https://travis-ci.org/mgedmin/objgraph
``objgraph`` is a module that lets you visually explore Python object graphs.
You'll need `graphviz <http://www.graphviz.org/>`_ if you want to draw
......@@ -50,12 +53,12 @@ Description: Python Object Graphs
Support and Development
-----------------------
The source code can be found in this Bazaar repository:
https://code.launchpad.net/~mgedmin/objgraph/trunk.
The source code can be found in this Git repository:
https://github.com/mgedmin/objgraph.
To check it out, use ``bzr branch lp:objgraph``.
To check it out, use ``git clone https://github.com/mgedmin/objgraph``.
Report bugs at https://bugs.launchpad.net/objgraph.
Report bugs at https://github.com/mgedmin/objgraph/issues.
......@@ -65,6 +68,24 @@ Description: Python Object Graphs
1.8.0 (2014-02-13)
------------------
- Moved to GitHub.
- Python 3.4 support (`LP#1270872 <http://launchpad.net/bugs/1270872>`_).
- New function: `is_proper_module`.
- New ``shortnames`` argument for `typestats`, `most_common_types`,
`show_most_common_types`, `show_growth`, `show_refs`,
and `show_backrefs`.
`count` and `by_type` accept fully-qualified type names now.
Fixes `issue 4 <https://github.com/mgedmin/objgraph/issues/4>`_.
1.7.2 (2012-10-23)
------------------
......@@ -142,7 +163,7 @@ Description: Python Object Graphs
- Avoid test failures in uncollectable-garbage.txt (fixes `LP#686731
<http://launchpad.net/bugs/686731>`_).
- Added HACKING.txt.
- Added HACKING.txt (later renamed to HACKING.rst).
1.5.0 (2010-12-05)
......
CHANGES.txt
HACKING.txt
.gitattributes
.gitignore
.travis.yml
CHANGES.rst
HACKING.rst
MANIFEST.in
Makefile
README.txt
README.rst
objgraph.py
setup.py
tests.py
......
This diff is collapsed.
......@@ -27,7 +27,7 @@ def read(filename):
def unsphinx(text):
# remove Sphinx extensions used in CHANGES.txt from reStructuredText
# remove Sphinx extensions used in CHANGES.rst from reStructuredText
# so that it can be handled by plain docutils
return text.replace(':func:', '').replace('.. currentmodule:: objgraph', '')
......@@ -45,8 +45,8 @@ def get_version():
def get_description():
readme = read('README.txt')
changelog = read('CHANGES.txt')
readme = read('README.rst')
changelog = read('CHANGES.rst')
description = unsphinx(readme + '\n\n\n' + changelog)
if '--unicode-description' in sys.argv:
sys.argv.remove('--unicode-description')
......
......@@ -3,6 +3,7 @@ import doctest
import glob
import os
import re
import sys
import shutil
import tempfile
import unittest
......@@ -50,7 +51,11 @@ def tearDown(test):
def find_doctests():
return glob.glob('docs/*.txt')
doctests = set(glob.glob('docs/*.txt'))
if sys.version_info >= (3, 4):
# Skip uncollectable.txt on Python 3.4 and newer
doctests.discard('docs/uncollectable.txt')
return sorted(doctests)
def doctest_setup_py_works():
......
[tox]
envlist = py24, py25, py26, py27, py31, py32, py33
envlist = py26, py27, py32, py33
[testenv]
commands = python tests.py
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment