Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copytree's dirs_exist_ok parameter is only available in Python 3.8+ #1036

Closed
2 tasks
ivanmkc opened this issue Feb 24, 2022 · 3 comments · Fixed by #1170
Closed
2 tasks

copytree's dirs_exist_ok parameter is only available in Python 3.8+ #1036

ivanmkc opened this issue Feb 24, 2022 · 3 comments · Fixed by #1170
Assignees
Labels
aiplatform Issues related to the AI Platform (Unified) API. api: vertex-ai Issues related to the googleapis/python-aiplatform API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@ivanmkc
Copy link
Contributor

ivanmkc commented Feb 24, 2022

shutil.copytree(self.script_path, trainer_path, dirs_exist_ok=True)

See https://docs.python.org/3/whatsnew/3.8.html#shutil

Need to replace with something else to support <3.8 or else an exception occurs.

TODO:

  • Replace shutil.copytree with something more compatible
  • Add unit test to cover passing in a folder to _TrainingScriptPythonPackager
@kweinmeister
Copy link
Contributor

A potential workaround for <3.8: https://stackoverflow.com/a/31039095

@ivanmkc
Copy link
Contributor Author

ivanmkc commented Feb 24, 2022

Unfortunately, "distutils has been deprecated in Python 3.10 and is planned to be removed in 3.12, see PEP 632 for info."

Perhaps https://stackoverflow.com/a/12514470 would work across versions.

@kweinmeister
Copy link
Contributor

Yup, and another option is to check if sys.version_info < (3, 8) to only apply the workaround in the post you mentioned on 3.6 and 3.7.

@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Feb 25, 2022
@parthea parthea added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. and removed triage me I really want to be triaged. labels Feb 25, 2022
@busunkim96 busunkim96 added aiplatform Issues related to the AI Platform (Unified) API. api: aiplatform Issues related to the AI Platform API. labels Mar 1, 2022
@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Mar 3, 2022
@kweinmeister kweinmeister added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. and removed type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. 🚨 This issue needs some love. labels Mar 7, 2022
@product-auto-label product-auto-label bot added api: vertex-ai Issues related to the googleapis/python-aiplatform API. and removed api: aiplatform Issues related to the AI Platform API. labels May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aiplatform Issues related to the AI Platform (Unified) API. api: vertex-ai Issues related to the googleapis/python-aiplatform API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants