potiuk commented on code in PR #46405:
URL: https://github.com/apache/airflow/pull/46405#discussion_r1940581086
##########
dev/breeze/src/airflow_breeze/prepare_providers/provider_documentation.py:
##########
@@ -1222,6 +1222,13 @@ def _regenerate_pyproject_toml(context: dict[str, Any],
provider_details: Provid
context["EXTRAS_REQUIREMENTS"] = "\n".join(optional_dependencies)
context["DEPENDENCY_GROUPS"] = "\n".join(dependency_groups)
+ # Most providers require the same python versions, but some may have
exclusions
+ requires_python_version = "~=3.9"
+ for excluded_python_version in provider_details.excluded_python_versions:
+ requires_python_version += f", !={excluded_python_version}"
Review Comment:
NIT: In most other places we generate version spec without spaces. While
it's ok to have them and specs explicitly has spaces, all whitespace is
normalized and removed anyway
https://packaging.python.org/en/latest/specifications/version-specifiers/#version-specifiers
That's more of an easthetic thing - but I think it would be good if we keep
consistency here with other dependencies - for example in celery`:
```
# The dependencies should be modified in place in the generated file
# Any change in the dependencies is preserved when the file is regenerated
dependencies = [
"apache-airflow>=2.9.0",
# The Celery is known to introduce problems when upgraded to a MAJOR
version. Airflow Core
# Uses Celery for CeleryExecutor, and we also know that Kubernetes
Python client follows SemVer
#
(https://docs.celeryq.dev/en/stable/contributing.html?highlight=semver#versions).
"celery[redis]>=5.4.0,<6",
"flower>=1.0.0",
"google-re2>=1.0",
]
```
I personally prefer to avoid whitespace in such cases - it decreases the
chance that somewhere in the code where space is treated as separator and you
forgot to quote things the dependency will be mistakenly split into several
separate specs.
##########
dev/breeze/src/airflow_breeze/prepare_providers/provider_documentation.py:
##########
@@ -1222,6 +1222,13 @@ def _regenerate_pyproject_toml(context: dict[str, Any],
provider_details: Provid
context["EXTRAS_REQUIREMENTS"] = "\n".join(optional_dependencies)
context["DEPENDENCY_GROUPS"] = "\n".join(dependency_groups)
+ # Most providers require the same python versions, but some may have
exclusions
+ requires_python_version = "~=3.9"
+ for excluded_python_version in provider_details.excluded_python_versions:
+ requires_python_version += f", !={excluded_python_version}"
Review Comment:
NIT: In most other places we generate version spec without spaces. While
it's ok to have them and specs explicitly has spaces, all whitespace is
normalized and removed anyway
https://packaging.python.org/en/latest/specifications/version-specifiers/#version-specifiers
That's more of an easthetic thing - but I think it would be good if we keep
consistency here with other dependencies - for example in celery`:
```python
# The dependencies should be modified in place in the generated file
# Any change in the dependencies is preserved when the file is regenerated
dependencies = [
"apache-airflow>=2.9.0",
# The Celery is known to introduce problems when upgraded to a MAJOR
version. Airflow Core
# Uses Celery for CeleryExecutor, and we also know that Kubernetes
Python client follows SemVer
#
(https://docs.celeryq.dev/en/stable/contributing.html?highlight=semver#versions).
"celery[redis]>=5.4.0,<6",
"flower>=1.0.0",
"google-re2>=1.0",
]
```
I personally prefer to avoid whitespace in such cases - it decreases the
chance that somewhere in the code where space is treated as separator and you
forgot to quote things the dependency will be mistakenly split into several
separate specs.
--
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]