[
https://issues.apache.org/jira/browse/BEAM-14038?focusedWorklogId=739807&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-739807
]
ASF GitHub Bot logged work on BEAM-14038:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 11/Mar/22 01:43
Start Date: 11/Mar/22 01:43
Worklog Time Spent: 10m
Work Description: robertwb commented on a change in pull request #17035:
URL: https://github.com/apache/beam/pull/17035#discussion_r824320165
##########
File path:
sdks/java/extensions/python/src/main/resources/org/apache/beam/sdk/extensions/python/bootstrap_beam_venv.py
##########
@@ -0,0 +1,96 @@
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""A utility for bootstrapping a BeamPython install.
+
+This utility can be called with any version of Python, and attempts to create
+a Python virtual environment with the requested version of Beam, and any
+extra dependencies as required, installed.
+
+The virtual environment will be placed in Apache Beam's cache directory, and
+will be re-used if the parameters match.
+
+If this script exits successfully, the last line will be the full path to a
+suitable python executable.
+"""
+
+import argparse
+import hashlib
+import os
+import shutil
+import subprocess
+import sys
+
+
+def main():
+ if sys.version_info < (3, ):
+ # Run this script with Python 3.
+ os.execlp('python3', 'python3', *sys.argv)
+ return # In case windows returns...
+
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--python_version', help="Python major version.")
+ parser.add_argument('--beam_version',
+ help="Beam version.",
+ default="2.36.0")
Review comment:
We could consider making this a required argument. (Note that it's not
an error to mix and match Beam versions, as long as what you're counting on is
available, though it's generally best to have the latest.
--
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 739807)
Time Spent: 3h 20m (was: 3h 10m)
> Add the ability to easily start up Python expansion services.
> -------------------------------------------------------------
>
> Key: BEAM-14038
> URL: https://issues.apache.org/jira/browse/BEAM-14038
> Project: Beam
> Issue Type: Improvement
> Components: cross-language
> Reporter: Robert Bradshaw
> Assignee: Robert Bradshaw
> Priority: P2
> Time Spent: 3h 20m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.20.1#820001)