Skip to content

Commit

Permalink
Ran black
Browse files Browse the repository at this point in the history
  • Loading branch information
erocarrera committed Feb 6, 2023
1 parent 97af4b5 commit 00c42f7
Showing 1 changed file with 28 additions and 26 deletions.
54 changes: 28 additions & 26 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
from unittest import TestLoader, TextTestRunner


os.environ['COPY_EXTENDED_ATTRIBUTES_DISABLE'] = 'true'
os.environ['COPYFILE_DISABLE'] = 'true'
os.environ["COPY_EXTENDED_ATTRIBUTES_DISABLE"] = "true"
os.environ["COPYFILE_DISABLE"] = "true"


def _read_doc():
"""
Parse docstring from file 'pefile.py' and avoid importing
this module directly.
"""
with open('pefile.py', 'r', encoding='utf-8') as f:
with open("pefile.py", "r", encoding="utf-8") as f:
tree = ast.parse(f.read())
return ast.get_docstring(tree)

Expand All @@ -36,14 +36,15 @@ def _read_attr(attr_name):
__version__, __author__, __contact__,
"""
regex = attr_name + r"\s+=\s+['\"](.+)['\"]"
with open('pefile.py', 'r', encoding='utf-8') as f:
with open("pefile.py", "r", encoding="utf-8") as f:
match = re.search(regex, f.read())
# Second item in the group is the value of attribute.
return match.group(1)


class TestCommand(Command):
"""Run tests."""

user_options = []

def initialize_options(self):
Expand All @@ -53,32 +54,33 @@ def finalize_options(self):
pass

def run(self):
test_suite = TestLoader().discover('./tests', pattern='*_test.py')
test_suite = TestLoader().discover("./tests", pattern="*_test.py")
test_results = TextTestRunner(verbosity=2).run(test_suite)


setup(name = 'pefile',
version = _read_attr('__version__'),
description = 'Python PE parsing module',
author = _read_attr('__author__'),
author_email = _read_attr('__contact__'),
url = 'https://github.com/erocarrera/pefile',
download_url='https://github.com/erocarrera/pefile/releases/download/v2022.5.30/pefile-2022.5.30.tar.gz',
keywords = ['pe', 'exe', 'dll', 'pefile', 'pecoff'],
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules'],
long_description = "\n".join(_read_doc().split('\n')),
setup(
name="pefile",
version=_read_attr("__version__"),
description="Python PE parsing module",
author=_read_attr("__author__"),
author_email=_read_attr("__contact__"),
url="https://github.com/erocarrera/pefile",
download_url="https://github.com/erocarrera/pefile/releases/download/v2022.5.30/pefile-2022.5.30.tar.gz",
keywords=["pe", "exe", "dll", "pefile", "pecoff"],
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Software Development :: Libraries :: Python Modules",
],
long_description="\n".join(_read_doc().split("\n")),
cmdclass={"test": TestCommand},
py_modules = ['pefile', 'peutils'],
py_modules=["pefile", "peutils"],
python_requires=">=3.6.0",
packages = ['ordlookup'],
install_requires=[
],
packages=["ordlookup"],
install_requires=[],
license="MIT",
)

0 comments on commit 00c42f7

Please sign in to comment.