This repository was archived by the owner on Apr 9, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +43
-1
lines changed
Expand file tree Collapse file tree 3 files changed +43
-1
lines changed Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python
2+ """
3+ pycallgraph
4+ This script is the command line interface to the pycallgraph Python library.
5+
6+ See http://pycallgraph.slowchop.com/ for more information.
7+ """
8+ import sys
9+ import os
10+
11+ def main ():
12+ import pycallgraph
13+
14+ config = pycallgraph .Config ()
15+ config .parse_args ()
16+ config .strip_argv ()
17+
18+ globals ()['__file__' ] = config .command
19+
20+ file_content = open (config .command ).read ()
21+
22+ with pycallgraph .PyCallGraph (config = config ):
23+ exec (file_content )
24+
25+
26+ if __name__ == '__main__' :
27+ ## Pep366 must always be the 1st thing to run.
28+ if not globals ().get ('__package__' ):
29+ __package__ = "polyversion" # noqa: A001 F841 @ReservedAssignment
30+
31+ main ()
Original file line number Diff line number Diff line change @@ -4,6 +4,14 @@ pycallgraph
44This script is the command line interface to the pycallgraph Python library.
55
66See http://pycallgraph.slowchop.com/ for more information.
7+
8+ .. deprecated:: > 1.0.1
9+ Code here moved to :func:`pycallgraph.__main__.main()`
10+ and now using setuptools console-script entry-points,
11+ to properly install on Windows.
12+
13+ - See https://github.com/gak/pycallgraph/issues/119
14+ - See https://github.com/gak/pycallgraph/issues/155
715"""
816import sys
917import os
Original file line number Diff line number Diff line change 66
77from setuptools .command .test import test as TestCommand
88
9+ ## FIXME: importing my-package may fail if dependent projects
10+ # from :mod:`./pycallgraph/__init__.py` are not installed yet at this stage!
911import pycallgraph
1012
1113# Only install the man page if the correct directory exists
@@ -40,7 +42,8 @@ def run_tests(self):
4042 license = open ('LICENSE' ).read (),
4143 url = pycallgraph .__url__ ,
4244 packages = ['pycallgraph' , 'pycallgraph.output' ],
43- scripts = ['scripts/pycallgraph' ],
45+ entry_points = {
46+ 'console_scripts' : ['pycallgraph = pycallgraph.__main__:main' ]},
4447 data_files = data_files ,
4548 use_2to3 = True ,
4649
You can’t perform that action at this time.
0 commit comments