File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change 1+ """
2+ Configuration for setuptools.
3+ """
14import codecs
25import os .path
36
47from setuptools import find_packages , setup
58
6- here = os .path .abspath (os .path .dirname (__file__ ))
9+ script_dir = os .path .abspath (os .path .dirname (__file__ ))
710
8- with open (os .path .join (here , "README.md" ), encoding = "utf-8" ) as fh :
11+ with open (os .path .join (script_dir , "README.md" ), encoding = "utf-8" ) as fh :
912 long_description = fh .read ()
1013
1114
12- def read (rel_path ):
13- with codecs .open (os .path .join (here , rel_path ), "r" ) as fp :
15+ def read (relative_path ):
16+ """
17+ Read a file and return its contents.
18+ """
19+ with codecs .open (os .path .join (script_dir , relative_path ), "r" ) as fp :
1420 return fp .read ()
1521
1622
17- def get_version (rel_path ):
18- for line in read (rel_path ).splitlines ():
23+ def get_version (relative_path ):
24+ """
25+ Extract the version number from a file without importing it.
26+ """
27+ for line in read (relative_path ).splitlines ():
1928 if not line .startswith ("__version__" ):
2029 raise RuntimeError ("Unable to find version string." )
2130 delim = '"' if '"' in line else "'"
You can’t perform that action at this time.
0 commit comments