From b2c68d6d81289cafc3bfddb4ea3b042b742800bd Mon Sep 17 00:00:00 2001 From: Leah Cole Date: Wed, 19 May 2021 11:00:14 -0700 Subject: [PATCH 1/3] prepare utils for pypi distribution --- composer/dag_test_utils/README.md | 2 +- composer/dag_test_utils/pyproject.toml | 3 +++ composer/dag_test_utils/setup.py | 10 +++++----- 3 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 composer/dag_test_utils/pyproject.toml diff --git a/composer/dag_test_utils/README.md b/composer/dag_test_utils/README.md index 4443dc7e745..710764ed93a 100644 --- a/composer/dag_test_utils/README.md +++ b/composer/dag_test_utils/README.md @@ -6,7 +6,7 @@ This package is used internally to unit test the validity of all Cloud Composer Add the following to your `requirements-test.txt` file: -`git+https://github.com/GoogleCloudPlatform/python-docs-samples.git#egg=dag_test_utils&subdirectory=composer/dag_test_utils` +`cloud_composer_dag_test_utils` Import the internal unit testing module diff --git a/composer/dag_test_utils/pyproject.toml b/composer/dag_test_utils/pyproject.toml new file mode 100644 index 00000000000..9787c3bdf00 --- /dev/null +++ b/composer/dag_test_utils/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/composer/dag_test_utils/setup.py b/composer/dag_test_utils/setup.py index 3a90ce5aa98..e19b756264d 100644 --- a/composer/dag_test_utils/setup.py +++ b/composer/dag_test_utils/setup.py @@ -16,12 +16,12 @@ from setuptools import setup setup( - name="dag_test_utils", + name="cloud_composer_dag_test_utils", version="0.0.1", - url="git@github.com:GoogleCloudPlatform/python-docs-samples.git#egg=dag_test_utils&subdirectory=composer/dag_test_utils", - author="Google Cloud Platform", - description="Utility used to unit test example Apache Airflow DAGs", + url="https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/composer/dag_test_utils", + author="Google LLC", + description="Internal utility used to unit test example Apache Airflow DAGs for Google Cloud Composer", packages=find_packages(), py_modules=['internal_unit_testing'], - install_requires=['apache-airflow[gcp]'] + install_requires=['apache-airflow[google]==1.10.15'] ) From 85fcfa727ceed4958833abc1df6b92d7891d51b2 Mon Sep 17 00:00:00 2001 From: Leah Cole Date: Wed, 19 May 2021 11:54:33 -0700 Subject: [PATCH 2/3] address setup.py nits --- composer/dag_test_utils/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer/dag_test_utils/setup.py b/composer/dag_test_utils/setup.py index e19b756264d..9dfab90dca9 100644 --- a/composer/dag_test_utils/setup.py +++ b/composer/dag_test_utils/setup.py @@ -20,7 +20,7 @@ version="0.0.1", url="https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/composer/dag_test_utils", author="Google LLC", - description="Internal utility used to unit test example Apache Airflow DAGs for Google Cloud Composer", + description="Utility used to unit test example Apache Airflow DAGs for Google Cloud Composer. This is not an officially supported Google product.", packages=find_packages(), py_modules=['internal_unit_testing'], install_requires=['apache-airflow[google]==1.10.15'] From 28ad934934a45a1ac862adf4f95e290e93a2f64f Mon Sep 17 00:00:00 2001 From: Leah Cole Date: Thu, 20 May 2021 15:06:02 -0700 Subject: [PATCH 3/3] change requirements to published pypi package!! --- .../unit-test-dags-cloud-build/requirements-test.txt | 2 +- composer/workflows/requirements-test.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer/blog/gcp-tech-blog/unit-test-dags-cloud-build/requirements-test.txt b/composer/blog/gcp-tech-blog/unit-test-dags-cloud-build/requirements-test.txt index 84e56eabf72..55c3757968a 100644 --- a/composer/blog/gcp-tech-blog/unit-test-dags-cloud-build/requirements-test.txt +++ b/composer/blog/gcp-tech-blog/unit-test-dags-cloud-build/requirements-test.txt @@ -1,2 +1,2 @@ pytest==6.2.4 -git+https://github.com/GoogleCloudPlatform/python-docs-samples.git#egg=dag_test_utils&subdirectory=composer/dag_test_utils # DAG unit test utility +cloud-composer-dag-test-utils==0.0.1 \ No newline at end of file diff --git a/composer/workflows/requirements-test.txt b/composer/workflows/requirements-test.txt index 84e56eabf72..55c3757968a 100644 --- a/composer/workflows/requirements-test.txt +++ b/composer/workflows/requirements-test.txt @@ -1,2 +1,2 @@ pytest==6.2.4 -git+https://github.com/GoogleCloudPlatform/python-docs-samples.git#egg=dag_test_utils&subdirectory=composer/dag_test_utils # DAG unit test utility +cloud-composer-dag-test-utils==0.0.1 \ No newline at end of file