Skip to content

Commit 2a2cbac

Browse files
author
Juan Luis Cano Rodríguez
authored
Merge pull request #203 from carlodri/entry_points
Switch to entry_points for scripts
2 parents f8220c3 + e37acbd commit 2a2cbac

5 files changed

Lines changed: 12 additions & 15 deletions

File tree

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
language: python
22
python:
33
- "2.7"
4-
- "3.3"
54
- "3.4"
65
- "3.5"
76
- "3.6"

README.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ To install through easy_install or pip::
1818

1919
$ easy_install -U memory_profiler # pip install -U memory_profiler
2020

21+
The package is also available on `conda-forge
22+
<https://github.com/conda-forge/memory_profiler-feedstock>`_.
23+
2124
To install from source, download the package, extract and type::
2225

2326
$ python setup.py install

mprof.bat

Lines changed: 0 additions & 2 deletions
This file was deleted.

mprof renamed to mprof.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python
2-
31
import glob
42
import os
53
import os.path as osp
@@ -465,7 +463,7 @@ def xlim_type(value):
465463
help="Save plot to file instead of displaying it.")
466464
parser.add_argument("--window", "-w", dest="xlim", type=xlim_type,
467465
help="Plot a time-subset of the data. E.g. to plot between 0 and 20.5 seconds: --window 0,20.5")
468-
parser.add_argument("--backend",
466+
parser.add_argument("--backend",
469467
help="Specify the Matplotlib backend to use")
470468
parser.add_argument("profiles", nargs="*",
471469
help="profiles made by mprof run")
@@ -540,8 +538,7 @@ def xlim_type(value):
540538
else:
541539
pl.show()
542540

543-
544-
if __name__ == "__main__":
541+
def main():
545542
# Workaround for optparse limitation: insert -- before first negative
546543
# number found.
547544
negint = re.compile("-[0-9]+")
@@ -555,3 +552,6 @@ def xlim_type(value):
555552
"run": run_action,
556553
"plot": plot_action}
557554
actions[get_action()]()
555+
556+
if __name__ == "__main__":
557+
main()

setup.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import os
22
import io
33
import re
4-
import sys
54
from setuptools import setup
65

76

@@ -40,10 +39,6 @@ def find_version(*file_paths):
4039
4140
"""
4241

43-
scripts = ['mprof']
44-
if sys.platform == "win32":
45-
scripts.append('mprof.bat')
46-
4742
setup(
4843
name='memory_profiler',
4944
description='A module for monitoring memory usage of a python program',
@@ -52,8 +47,10 @@ def find_version(*file_paths):
5247
author='Fabian Pedregosa',
5348
author_email='f@bianp.net',
5449
url='http://pypi.python.org/pypi/memory_profiler',
55-
py_modules=['memory_profiler'],
56-
scripts=scripts,
50+
py_modules=['memory_profiler', 'mprof'],
51+
entry_points={
52+
'console_scripts' : ['mprof = mprof:main'],
53+
},
5754
install_requires=['psutil'],
5855
classifiers=[_f for _f in CLASSIFIERS.split('\n') if _f],
5956
license='BSD'

0 commit comments

Comments
 (0)