Skip to content
This repository was archived by the owner on Apr 9, 2024. It is now read-only.
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: gak/pycallgraph
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: dea53f613ea0a977d4b46bdd6145fee26666220b
Choose a base ref
..
head repository: gak/pycallgraph
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4465c957f19a6f2add05bdc4600cf4086b571c8e
Choose a head ref
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ tests:

flake8 --exclude=__init__.py,memory_profiler.py pycallgraph
flake8 --ignore=F403 test
flake8 examples
flake8 examples --exclude=all.py

doc:
cd docs/examples && ./generate.py
2 changes: 1 addition & 1 deletion examples/gephi/basic.py
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ def main():

with PyCallGraph(output=gephi):
person = Person()
for a in xrange(10):
for a in range(10):
person.add_banana(Banana())
person.eat_bananas()

2 changes: 1 addition & 1 deletion examples/graphviz/basic.py
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ def main():

with PyCallGraph(output=graphviz):
person = Person()
for a in xrange(10):
for a in range(10):
person.add_banana(Banana())
person.eat_bananas()

Original file line number Diff line number Diff line change
@@ -9,5 +9,6 @@ def main():
s2 = SubmoduleTwo()
s2.report()


if __name__ == "__main__":
main()
1 change: 1 addition & 0 deletions examples/graphviz/recursive.py
Original file line number Diff line number Diff line change
@@ -20,5 +20,6 @@ def main():
for a in xrange(1, 10):
factorial(a)


if __name__ == '__main__':
main()
5 changes: 3 additions & 2 deletions examples/graphviz/regexp.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -15,11 +15,11 @@ def main():
config = Config(include_stdlib=True)

with PyCallGraph(output=graphviz, config=config):
reo = compile()
reo = compile_regex()
match(reo)


def compile():
def compile_regex():
return re.compile('^[abetors]*$')


@@ -41,5 +41,6 @@ def words():
'abrasives',
]


if __name__ == '__main__':
main()
30 changes: 0 additions & 30 deletions pycallgraph/__main__.py

This file was deleted.

8 changes: 0 additions & 8 deletions scripts/pycallgraph
Original file line number Diff line number Diff line change
@@ -4,14 +4,6 @@ pycallgraph
This script is the command line interface to the pycallgraph Python library.
See http://pycallgraph.slowchop.com/ for more information.
.. deprecated:: > 1.0.1
Code here moved to :func:`pycallgraph.__main__.main()`
and now using setuptools console-script entry-points,
to properly install on Windows.
- See https://github.com/gak/pycallgraph/issues/119
- See https://github.com/gak/pycallgraph/issues/155
"""
import sys
import os
23 changes: 10 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
#!/usr/bin/env python

from os import path
from setuptools import setup
import sys

from setuptools import setup
from setuptools.command.test import test as TestCommand

## FIXME: importing my-package may fail if dependent projects
# from :mod:`./pycallgraph/__init__.py` are not installed yet at this stage!
import pycallgraph


# Only install the man page if the correct directory exists
# XXX: Commented because easy_install doesn't like it
#man_path = '/usr/share/man/man1/'
#if path.exists(man_path):
# data_files=[['/usr/share/man/man1/', ['man/pycallgraph.1']]]
#else:
# data_files=None
data_files = None

data_files=None

class PyTest(TestCommand):

@@ -32,6 +30,7 @@ def run_tests(self):
errno = pytest.main(self.test_args)
sys.exit(errno)


setup(
name='pycallgraph',
version=pycallgraph.__version__,
@@ -42,21 +41,20 @@ def run_tests(self):
license=open('LICENSE').read(),
url=pycallgraph.__url__,
packages=['pycallgraph', 'pycallgraph.output'],
entry_points={
'console_scripts': ['pycallgraph = pycallgraph.__main__:main']},
scripts=['scripts/pycallgraph'],
data_files=data_files,
use_2to3=True,

# TODO: Update download_url
download_url =
'http://pycallgraph.slowchop.com/files/download/pycallgraph-%s.tar.gz' % \
pycallgraph.__version__,
download_url=
'http://pycallgraph.slowchop.com/files/download/pycallgraph-%s.tar.gz' %
pycallgraph.__version__,

# Testing
tests_require=['pytest'],
cmdclass = {'test': PyTest},
cmdclass={'test': PyTest},

classifiers = [
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU General Public License (GPL)',
@@ -71,4 +69,3 @@ def run_tests(self):
'Topic :: Software Development :: Debuggers',
],
)

2 changes: 1 addition & 1 deletion test/test_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from helpers import *
from pycallgraph.config import Config


def test_init():
3 changes: 1 addition & 2 deletions test/test_gephi.py
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@

import pytest

from test.calls import one_nop
from calls import one_nop


@pytest.fixture
@@ -24,4 +24,3 @@ def test_simple(gephi):
assert 'edgedef> node1 VARCHAR, node2 VARCHAR' in generated
assert 'calls.one_nop,calls.one_nop,calls,1' in generated
assert 'calls.one_nop,calls.nop,1' in generated

9 changes: 7 additions & 2 deletions test/test_graphviz.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
from helpers import *
from calls import *
from pycallgraph.output.graphviz import GraphvizOutput
from pycallgraph.pycallgraph import PyCallGraph
import os

import pytest

from calls import one_nop


@pytest.fixture
5 changes: 4 additions & 1 deletion test/test_pycallgraph.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from helpers import *
from pycallgraph.exceptions import PyCallGraphException
from pycallgraph.tracer import AsyncronousTracer, SyncronousTracer

import pytest


def test_start_no_outputs(pycg):
8 changes: 4 additions & 4 deletions test/test_trace_processor.py
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
import pytest

from pycallgraph import Config
from test import calls
from calls import one_nop, nop


@pytest.fixture
@@ -22,7 +22,7 @@ def test_empty(trace_processor):

def test_nop(trace_processor):
sys.settrace(trace_processor.process)
calls.nop()
nop()
sys.settrace(None)

assert trace_processor.call_dict == {
@@ -34,7 +34,7 @@ def test_nop(trace_processor):

def test_one_nop(trace_processor):
sys.settrace(trace_processor.process)
calls.one_nop()
one_nop()
sys.settrace(None)

assert trace_processor.call_dict == {
@@ -47,7 +47,7 @@ def stdlib_trace(trace_processor, include_stdlib):
trace_processor.config = Config(include_stdlib=include_stdlib)
sys.settrace(trace_processor.process)
re.match("asdf", "asdf")
calls.one_nop()
one_nop()
sys.settrace(None)
return trace_processor.call_dict