@@ -18,11 +18,10 @@ def get_version(*file_paths):
1818 """
1919 filename = os .path .join (os .path .dirname (__file__ ), * file_paths )
2020 version_file = open (filename , encoding = "utf8" ).read ()
21- version_match = re .search (r"^__version__ = ['\"]([^'\"]*)['\"]" ,
22- version_file , re .M )
21+ version_match = re .search (r"^__version__ = ['\"]([^'\"]*)['\"]" , version_file , re .M )
2322 if version_match :
2423 return version_match .group (1 )
25- raise RuntimeError (' Unable to find version string.' )
24+ raise RuntimeError (" Unable to find version string." )
2625
2726
2827def load_requirements (* requirements_paths ):
@@ -48,10 +47,12 @@ def add_version_constraint_or_raise(current_line, current_requirements, add_if_n
4847 # fine to add constraints to an unconstrained package,
4948 # raise an error if there are already constraints in place
5049 if existing_version_constraints and existing_version_constraints != version_constraints :
51- raise BaseException (f'Multiple constraint definitions found for { package } :'
52- f' "{ existing_version_constraints } " and "{ version_constraints } ".'
53- f'Combine constraints into one location with { package } '
54- f'{ existing_version_constraints } ,{ version_constraints } .' )
50+ raise BaseException (
51+ f"Multiple constraint definitions found for { package } :"
52+ f' "{ existing_version_constraints } " and "{ version_constraints } ".'
53+ f"Combine constraints into one location with { package } "
54+ f"{ existing_version_constraints } ,{ version_constraints } ."
55+ )
5556 if add_if_not_present or package in current_requirements :
5657 current_requirements [package ] = version_constraints
5758
@@ -62,8 +63,8 @@ def add_version_constraint_or_raise(current_line, current_requirements, add_if_n
6263 for line in reqs :
6364 if is_requirement (line ):
6465 add_version_constraint_or_raise (line , requirements , True )
65- if line and line .startswith ('-c' ) and not line .startswith (' -c http' ):
66- constraint_files .add (os .path .dirname (path ) + '/' + line .split ('#' )[0 ].replace ('-c' , '' ).strip ())
66+ if line and line .startswith ("-c" ) and not line .startswith (" -c http" ):
67+ constraint_files .add (os .path .dirname (path ) + "/" + line .split ("#" )[0 ].replace ("-c" , "" ).strip ())
6768
6869 # process constraint files: add constraints to existing requirements
6970 for constraint_file in constraint_files :
@@ -88,47 +89,46 @@ def is_requirement(line):
8889 return line and line .strip () and not line .startswith (("-r" , "#" , "-e" , "git+" , "-c" ))
8990
9091
91- VERSION = get_version (' django_range_merge' , ' __init__.py' )
92+ VERSION = get_version (" django_range_merge" , " __init__.py" )
9293
93- if sys .argv [- 1 ] == ' tag' :
94+ if sys .argv [- 1 ] == " tag" :
9495 print ("Tagging the version on github:" )
9596 os .system ("git tag -a %s -m 'version %s'" % (VERSION , VERSION ))
9697 os .system ("git push --tags" )
9798 sys .exit ()
9899
99- README = open (os .path .join (os .path .dirname (__file__ ), ' README.md' ), encoding = "utf8" ).read ()
100- CHANGELOG = open (os .path .join (os .path .dirname (__file__ ), ' CHANGELOG.md' ), encoding = "utf8" ).read ()
100+ README = open (os .path .join (os .path .dirname (__file__ ), " README.md" ), encoding = "utf8" ).read ()
101+ CHANGELOG = open (os .path .join (os .path .dirname (__file__ ), " CHANGELOG.md" ), encoding = "utf8" ).read ()
101102
102103setup (
103- name = ' django-range-merge' ,
104+ name = " django-range-merge" ,
104105 version = VERSION ,
105106 description = """Enables the range_merge Aggregate for Django on Postgres""" ,
106- long_description = README + ' \n \n ' + CHANGELOG ,
107- author = ' Jack Linke' ,
108- 109- url = ' https://github.com/jacklinke/django-range-merge' ,
107+ long_description = README + " \n \n " + CHANGELOG ,
108+ author = " Jack Linke" ,
109+ 110+ url = " https://github.com/jacklinke/django-range-merge" ,
110111 packages = find_packages (
111- include = [' django_range_merge' , ' django_range_merge.*' ],
112+ include = [" django_range_merge" , " django_range_merge.*" ],
112113 exclude = ["*tests" ],
113114 ),
114-
115115 include_package_data = True ,
116116 # install_requires=load_requirements('requirements-dev.txt'),
117117 python_requires = ">=3.8" ,
118118 zip_safe = False ,
119- keywords = ' Postgres django range fields aggregate' ,
119+ keywords = " Postgres django range fields aggregate" ,
120120 classifiers = [
121- ' Development Status :: 3 - Alpha' ,
122- ' Framework :: Django' ,
123- ' Framework :: Django :: 3.2' ,
124- ' Framework :: Django :: 4.0' ,
125- ' Framework :: Django :: 4.1' ,
126- ' Intended Audience :: Developers' ,
127- ' License :: Other/Proprietary License' ,
128- ' Natural Language :: English' ,
129- ' Programming Language :: Python :: 3' ,
130- ' Programming Language :: Python :: 3.8' ,
131- ' Programming Language :: Python :: 3.9' ,
132- ' Programming Language :: Python :: 3.10' ,
121+ " Development Status :: 3 - Alpha" ,
122+ " Framework :: Django" ,
123+ " Framework :: Django :: 3.2" ,
124+ " Framework :: Django :: 4.0" ,
125+ " Framework :: Django :: 4.1" ,
126+ " Intended Audience :: Developers" ,
127+ " License :: Other/Proprietary License" ,
128+ " Natural Language :: English" ,
129+ " Programming Language :: Python :: 3" ,
130+ " Programming Language :: Python :: 3.8" ,
131+ " Programming Language :: Python :: 3.9" ,
132+ " Programming Language :: Python :: 3.10" ,
133133 ],
134134)
0 commit comments