Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@
get_provider_dependencies,
get_related_providers,
load_constraints,
regenerate_provider_dependencies_once,
)
from airflow_breeze.utils.python_versions import get_python_version_list
from airflow_breeze.utils.reproducible import get_source_date_epoch, repack_deterministically
Expand Down Expand Up @@ -851,6 +852,7 @@ def prepare_provider_documentation(
PrepareReleaseDocsUserQuitException,
PrepareReleaseDocsUserSkippedException,
update_changelog,
update_index_rst,
update_min_airflow_version_and_build_files,
update_release_notes,
)
Expand Down Expand Up @@ -923,6 +925,12 @@ def prepare_provider_documentation(
only_min_version_update=only_min_version_update,
with_min_airflow_version_bump=with_min_airflow_version_bump,
)
update_index_rst(
provider_id=provider_id,
with_breaking_changes=with_breaking_changes,
maybe_with_new_features=maybe_with_new_features,
)

except PrepareReleaseDocsNoChangesException:
no_changes_packages.append(provider_id)
except PrepareReleaseDocsChangesOnlyException:
Expand Down Expand Up @@ -3028,6 +3036,8 @@ def update_providers_next_version():
"""
from airflow_breeze.utils.packages import update_providers_with_next_version_comment

# make sure dependencies are regenerated before we start
regenerate_provider_dependencies_once()
get_console().print("\n[info]Scanning for providers with '# use next version' comments...\n")

updates_made = update_providers_with_next_version_comment()
Expand All @@ -3042,6 +3052,9 @@ def update_providers_next_version():
f"\n[success]Updated {len(updates_made)} provider(s) with "
f"{sum(len(deps) for deps in updates_made.values())} dependency change(s).[/]"
)
# Regenerate provider dependencies after some of them changed
regenerate_provider_dependencies_once.cache_clear()
regenerate_provider_dependencies_once()
else:
get_console().print(
"\n[info]No updates needed. All providers with '# use next version' "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1119,15 +1119,22 @@ def _generate_new_changelog(
provider_details.changelog_path.write_text("\n".join(new_changelog_lines) + "\n")


def _update_index_rst(
context: dict[str, Any],
def update_index_rst(
provider_id: str,
target_path: Path,
with_breaking_changes: bool,
maybe_with_new_features: bool,
):
get_console().print(f"\n[info]Update index.rst for {provider_id}\n")
provider_details = get_provider_details(provider_id)
jinja_context = get_provider_documentation_jinja_context(
provider_id=provider_id,
with_breaking_changes=with_breaking_changes,
maybe_with_new_features=maybe_with_new_features,
)
index_update = render_template(
template_name="PROVIDER_INDEX", context=context, extension=".rst", keep_trailing_newline=True
template_name="PROVIDER_INDEX", context=jinja_context, extension=".rst", keep_trailing_newline=True
)
index_file_path = target_path / "index.rst"
index_file_path = provider_details.documentation_provider_distribution_path / "index.rst"
old_text = ""
if index_file_path.is_file():
old_text = index_file_path.read_text()
Expand Down Expand Up @@ -1208,8 +1215,6 @@ def update_changelog(
maybe_with_new_features=maybe_with_new_features,
with_min_airflow_version_bump=with_min_airflow_version_bump,
)
get_console().print(f"\n[info]Update index.rst for {package_id}\n")
_update_index_rst(jinja_context, package_id, provider_details.documentation_provider_distribution_path)


def _generate_get_provider_info_py(context: dict[str, Any], provider_details: ProviderPackageDetails):
Expand Down
4 changes: 2 additions & 2 deletions dev/breeze/src/airflow_breeze/utils/packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -1241,8 +1241,8 @@ def _update_dependency_line_with_new_version(
new_constraint = f'"{provider_package_name}>={new_version}"'
updated_line = line.replace(old_constraint, new_constraint)

# Remove the "# use next version" comment after upgrading
updated_line = updated_line.replace(" # use next version", "")
# remove the comment starting with '# use next version' (and anything after it) and rstrip spaces
updated_line = re.sub(r"#\s*use next version.*$", "", updated_line).rstrip()

# Track the update
provider_id_short = pyproject_file.parent.relative_to(AIRFLOW_PROVIDERS_ROOT_PATH)
Expand Down
2 changes: 1 addition & 1 deletion providers/atlassian/jira/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ The minimum Apache Airflow version supported by this provider distribution is ``
PIP package Version required
========================================== ==================
``apache-airflow`` ``>=2.11.0``
``apache-airflow-providers-common-compat`` ``>=1.8.0``
``apache-airflow-providers-common-compat`` ``>=1.10.1``
``apache-airflow-providers-http``
``atlassian-python-api`` ``>3.41.10``
========================================== ==================
Expand Down
4 changes: 2 additions & 2 deletions providers/fab/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,5 +150,5 @@ Downloading official packages
You can download officially released packages and verify their checksums and signatures from the
`Official Apache Download site <https://downloads.apache.org/airflow/providers/>`_

* `The apache-airflow-providers-fab 3.0.4 sdist package <https://downloads.apache.org/airflow/providers/apache_airflow_providers_fab-3.0.4.tar.gz>`_ (`asc <https://downloads.apache.org/airflow/providers/apache_airflow_providers_fab-3.0.4.tar.gz.asc>`__, `sha512 <https://downloads.apache.org/airflow/providers/apache_airflow_providers_fab-3.0.4.tar.gz.sha512>`__)
* `The apache-airflow-providers-fab 3.0.4 wheel package <https://downloads.apache.org/airflow/providers/apache_airflow_providers_fab-3.0.4-py3-none-any.whl>`_ (`asc <https://downloads.apache.org/airflow/providers/apache_airflow_providers_fab-3.0.4-py3-none-any.whl.asc>`__, `sha512 <https://downloads.apache.org/airflow/providers/apache_airflow_providers_fab-3.0.4-py3-none-any.whl.sha512>`__)
* `The apache-airflow-providers-fab 3.1.0 sdist package <https://downloads.apache.org/airflow/providers/apache_airflow_providers_fab-3.1.0.tar.gz>`_ (`asc <https://downloads.apache.org/airflow/providers/apache_airflow_providers_fab-3.1.0.tar.gz.asc>`__, `sha512 <https://downloads.apache.org/airflow/providers/apache_airflow_providers_fab-3.1.0.tar.gz.sha512>`__)
* `The apache-airflow-providers-fab 3.1.0 wheel package <https://downloads.apache.org/airflow/providers/apache_airflow_providers_fab-3.1.0-py3-none-any.whl>`_ (`asc <https://downloads.apache.org/airflow/providers/apache_airflow_providers_fab-3.1.0-py3-none-any.whl.asc>`__, `sha512 <https://downloads.apache.org/airflow/providers/apache_airflow_providers_fab-3.1.0-py3-none-any.whl.sha512>`__)
Loading