next version

Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
This commit is contained in:
2018-03-15 06:46:09 -04:00
parent f4a968bb79
commit d098204a9e
2 changed files with 5 additions and 22 deletions
+2 -2
View File
@@ -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!
+3 -20
View File
@@ -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()