Skip to content

Commit

Permalink
Allow installing from Airflow pacakges in Private PyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
kaxil committed Feb 7, 2024
1 parent 2ba4bd7 commit 56d2350
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion airflowctl/utils/install_airflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def install_airflow(
f"constraints-{version}/constraints-{_get_major_minor_version(python_version)}.txt"
)

if constraints_url:
if constraints_url and not os.getenv("AIRFLOWCTL_SKIP_CONSTRAINTS"):
install_command += f" --constraint {constraints_url} "

try:
Expand Down
12 changes: 7 additions & 5 deletions airflowctl/utils/project.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import os
import shutil
import sys
from pathlib import Path
Expand Down Expand Up @@ -42,11 +43,12 @@ def create_project(
GLOBAL_CONFIG_DIR.mkdir(exist_ok=True)
GLOBAL_TRACKING_FILE.touch(exist_ok=True)

available_airflow_vers = get_airflow_versions()
if airflow_version not in available_airflow_vers and not Path(airflow_version).exists():
print(f"Apache Airflow version [bold red]{airflow_version}[/bold red] not found.")
print(f"Please select a valid version from the list below: {available_airflow_vers}")
raise typer.Exit(code=1)
if not os.getenv("AIRFLOWCTL_SKIP_VERSION_CHECK"):
available_airflow_vers = get_airflow_versions()
if airflow_version not in available_airflow_vers and not Path(airflow_version).exists():
print(f"Apache Airflow version [bold red]{airflow_version}[/bold red] not found.")
print(f"Please select a valid version from the list below: {available_airflow_vers}")
raise typer.Exit(code=1)

# Create the project directory
project_dir = Path(project_path).absolute()
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "airflowctl"
version = "0.2.9"
version = "0.2.10dev1"
description = "A CLI tool to streamline getting started with Apache Airflow™ and managing multiple Airflow projects."
authors = [
"Kaxil Naik <kaxilnaik@gmail.com>",
Expand Down

0 comments on commit 56d2350

Please sign in to comment.