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

Remove uploading to test pypi for releases #33412

Merged
merged 2 commits into from
Aug 15, 2023
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 @@ -194,34 +194,26 @@ def prepare_pypi_packages(version, version_suffix, repo_root):
console_print("PyPI packages prepared")


def push_packages_to_test_pypi(version):
if confirm_action("Do you want to push packages to test PyPI?"):
run_command(["twine", "upload", "-r", "pypitest", "dist/*"], dry_run_override=DRY_RUN, check=True)
console_print("Packages pushed to test PyPI")
def push_packages_to_pypi(version):
if confirm_action("Do you want to push packages to production PyPI?"):
run_command(["twine", "upload", "-r", "pypi", "dist/*"], dry_run_override=DRY_RUN, check=True)
console_print("Packages pushed to production PyPI")
console_print(
"Verify that the test package looks good by downloading it and installing it into a virtual "
"environment. The package download link is available at: "
"https://test.pypi.org/project/apache-airflow/#files "
"Again, confirm that the package is available here: https://pypi.python.org/pypi/apache-airflow"
)
console_print(
"Verify that the package looks good by downloading it and installing it into a virtual "
"environment. "
"Install it with the appropriate constraint file, adapt python version: "
f"pip install -i https://test.pypi.org/simple/ --extra-index-url "
f"https://pypi.org/simple/apache-airflow=={version} --constraint "
f"pip install apache-airflow=={version} --constraint "
f"https://raw.githubusercontent.com/apache/airflow/"
f"constraints-{version}/constraints-3.8.txt"
)


def push_packages_to_pypi():
if confirm_action("Do you want to push packages to production PyPI?"):
confirm_action(
"I have tested the package I uploaded to test PyPI. "
"I have tested the package I uploaded to PyPI. "
"I installed and ran a DAG with it and there's no issue. Do you agree to the above?",
abort=True,
)
run_command(["twine", "upload", "-r", "pypi", "dist/*"], dry_run_override=DRY_RUN, check=True)
console_print("Packages pushed to production PyPI")
console_print(
"Again, confirm that the package is available here: https://pypi.python.org/pypi/apache-airflow"
)
console_print(
"""
It is important to stress that this snapshot should not be named "release", and it
Expand Down Expand Up @@ -377,11 +369,9 @@ def publish_release_candidate(version, previous_version, github_token):

# Prepare the pypi packages
prepare_pypi_packages(version, version_suffix, airflow_repo_root)
# Push the packages to test pypi
push_packages_to_test_pypi(version)

# Push the packages to pypi
push_packages_to_pypi()
push_packages_to_pypi(version)

# Push the release candidate tag to gitHub
push_release_candidate_tag_to_github(version)
Expand Down
26 changes: 3 additions & 23 deletions dev/breeze/src/airflow_breeze/commands/release_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,36 +100,18 @@ def verify_pypi_package(version):
run_command(["twine", "check", "*.whl", f"*{version}.tar.gz"], check=True)


def upload_to_pypi_test(version):
if confirm_action("Upload to PyPI test?"):
run_command(
["twine", "upload", "-r", "pypitest", "*.whl", f"*{version}.tar.gz"],
dry_run_override=DRY_RUN,
check=True,
)
console_print("Packages pushed to test PyPI")
console_print(
"Verify that the test package looks good by downloading it and installing it into a virtual "
"environment. The package download link is available at: "
"https://test.pypi.org/project/apache-airflow/#files"
)


def upload_to_pypi(version):
if confirm_action("Upload to PyPI?"):
confirm_action(
"I have tested the package I uploaded to test PyPI. "
"I installed and ran a DAG with it and there's no issue. Do you agree to the above?",
abort=True,
)
run_command(
["twine", "upload", "-r", "pypi", "*.whl", f"*{version}.tar.gz"],
dry_run_override=DRY_RUN,
check=True,
)
console_print("Packages pushed to production PyPI")
console_print(
"Again, confirm that the package is available here: https://pypi.python.org/pypi/apache-airflow"
"Verify that the package looks good by downloading it and installing it into a virtual "
"environment. The package download link is available at: "
"https://pypi.python.org/pypi/apache-airflow"
)


Expand Down Expand Up @@ -276,8 +258,6 @@ def airflow_release(release_candidate, previous_release):
os.chdir(svn_release_version_dir)
verify_pypi_package(version)

# Upload to pypi test
upload_to_pypi_test(version)
# Upload to pypi
upload_to_pypi(version)

Expand Down
Loading