|
10 | 10 | # 2. Redistributions in binary form must reproduce the above copyright
|
11 | 11 | # notice, this list of conditions and the following disclaimer in the
|
12 | 12 | # documentation and/or other materials provided with the distribution.
|
13 |
| -# |
| 13 | +# |
14 | 14 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
15 | 15 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
16 | 16 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
30 | 30 |
|
31 | 31 | here = os.path.abspath(os.path.dirname(__file__))
|
32 | 32 |
|
33 |
| -SOURCE_FILES = [os.path.join(here, 'pepy.cpp'), |
34 |
| - os.path.abspath(os.path.join(here, '..', 'pe-parser-library', 'src', 'parse.cpp')), |
35 |
| - os.path.abspath(os.path.join(here, '..', 'pe-parser-library', 'src', 'buffer.cpp')), |
36 |
| - os.path.abspath(os.path.join(here, '..', 'pe-parser-library', 'src', 'unicode_codecvt.cpp'))] |
| 33 | +SOURCE_FILES = [ |
| 34 | + os.path.join(here, "pepy.cpp"), |
| 35 | + os.path.abspath(os.path.join(here, "..", "pe-parser-library", "src", "parse.cpp")), |
| 36 | + os.path.abspath(os.path.join(here, "..", "pe-parser-library", "src", "buffer.cpp")), |
| 37 | + os.path.abspath( |
| 38 | + os.path.join(here, "..", "pe-parser-library", "src", "unicode_codecvt.cpp") |
| 39 | + ), |
| 40 | +] |
37 | 41 |
|
38 |
| -if platform.system() == 'Windows': |
39 |
| - INCLUDE_DIRS = [os.path.abspath(os.path.join(os.path.dirname(sys.executable), 'include')), |
40 |
| - os.path.abspath(os.path.join(here, '..', 'pe-parser-library', 'include')), |
41 |
| - 'C:\\usr\\include'] |
42 |
| - LIBRARY_DIRS = [os.path.abspath(os.path.join(os.path.dirname(sys.executable), 'libs')), |
43 |
| - 'C:\\usr\\lib'] |
44 |
| - COMPILE_ARGS = ["/EHsc"] |
| 42 | +if platform.system() == "Windows": |
| 43 | + INCLUDE_DIRS = [ |
| 44 | + os.path.abspath(os.path.join(os.path.dirname(sys.executable), "include")), |
| 45 | + os.path.abspath(os.path.join(here, "..", "pe-parser-library", "include")), |
| 46 | + "C:\\usr\\include", |
| 47 | + ] |
| 48 | + LIBRARY_DIRS = [ |
| 49 | + os.path.abspath(os.path.join(os.path.dirname(sys.executable), "libs")), |
| 50 | + "C:\\usr\\lib", |
| 51 | + ] |
| 52 | + COMPILE_ARGS = ["/EHsc"] |
45 | 53 | else:
|
46 |
| - INCLUDE_DIRS = ['/usr/local/include', |
47 |
| - '/opt/local/include', |
48 |
| - '/usr/include', |
49 |
| - os.path.abspath(os.path.join(here, '..', 'pe-parser-library', 'include'))] |
50 |
| - LIBRARY_DIRS = ['/usr/lib', |
51 |
| - '/usr/local/lib'] |
52 |
| - COMPILE_ARGS = ["-std=c++11", "-g", "-O0"] # Debug only |
| 54 | + INCLUDE_DIRS = [ |
| 55 | + "/usr/local/include", |
| 56 | + "/opt/local/include", |
| 57 | + "/usr/include", |
| 58 | + os.path.abspath(os.path.join(here, "..", "pe-parser-library", "include")), |
| 59 | + ] |
| 60 | + LIBRARY_DIRS = ["/usr/lib", "/usr/local/lib"] |
| 61 | + COMPILE_ARGS = ["-std=c++11", "-g", "-O0"] # Debug only |
53 | 62 |
|
54 |
| -extension_mod = Extension('pepy', |
55 |
| - sources = SOURCE_FILES, |
56 |
| - extra_compile_args = COMPILE_ARGS, |
57 |
| - language='c++', |
58 |
| - include_dirs = INCLUDE_DIRS, |
59 |
| - library_dirs = LIBRARY_DIRS) |
| 63 | +extension_mod = Extension( |
| 64 | + "pepy", |
| 65 | + sources=SOURCE_FILES, |
| 66 | + extra_compile_args=COMPILE_ARGS, |
| 67 | + language="c++", |
| 68 | + include_dirs=INCLUDE_DIRS, |
| 69 | + library_dirs=LIBRARY_DIRS, |
| 70 | +) |
60 | 71 |
|
61 | 72 |
|
62 |
| -setup (name = 'pepy', |
63 |
| - version = '0.1', |
64 |
| - description = 'python bindings for pe-parse', |
65 |
| - author = 'Wesley Shields', |
66 |
| - author_email = '[email protected]', |
67 |
| - license = 'BSD', |
68 |
| - long_description = 'Python bindings for pe-parse', |
69 |
| - ext_modules = [extension_mod]) |
| 73 | +setup( |
| 74 | + name="pepy", |
| 75 | + version="0.1", |
| 76 | + description="python bindings for pe-parse", |
| 77 | + author="Wesley Shields", |
| 78 | + |
| 79 | + license="BSD", |
| 80 | + long_description="Python bindings for pe-parse", |
| 81 | + ext_modules=[extension_mod], |
| 82 | +) |
0 commit comments