@@ -814,7 +814,11 @@ def run_override(self, run, command, *, error=None, executable=None, **kwargs):
814814 kwargs .setdefault ("python_version" , DEFAULT_PYTHON_VERSION )
815815 kwargs .setdefault ("succeed" , not error )
816816
817- run .rerun (properties = {"buildpython" : "----" .join (command )}, ** kwargs )
817+ run .rerun (
818+ "BuildPython/override" ,
819+ context = {"buildpython" : "----" .join (command )},
820+ ** kwargs ,
821+ )
818822 if error :
819823 self .assertInStderr (
820824 self .invalid_error (
@@ -833,7 +837,7 @@ def run_override_rel_abs(self, run, command, **kwargs):
833837 self .run_override (run , command_abs , ** kwargs )
834838
835839 def test_not_exist (self ):
836- run = self .RunGradle ("base" , "BuildPython/override" , run = False )
840+ run = self .RunGradle ("base" , run = False )
837841 commands = [
838842 sep .join (["subdir" , "python-bad" ]) for sep in [os .sep , os .altsep ] if sep
839843 ]
@@ -845,18 +849,18 @@ def test_not_exist(self):
845849 executable = join (run .project_dir , "app" , commands [0 ]))
846850
847851 def test_couldnt_find (self ):
848- run = self .RunGradle ("base" , "BuildPython/override" , run = False )
852+ run = self .RunGradle ("base" , run = False )
849853 self .run_override (run , "python-bad" , error = self .COULDNT_FIND )
850854
851855 def test_problem (self ):
852- run = self .RunGradle ("base" , "BuildPython/override" , run = False )
856+ run = self .RunGradle ("base" , run = False )
853857 non_executable = join ("." , "build.gradle" )
854858 self .run_override (
855859 run , non_executable ,
856860 error = self .PROBLEM , executable = join (run .project_dir , "app" , non_executable ))
857861
858862 def test_non_zero (self ):
859- run = self .RunGradle ("base" , "BuildPython/override" , run = False )
863+ run = self .RunGradle ("base" , run = False )
860864 self .run_override (
861865 run , py () + ["-c" , "exit(1)" ],
862866 error = self .NON_ZERO , executable = shutil .which (py ()[0 ]))
@@ -865,14 +869,14 @@ def test_non_zero(self):
865869 self .run_override (run , py () + ["-c" , f"exit('{ error } ')" ], error = error )
866870
867871 def test_version (self ):
868- run = self .RunGradle ("base" , "BuildPython/override" , run = False )
872+ run = self .RunGradle ("base" , run = False )
869873 for version in [OLD_PYTHON_VERSION , NON_DEFAULT_PYTHON_VERSION ]:
870874 with self .subTest (version ):
871875 self .run_override (run , py (version ), error = self .VERSION .format (version ))
872876
873877 # Detect a different executable being found due to a change in PATH.
874878 def test_path (self ):
875- run = self .RunGradle ("base" , "BuildPython/override" , run = False )
879+ run = self .RunGradle ("base" , run = False )
876880 venv = f"{ run .project_dir } /app/venv"
877881 command_good = make_venv (f"{ venv } -good" )
878882 command_bad = make_venv (f"{ venv } -bad" , NON_DEFAULT_PYTHON_VERSION )
@@ -887,7 +891,7 @@ def test_path(self):
887891
888892 # Detect a venv being rebuilt with a different version of Python.
889893 def test_venv (self ):
890- run = self .RunGradle ("base" , "BuildPython/override" , run = False )
894+ run = self .RunGradle ("base" , run = False )
891895 venv = f"{ run .project_dir } /app/venv"
892896 command = make_venv (venv )
893897 self .run_override (run , command , requirements = ["six.py" ])
@@ -898,8 +902,7 @@ def test_venv(self):
898902 )
899903
900904 def test_space (self ):
901- run = self .RunGradle (
902- "base" , "BuildPython/override" , "BuildPython/space" , run = False )
905+ run = self .RunGradle ("base" , "BuildPython/space" , run = False )
903906 commands = [
904907 sep .join (["space dir" , "hello." + ("bat" if os .name == "nt" else "sh" )])
905908 for sep in [os .sep , os .altsep ] if sep
@@ -911,7 +914,7 @@ def test_space(self):
911914 # Test a buildPython which returns success without doing anything (possibly the
912915 # cause of #250).
913916 def test_silent_failure (self ):
914- run = self .RunGradle ("base" , "BuildPython/override" , run = False )
917+ run = self .RunGradle ("base" , run = False )
915918 self .run_override (run , py () + ["-c" , "pass" ], succeed = False )
916919
917920 lib_path = join ("python" , "env" , "debug" , "Lib" if os .name == "nt" else "lib" )
@@ -1750,7 +1753,7 @@ def apply_layer(self, layer, *, context=None):
17501753 dst_path .write_text (template .render (** context ))
17511754
17521755 def rerun (self , * layers , succeed = True , variants = ["debug" ], env = None , add_path = None ,
1753- properties = None , context = None , ** kwargs ):
1756+ context = None , ** kwargs ):
17541757 if RunGradle .runs_per_daemon >= RunGradle .MAX_RUNS_PER_DAEMON :
17551758 run ([self .gradlew_path , "--stop" ], cwd = self .project_dir , check = True )
17561759 RunGradle .runs_per_daemon = 0
@@ -1759,11 +1762,6 @@ def rerun(self, *layers, succeed=True, variants=["debug"], env=None, add_path=No
17591762 self .apply_layers (* layers , context = context )
17601763 java_version = self .gradle_properties ()["chaquopy.javaVersion" ]
17611764
1762- gradle_props = f"{ self .project_dir } /gradle.properties"
1763- if properties :
1764- for key , value in properties .items ():
1765- set_property (gradle_props , key , value )
1766-
17671765 env = {} if env is None else env .copy ()
17681766 if isinstance (add_path , str ):
17691767 add_path = [add_path ]
@@ -2209,29 +2207,6 @@ def cap_first(s):
22092207 return s if (s == "" ) else (s [0 ].upper () + s [1 :])
22102208
22112209
2212- NO_DEFAULT = object ()
2213-
2214- def get_property (filename , key , default = NO_DEFAULT ):
2215- with open (filename ) as props_file :
2216- props = PropertiesFile .load (props_file )
2217- return props [key ] if (default is NO_DEFAULT ) else props .get (key , default )
2218-
2219-
2220- def set_property (filename , key , value ):
2221- try :
2222- with open (filename ) as props_file :
2223- props = PropertiesFile .load (props_file )
2224- except FileNotFoundError :
2225- props = PropertiesFile ()
2226-
2227- if value is None :
2228- props .pop (key , None )
2229- else :
2230- props [key ] = value
2231- with open (filename , "w" ) as props_file :
2232- props .dump (props_file )
2233-
2234-
22352210# On Windows, rmtree often gets blocked by the virus scanner. See comment in our copy of
22362211# pip/_internal/utils/misc.py.
22372212def rmtree (path ):
0 commit comments