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
+ """
1
4
import codecs
2
5
import os .path
3
6
4
7
from setuptools import find_packages , setup
5
8
6
- here = os .path .abspath (os .path .dirname (__file__ ))
9
+ script_dir = os .path .abspath (os .path .dirname (__file__ ))
7
10
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 :
9
12
long_description = fh .read ()
10
13
11
14
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 :
14
20
return fp .read ()
15
21
16
22
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 ():
19
28
if not line .startswith ("__version__" ):
20
29
raise RuntimeError ("Unable to find version string." )
21
30
delim = '"' if '"' in line else "'"
You can’t perform that action at this time.
0 commit comments