Browse code

blackify files

Joseph Weston authored on 17/10/2019 22:13:47
Showing 3 changed files
... ...
@@ -199,7 +199,7 @@ def main():
199 199
     if "dispatch" in args:
200 200
         args.dispatch(args)
201 201
     else:
202
-        parser.parse_args(['-h'])
202
+        parser.parse_args(["-h"])
203 203
 
204 204
 
205 205
 if __name__ == "__main__":
... ...
@@ -1,13 +1,11 @@
1 1
 from pathlib import Path
2 2
 from shutil import copyfile
3 3
 
4
-Path('my_package').mkdir(exist_ok=True)
5
-copyfile('../miniver/miniver/_static_version.py',
6
-         'my_package/_static_version.py')
7
-copyfile('../miniver/miniver/_version.py',
8
-         'my_package/_version.py')
4
+Path("my_package").mkdir(exist_ok=True)
5
+copyfile("../miniver/miniver/_static_version.py", "my_package/_static_version.py")
6
+copyfile("../miniver/miniver/_version.py", "my_package/_version.py")
9 7
 
10
-README_filename = '../miniver/README.md'
8
+README_filename = "../miniver/README.md"
11 9
 
12 10
 
13 11
 def write_snippet_from_readme(outfile, start_marker, file_header=None):
... ...
@@ -17,22 +15,21 @@ def write_snippet_from_readme(outfile, start_marker, file_header=None):
17 15
             if line.startswith(start_marker):
18 16
                 break
19 17
         else:
20
-            raise RuntimeError('Could not find start_marker: {}'
21
-                               ''.format(start_marker))
22
-        with open(outfile, 'w') as out:
18
+            raise RuntimeError(
19
+                "Could not find start_marker: {}" "".format(start_marker)
20
+            )
21
+        with open(outfile, "w") as out:
23 22
             out.write(line)
24 23
             if file_header is not None:
25 24
                 out.write(file_header)
26 25
             for line in f:
27
-                if line.startswith('```'):
26
+                if line.startswith("```"):
28 27
                     break
29 28
                 out.write(line)
30 29
 
31 30
 
32
-write_snippet_from_readme("setup.py",
33
-                          "# Your project's setup.py",
34
-                          "from setuptools import setup\n")
35
-write_snippet_from_readme(".gitattributes",
36
-                          "# Your project's .gitattributes")
37
-write_snippet_from_readme("my_package/__init__.py",
38
-                          "# Your package's __init__.py")
31
+write_snippet_from_readme(
32
+    "setup.py", "# Your project's setup.py", "from setuptools import setup\n"
33
+)
34
+write_snippet_from_readme(".gitattributes", "# Your project's .gitattributes")
35
+write_snippet_from_readme("my_package/__init__.py", "# Your package's __init__.py")
... ...
@@ -4,7 +4,7 @@ from setuptools import setup, find_packages
4 4
 import sys
5 5
 
6 6
 if sys.version_info < (3, 5):
7
-    print('Miniver needs at least Python 3.5.')
7
+    print("Miniver needs at least Python 3.5.")
8 8
     sys.exit(1)
9 9
 
10 10
 
... ...
@@ -12,42 +12,42 @@ if sys.version_info < (3, 5):
12 12
 def get_version_and_cmdclass(package_name):
13 13
     import os
14 14
     from importlib.util import module_from_spec, spec_from_file_location
15
-    spec = spec_from_file_location('version',
16
-                                   os.path.join(package_name, '_version.py'))
15
+
16
+    spec = spec_from_file_location("version", os.path.join(package_name, "_version.py"))
17 17
     module = module_from_spec(spec)
18 18
     spec.loader.exec_module(module)
19 19
     return module.__version__, module.cmdclass
20 20
 
21 21
 
22
-version, cmdclass = get_version_and_cmdclass('miniver')
22
+version, cmdclass = get_version_and_cmdclass("miniver")
23 23
 
24
-with open('README.md') as readme_file:
24
+with open("README.md") as readme_file:
25 25
     long_description = readme_file.read()
26 26
 
27 27
 setup(
28
-    name='miniver',
29
-    description='minimal versioning tool',
28
+    name="miniver",
29
+    description="minimal versioning tool",
30 30
     long_description=long_description,
31
-    long_description_content_type='text/markdown',
31
+    long_description_content_type="text/markdown",
32 32
     version=version,
33
-    url='https://github.com/jbweston/miniver',
34
-    author='Joseph Weston and Christoph Groth',
35
-    author_email='joseph@weston.cloud',
36
-    license='CC0',
33
+    url="https://github.com/jbweston/miniver",
34
+    author="Joseph Weston and Christoph Groth",
35
+    author_email="joseph@weston.cloud",
36
+    license="CC0",
37 37
     classifiers=[
38
-        'Development Status :: 4 - Beta',
39
-        'License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication',
40
-        'Topic :: Software Development :: Version Control :: Git',
41
-        'Intended Audience :: Developers',
42
-        'Programming Language :: Python :: 3 :: Only',
43
-        'Programming Language :: Python :: 3.5',
44
-        'Programming Language :: Python :: 3.6',
45
-        'Programming Language :: Python :: 3.7',
46
-        'Operating System :: POSIX :: Linux',
47
-        'Operating System :: MacOS :: MacOS X',
48
-        'Operating System :: Microsoft :: Windows',
38
+        "Development Status :: 4 - Beta",
39
+        "License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication",
40
+        "Topic :: Software Development :: Version Control :: Git",
41
+        "Intended Audience :: Developers",
42
+        "Programming Language :: Python :: 3 :: Only",
43
+        "Programming Language :: Python :: 3.5",
44
+        "Programming Language :: Python :: 3.6",
45
+        "Programming Language :: Python :: 3.7",
46
+        "Operating System :: POSIX :: Linux",
47
+        "Operating System :: MacOS :: MacOS X",
48
+        "Operating System :: Microsoft :: Windows",
49 49
     ],
50
-    packages=find_packages('.'),
50
+    packages=find_packages("."),
51 51
     cmdclass=cmdclass,
52
-    scripts=['bin/miniver']
52
+    scripts=["bin/miniver"],
53 53
 )