From 589d95b5accc27ebeab1a9c62e1198c013f43b46 Mon Sep 17 00:00:00 2001 From: blallo Date: Wed, 4 Sep 2019 14:56:36 +0200 Subject: [PATCH] Blacken'd --- bot_z/cli.py | 3 +-- setup.py | 26 +++++++++++--------------- tests/test_bot_z.py | 6 +++--- 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/bot_z/cli.py b/bot_z/cli.py index a987cdd..5cedd27 100644 --- a/bot_z/cli.py +++ b/bot_z/cli.py @@ -8,8 +8,7 @@ import click @click.command() def main(args=None): """Console script for bot_z.""" - click.echo("Replace this message by putting your code into " - "bot_z.cli.main") + click.echo("Replace this message by putting your code into " "bot_z.cli.main") click.echo("See click documentation at http://click.pocoo.org/") diff --git a/setup.py b/setup.py index e980b76..3155724 100644 --- a/setup.py +++ b/setup.py @@ -21,11 +21,11 @@ import zipfile GECKO_RELEASE_PATH = "https://github.com/mozilla/geckodriver" -PKG_NAME = 'bot_z' -VERSION = '0.1.0' -AUTHOR = 'blallo' -AUTHOR_EMAIL = 'blallo@autistici.org' -BIN_PATH = 'bin/geckodriver' +PKG_NAME = "bot_z" +VERSION = "0.1.0" +AUTHOR = "blallo" +AUTHOR_EMAIL = "blallo@autistici.org" +BIN_PATH = "bin/geckodriver" with open("README.md") as readme_file: readme = readme_file.read() @@ -151,15 +151,15 @@ def download_driver_bin(uri: str, path: str) -> None: os.remove(filepath) -def preinstall(platform: T.Optional[str]=None) -> None: +def preinstall(platform: T.Optional[str] = None) -> None: """ Performs all the postintallation flow, donwloading in the right place the geckodriver binary. """ # target_path = os.path.join(os.path.abspath(os.path.curdir), 'bot_z', 'bin') - target_path = pkg_resources.resource_filename('bot_z', 'bin') + target_path = pkg_resources.resource_filename("bot_z", "bin") ensure_local_folder() - version = os.environ.get('BOTZ_GECKO_VERSION') + version = os.environ.get("BOTZ_GECKO_VERSION") gecko_uri = assemble_driver_uri(version, platform) print("[POSTINSTALL] gecko_uri: {}".format(gecko_uri)) download_driver_bin(gecko_uri, target_path) @@ -203,7 +203,7 @@ class CustomInstallCommand(install): def run(self): opts = self.distribution.get_cmdline_options() platform = None - if 'bdist_wheel' in opts: + if "bdist_wheel" in opts: platform = translate_platform_to_gecko_vers( opts["bdist_wheel"].get("plat-name") ) @@ -242,12 +242,8 @@ setup( "install": CustomInstallCommand, "bdist_wheel": CustomBDistWheel, }, - entry_points={ - 'console_scripts': [ - 'bot_z=bot_z.cli:main' - ] - }, - package_data = {'bot_z': ['bin/geckodriver']}, + entry_points={"console_scripts": ["bot_z=bot_z.cli:main"]}, + package_data={"bot_z": ["bin/geckodriver"]}, include_package_data=True, install_requires=requirements, license="GLWTS Public Licence", diff --git a/tests/test_bot_z.py b/tests/test_bot_z.py index 9a5766d..4776334 100644 --- a/tests/test_bot_z.py +++ b/tests/test_bot_z.py @@ -28,7 +28,7 @@ class TestBot_z(unittest.TestCase): runner = CliRunner() result = runner.invoke(cli.main) assert result.exit_code == 0 - assert 'bot_z.cli.main' in result.output - help_result = runner.invoke(cli.main, ['--help']) + assert "bot_z.cli.main" in result.output + help_result = runner.invoke(cli.main, ["--help"]) assert help_result.exit_code == 0 - assert '--help Show this message and exit.' in help_result.output + assert "--help Show this message and exit." in help_result.output