potiuk commented on code in PR #53149:
URL: https://github.com/apache/airflow/pull/53149#discussion_r2202373257


##########
shared/core-and-tasksdk/pyproject.toml:
##########
@@ -0,0 +1,50 @@
+# 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.
+
+[build-system]
+requires = ["flit_core==3.12.0"]
+build-backend = "flit_core.buildapi"
+
+[project]
+name = "airflow-shared"
+description = "Shared code between airflow-core and task-sdk"
+version = "0.0"
+classifiers = [
+    "Private :: Do Not Upload",
+]
+
+
+dependencies = [

Review Comment:
   I think it would be better (following the idea of splitting it "per 
functionality") - to have separate "sub-project" for each functionality - with 
it's own dependencies that it needs and then automatically (with pre-commit 
that we already use for type-stubs) to merge the dependencies into the target 
projects that are using this functionality.
   
   It could even be done with dependency groups, and include devel dependencies.
   
   Say "apache-airflow-logging" (those are imaginary dependencies):
   
   ```pyproject.toml
   dependencies = [
      "structlog"
   ]
   
   [dependency-groups]
   dev = [
       "structlog-mock",
       "apache-airflow-devel-common",
   ]
   ```
   
   And in the project (say task-sdk) that would use logging that would result 
in:
   
   ```pyproject.toml
   dependencies = [
        ....
        # shared logging deps
        "structlog",
        # end of shared logging deps
   ]
   
   dev = [
        ....
        # shared logging dev deps
        "structlog-mock",
        # end of shared logging dev deps
   ]
   ```
   
   This has many advantages:
   
   * maintaining dependencies where they are expected
   * uv workspace taking care about conflict resolving and working out if there 
are no conflicting dependencies
   * but most importantly "logging" will become a full locallly developed 
project on it's own and we could do this:
   
   ```bash
   cd shared/logging
   uv sync
   uv run pytest
   ```
   
   You could **just** open the logging project from Airlow repo and work on it 
as if it was a completely standalone project - add and run tests etc. and make 
sure that it has no dependencies to other part of the system (maintaining low 
cyclomatic complexity).
   
   Then in CI we would just run tests precisely in thiis way as above. The nice 
thing about `uv sync` in this case is that it will **remove** all other 
workspace projects and all dependencies that are not used by this "logging" 
project - and this way we will automatically be sure that we are not using 
something accidentally from our CI environment and other projects.
   
   
   
   
   
   
   
   
   
   
   



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