damccorm commented on code in PR #35962:
URL: https://github.com/apache/beam/pull/35962#discussion_r2301977269


##########
sdks/python/apache_beam/examples/complete/juliaset/juliaset/juliaset_test_it.py:
##########
@@ -47,12 +48,14 @@ def test_run_example_with_setup_file(self):
     extra_args = {
         'coordinate_output': coordinate_output,
         'grid_size': self.GRID_SIZE,
-        'setup_file': os.path.normpath(
-            os.path.join(os.path.dirname(__file__), '..', 'setup.py')),
         'on_success_matcher': all_of(PipelineStateMatcher(PipelineState.DONE)),
     }
-    args = pipeline.get_full_options_as_args(**extra_args)
+    # distutils was removed from Python 3.12
+    if sys.version_info < (3, 12):
+      extra_args['setup_file'] = os.path.normpath(
+          os.path.join(os.path.dirname(__file__), '..', 'setup.py'))

Review Comment:
   This is meant to be part of the example - 
https://github.com/apache/beam/blob/d47ee872677b0d260101aff8374784621ac7b7df/sdks/python/apache_beam/examples/complete/juliaset/juliaset_main.py#L30
 - but in general, it is a better idea to just use a requirements.txt file for 
use cases like this now.
   
   Could we update the example (both here and what I linked) to use a 
requirements.txt file with the [corresponding pipeline 
option](https://github.com/apache/beam/blob/0589b14812ec52bff9d20d3bfcd96da393b9ebdb/sdks/python/apache_beam/options/pipeline_options.py#L1551)?
 The only thing we'd need to pull out is numpy like we do here 
https://github.com/apache/beam/blob/d47ee872677b0d260101aff8374784621ac7b7df/sdks/python/apache_beam/examples/complete/juliaset/setup.py#L115
   
   Then we could remove setup.py from the example



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to