Andrushika commented on code in PR #72567:
URL: https://github.com/apache/airflow/pull/72567#discussion_r3955573451


##########
scripts/ci/docker-compose/pycache.yml:
##########
@@ -0,0 +1,26 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  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.
+---
+services:
+  airflow:
+    volumes:
+      - type: volume
+        source: airflow-pycache-volume
+        target: ${PYTHONPYCACHEPREFIX}
+volumes:
+  airflow-pycache-volume:

Review Comment:
   Thanks for the review, Jerek. In this case, I think the `.pyc` naming rules 
already keep versions apart. 
   
   After [PEP 3147](https://peps.python.org/pep-3147/), the file name includes 
the interpreter tag (e.g. 3.10 writes `hello.cpython-310.pyc` and 3.12 writes 
`hello.cpython-312.pyc`). So `.pyc` files of different versions can co-exist as 
long as the tag is unique, and switching Python versions never reuses bytecode 
across versions. I tried 3.10 -> 3.12 -> 3.10 on one volume and all imports 
worked.
   
   Happy to split the volume per Python version anyway if it's preferred; it is 
a small change.



-- 
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