diff --git a/packaging_automation/citus_package.py b/packaging_automation/citus_package.py index ff44091c..10a26d06 100644 --- a/packaging_automation/citus_package.py +++ b/packaging_automation/citus_package.py @@ -232,13 +232,14 @@ def build_package(github_token: non_empty(non_blank(str)), docker_image_name = "packaging" if not is_test else "packaging-test" postgres_extension = "all" if postgres_version == "all" else f"pg{postgres_version}" os.environ["GITHUB_TOKEN"] = github_token + os.environ["CONTAINER_BUILD_RUN_ENABLED"] = "true" if not os.path.exists(input_output_parameters.output_dir): os.makedirs(input_output_parameters.output_dir) output = run_with_output( f'docker run --rm -v {input_output_parameters.output_dir}:/packages -v ' f'{input_output_parameters.input_files_dir}:/buildfiles:ro -e ' - f'GITHUB_TOKEN -e PACKAGE_ENCRYPTION_KEY -e UNENCRYPTED_PACKAGE ' + f'GITHUB_TOKEN -e PACKAGE_ENCRYPTION_KEY -e UNENCRYPTED_PACKAGE -e CONTAINER_BUILD_RUN_ENABLED ' f'citus/{docker_image_name}:{docker_platform}-{postgres_extension} {build_type.name}', text=True) if output.stdout: diff --git a/packaging_automation/requirements.in b/packaging_automation/requirements.in index 63c006b8..551a52c6 100644 --- a/packaging_automation/requirements.in +++ b/packaging_automation/requirements.in @@ -3,7 +3,7 @@ GitPython Jinja2 parameters_validation pathlib2 -psycopg2 +psycopg2-binary pycurl PyGithub pytest @@ -16,3 +16,4 @@ urllib3 wheel python-dotenv prospector[with_everything] +setuptools==58 diff --git a/packaging_automation/requirements.txt b/packaging_automation/requirements.txt index 6aaa692f..59be1595 100644 --- a/packaging_automation/requirements.txt +++ b/packaging_automation/requirements.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile +# This file is autogenerated by pip-compile with python 3.8 # To update, run: # # pip-compile @@ -81,7 +81,7 @@ pluggy==0.13.1 # via pytest prospector[with_everything]==1.5.0.1 # via -r requirements.in -psycopg2==2.9.1 +psycopg2-binary==2.9.3 # via -r requirements.in py==1.10.0 # via pytest diff --git a/packaging_automation/tests/test_package_cloud_statistics_collector.py b/packaging_automation/tests/test_package_cloud_statistics_collector.py index 261fd36a..cbc7589a 100644 --- a/packaging_automation/tests/test_package_cloud_statistics_collector.py +++ b/packaging_automation/tests/test_package_cloud_statistics_collector.py @@ -53,7 +53,7 @@ def get_filtered_package_count(session) -> int: # Since package count for our test repo is lower than 100, we get the total package details by getting all the # packages in one call result = stat_get_request( - package_list_with_pagination_request_address(PACKAGE_CLOUD_PARAMETERS, 1, 100), + package_list_with_pagination_request_address(PACKAGE_CLOUD_PARAMETERS, 1, 200), RequestType.package_cloud_list_package, session) package_info_list = json.loads(result.content) package_list = list(filter( diff --git a/packaging_automation/validate_build_output.py b/packaging_automation/validate_build_output.py new file mode 100644 index 00000000..92d36155 --- /dev/null +++ b/packaging_automation/validate_build_output.py @@ -0,0 +1,15 @@ +import argparse + +from .packaging_warning_handler import (validate_output) +from .common_tool_methods import (PackageType) +from pathlib import Path + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument('--output_file', required=True) + parser.add_argument('--ignore_file', required=True) + parser.add_argument('--package_type', choices=[p.name for p in PackageType], required=True) + + args = parser.parse_args() + build_output = Path(args.output_file).read_text() + validate_output(build_output, args.ignore_file, PackageType[args.package_type]) diff --git a/packaging_automation/write_postgres_versions_into_file.py b/packaging_automation/write_postgres_versions_into_file.py new file mode 100644 index 00000000..636749a9 --- /dev/null +++ b/packaging_automation/write_postgres_versions_into_file.py @@ -0,0 +1,11 @@ +import argparse + +from .citus_package import (write_postgres_versions_into_file) + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument('--project_version', required=True) + parser.add_argument('--input_files_dir', required=True) + + args = parser.parse_args() + write_postgres_versions_into_file(args.input_files_dir,args.project_version)