This repository was archived by the owner on Apr 9, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +50
-21
lines changed Expand file tree Collapse file tree 4 files changed +50
-21
lines changed Original file line number Diff line number Diff line change 1- language :
2- - python
1+ language : python
32
43python :
5- - " 2.7"
6- - " 3.3"
7- - " 3.4"
8- - " 3.5"
9- - " 3.6"
10- - " 3.7-dev"
11- - " pypy"
12- # pytest does not support python 3.5
13- # https://bitbucket.org/pytest-dev/pytest/pull-request/296/astcall-signature-changed-on-35
14- # - "nightly"
15-
16- matrix :
17- allow_failures :
18- - python :
19- - " pypy"
20- - ' 3.7-dev' # Due to PyYAML (from `coveralls`)
21- - python :
22- - " nigthly"
4+ - 2.7
5+ - 3.3
6+ - 3.4
7+ - 3.5
8+ - 3.6
9+ # - 3.7-dev
10+ - pypy
2311
2412env :
2513 global :
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+
9+
10+ def main ():
11+ import pycallgraph
12+
13+ config = pycallgraph .Config ()
14+ config .parse_args ()
15+ config .strip_argv ()
16+
17+ globals ()['__file__' ] = config .command
18+
19+ file_content = open (config .command ).read ()
20+
21+ with pycallgraph .PyCallGraph (config = config ):
22+ exec (file_content )
23+
24+
25+ if __name__ == '__main__' :
26+ # Pep366 must always be the 1st thing to run.
27+ if not globals ().get ('__package__' ):
28+ __package__ = "polyversion" # noqa: A001 F841 @ReservedAssignment
29+
30+ 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 55from setuptools import setup
66from setuptools .command .test import test as TestCommand
77
8+ ## FIXME: importing my-package may fail if dependent projects
9+ # from :mod:`./pycallgraph/__init__.py` are not installed yet at this stage!
810import pycallgraph
911
1012
@@ -41,7 +43,8 @@ def run_tests(self):
4143 license = open ('LICENSE' ).read (),
4244 url = pycallgraph .__url__ ,
4345 packages = ['pycallgraph' , 'pycallgraph.output' ],
44- scripts = ['scripts/pycallgraph' ],
46+ entry_points = {
47+ 'console_scripts' : ['pycallgraph = pycallgraph.__main__:main' ]},
4548 data_files = data_files ,
4649 use_2to3 = True ,
4750
You can’t perform that action at this time.
0 commit comments