1- import os
2- import io
31import re
4- from setuptools import find_packages , setup
2+ from setuptools import setup
53
64
75# https://packaging.python.org/guides/single-sourcing-package-version/
8- def read (* names , ** kwargs ):
9- with io .open (
10- os .path .join (os .path .dirname (__file__ ), * names ),
11- encoding = kwargs .get ("encoding" , "utf8" )
12- ) as fp :
13- return fp .read ()
14-
15-
16- def find_version (* file_paths ):
17- version_file = read (* file_paths )
18- version_match = re .search (r"^__version__ = ['\"]([^'\"]*)['\"]" ,
19- version_file , re .M )
6+ def find_version (file_paths ):
7+ with open (file_paths ) as f :
8+ version_file = f .read ()
9+ version_match = re .search (
10+ r"^__version__ = ['\"]([^'\"]*)['\"]" , version_file , re .M
11+ )
2012 if version_match :
2113 return version_match .group (1 )
2214
@@ -27,12 +19,7 @@ def find_version(*file_paths):
2719Intended Audience :: Developers
2820License :: OSI Approved :: BSD License
2921Programming Language :: Python
30- Programming Language :: Python :: 2
31- Programming Language :: Python :: 2.6
32- Programming Language :: Python :: 2.7
3322Programming Language :: Python :: 3
34- Programming Language :: Python :: 3.2
35- Programming Language :: Python :: 3.3
3623Topic :: Software Development
3724Operating System :: POSIX
3825Operating System :: Unix
@@ -44,16 +31,16 @@ def find_version(*file_paths):
4431 name = 'memory_profiler' ,
4532 description = 'A module for monitoring memory usage of a python program' ,
4633 long_description = open ('README.rst' ).read (),
47- version = find_version ("memory_profiler" , "__init__ .py" ),
34+ version = find_version ("memory_profiler.py" ),
4835 author = 'Fabian Pedregosa' ,
4936 author_email = 'f@bianp.net' ,
5037 url = 'https://github.com/pythonprofilers/memory_profiler' ,
51- py_modules = ['mprof' ],
52- packages = find_packages (include = ('memory_profiler' ,)),
38+ py_modules = ['memory_profiler' , 'mprof' ],
5339 entry_points = {
5440 'console_scripts' : ['mprof = mprof:main' ],
5541 },
5642 install_requires = ['psutil' ],
43+ python_requires = '>=3.4' ,
5744 classifiers = [_f for _f in CLASSIFIERS .split ('\n ' ) if _f ],
5845 license = 'BSD'
5946)
0 commit comments