-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from theopolis/setup_improvements
Various Setup improvements
- Loading branch information
Showing
11 changed files
with
173 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,74 @@ | ||
# -*- coding: utf-8 -*- | ||
#!/usr/bin/env python | ||
|
||
from setuptools import setup, find_packages, Extension | ||
import os | ||
import re | ||
from setuptools import setup, find_packages, Extension, Command | ||
|
||
|
||
class LintCommand(Command): | ||
"""Run pylint on implementation and test code""" | ||
|
||
description = "Run pylint on implementation and test code" | ||
user_options = [] | ||
|
||
_pylint_options = [ | ||
"--max-line-length 80", | ||
"--ignore-imports yes" | ||
] | ||
|
||
_lint_paths = [ | ||
"uefi_firmware/*.py", | ||
"uefi_firmware/*/*.py", | ||
"tests/*.py", | ||
"scripts/*.py", | ||
"scripts/contrib/*.py", | ||
] | ||
|
||
def initialize_options(self): | ||
"""Set default values for options.""" | ||
pass | ||
|
||
def finalize_options(self): | ||
"""Post-process options.""" | ||
pass | ||
|
||
def run(self): | ||
"""Run the command""" | ||
os.system("pylint %s %s" % ( | ||
" ".join(self._pylint_options), | ||
" ".join(self._lint_paths), | ||
)) | ||
|
||
with open('README.rst') as f: | ||
readme = f.read() | ||
README = f.read() | ||
|
||
with open('LICENSE') as f: | ||
license = f.read() | ||
LICENSE = f.read() | ||
|
||
with open("uefi_firmware/__init__.py", "r") as f: | ||
__INIT__ = f.read() | ||
|
||
TITLE = re.search(r'^__title__\s*=\s*[\'"]([^\'"]*)[\'"]', | ||
__INIT__, re.MULTILINE).group(1) | ||
VERSION = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', | ||
__INIT__, re.MULTILINE).group(1) | ||
AUTHOR = re.search(r'^__author__\s*=\s*[\'"]([^\'"]*)[\'"]', | ||
__INIT__, re.MULTILINE).group(1) | ||
|
||
setup( | ||
title=TITLE, | ||
name='UEFI Firmware Parser', | ||
version='0.2', | ||
version=VERSION, | ||
description='Various data structures and parsing tools for UEFI firmware.', | ||
long_description=readme, | ||
author='Teddy Reed', | ||
long_description=README, | ||
author=AUTHOR, | ||
author_email='[email protected]', | ||
license=license, | ||
license=LICENSE, | ||
packages=find_packages(exclude=('tests', 'docs')), | ||
test_suite="tests", | ||
cmdclass={ | ||
"lint": LintCommand, | ||
}, | ||
|
||
ext_modules=[ | ||
Extension( | ||
|
@@ -50,4 +101,16 @@ | |
], | ||
) | ||
], | ||
|
||
classifiers=[ | ||
# https://pypi.python.org/pypi?%3Aaction=list_classifiers | ||
'Development Status :: 4 - Beta', | ||
'Intended Audience :: System Administrators', | ||
'Topic :: Security', | ||
'License :: OSI Approved :: BSD License', | ||
'Programming Language :: Python :: 2', | ||
'Programming Language :: Python :: 2.6', | ||
'Programming Language :: Python :: 2.7', | ||
], | ||
keywords="security uefi firmware parsing bios", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
import test_compression |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
'''UEFI Firmware parser utils. | ||
''' | ||
|
||
import uefi | ||
import pfs | ||
import me | ||
|
||
__title__ = "uefi_firmware" | ||
__version__ = "0.3" | ||
__author__ = "Teddy Reed" | ||
__license__ = "BSD" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.