From d098204a9e7e2ef14efd7c8116df779f194c8f0a Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 15 Mar 2018 06:46:09 -0400 Subject: [PATCH] next version Signed-off-by: Kenneth Reitz --- setup.py | 4 ++-- white.py | 23 +++-------------------- 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/setup.py b/setup.py index 6219859..66dc8fa 100644 --- a/setup.py +++ b/setup.py @@ -16,9 +16,9 @@ URL = 'https://github.com/kennethreitz/red' EMAIL = 'me@kennethreitz.org' AUTHOR = 'Kenneth Reitz' REQUIRES_PYTHON = '>=3.6.0' -VERSION = '0.0.4' +VERSION = '0.1.0' # What packages are required for this module to be executed? -REQUIRED = ['black==18.3a0', 'delegator.py'] +REQUIRED = ['black==18.3a0'] # The rest you shouldn't have to touch too much :) # ------------------------------------------------ # Except, perhaps the License and Trove Classifiers! diff --git a/white.py b/white.py index 52d0568..c7752b9 100644 --- a/white.py +++ b/white.py @@ -1,31 +1,14 @@ import sys import black -import delegator PEP8_LINE_LENGTH = 79 -def get_black_executable(): - """Returns executable information about Black.""" - return (sys.executable, black.__file__.rstrip('cdo')) - - def main(): - """Runs Red.""" - python, black = get_black_executable() - # Prepare the additional command-line arguments. - args = ' '.join(sys.argv[1:]) - # Spawn a subprocess. - c = delegator.run( - f"{python} {black} {args} --line-length {PEP8_LINE_LENGTH}" - ) - # Print output. - print(c.out) - print(c.err) - # Exit the status code. - sys.exit(c.return_code) - + """Runs White.""" + sys.argv.extend(['--line-length', str(PEP8_LINE_LENGTH)]) + black.main() if __name__ == '__main__': main()