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
3 changes: 3 additions & 0 deletions .github/workflows/tool-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ jobs:
# - name: Unit tests for "Prepare Release"
# run: python -m pytest -q packaging_automation/tests/test_prepare_release.py

- name: Unit tests for "Prepare Release" parameters
run: python -m pytest -q packaging_automation/tests/test_prepare_release_parameters.py

- name: Unit tests for "Update Docker"
run: python -m pytest -q packaging_automation/tests/test_update_docker.py

Expand Down
4 changes: 2 additions & 2 deletions packaging_automation/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Python Environment Installation

Before using script, you need to make sure that Python > 3.8 is installed in your system.
Before using script, you need to make sure that Python >= 3.10 is installed in your system.

### Clone Tools Repository

Expand All @@ -23,7 +23,7 @@ python -m pip --version
Output should be like following

``` console
pip 21.1.2 from /home/vagrant/.local/lib/python3.8/site-packages/pip (python 3.8)
pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)
```

If you get error, you should first install pip
Expand Down
4 changes: 2 additions & 2 deletions packaging_automation/prepare_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ def create_new_sql_for_downgrade_path(
CHECKOUT_DIR = "citus_temp"


def validate_parameters(major_release_flag: bool):
def validate_parameters(major_release_flag: bool, arguments: argparse.Namespace):
if major_release_flag and arguments.cherry_pick_enabled:
raise ValueError("Cherry pick could be enabled only for patch release")

Expand Down Expand Up @@ -810,7 +810,7 @@ def validate_parameters(major_release_flag: bool):
arguments = parser.parse_args()
execution_path = f"{os.getcwd()}/{CHECKOUT_DIR}"
major_release = is_major_release(arguments.prj_ver)
validate_parameters(major_release)
validate_parameters(major_release, arguments)

try:
initialize_env(execution_path, arguments.prj_name, CHECKOUT_DIR)
Expand Down
15 changes: 10 additions & 5 deletions packaging_automation/requirements.in
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
anyio>=4.14.2
attrs
black
click>=8.3.3
docker
GitPython
GitPython>=3.1.62
Jinja2
parameters_validation
pathlib2
# Include the pytest plugin and its startup-import fix.
platformdirs==4.12.1
psycopg2-binary
pycurl
PyGithub
PyJWT[crypto]>=2.15.0
pytest
python-gnupg
python-string-utils
PyYAML
requests
SQLAlchemy
urllib3
wheel
urllib3>=2.8.0
wheel>=0.48.0
python-dotenv
prospector[with_everything]
prospector[with_everything]>=1.12.1
pypistats
setuptools==70.0.0
setuptools>=83.0.0
59 changes: 32 additions & 27 deletions packaging_automation/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --output-file=tools/packaging_automation/requirements.txt tools/packaging_automation/requirements.in
# pip-compile --allow-unsafe --output-file=tools/packaging_automation/requirements.txt tools/packaging_automation/requirements.in
#
anyio==4.4.0
# via httpx
astroid==2.15.8
anyio==4.14.2
# via
# -r tools/packaging_automation/requirements.in
# httpx
astroid==3.0.0
# via
# pylint
# pylint-celery
Expand All @@ -33,8 +35,10 @@ chardet==5.2.0
# via mbstrdecoder
charset-normalizer==3.3.2
# via requests
click==8.1.7
# via black
click==8.3.3
# via
# -r tools/packaging_automation/requirements.in
# black
cryptography==50.0.0
# via pyjwt
dataproperty==1.0.1
Expand Down Expand Up @@ -65,7 +69,7 @@ flake8-polyfill==1.0.2
# via pep8-naming
gitdb==4.0.11
# via gitpython
gitpython==3.1.58
gitpython==3.1.62
# via
# -r tools/packaging_automation/requirements.in
# prospector
Expand All @@ -88,8 +92,6 @@ isort==5.13.2
# via pylint
jinja2==3.1.6
# via -r tools/packaging_automation/requirements.in
lazy-object-proxy==1.10.0
# via astroid
markdown-it-py==3.0.0
# via rich
markupsafe==2.1.5
Expand Down Expand Up @@ -136,16 +138,17 @@ pbr==6.0.0
# via stevedore
pep8-naming==0.10.0
# via prospector
platformdirs==4.2.2
platformdirs==4.12.1
# via
# -r tools/packaging_automation/requirements.in
# black
# pylint
# pypistats
pluggy==1.5.0
# via pytest
prettytable==3.10.0
# via pypistats
prospector[with-everything]==1.10.3
prospector[with-everything]==1.12.1
# via -r tools/packaging_automation/requirements.in
psycopg2-binary==2.9.12
# via -r tools/packaging_automation/requirements.in
Expand All @@ -170,9 +173,12 @@ pygments==2.20.0
# pyroma
# pytest
# rich
pyjwt[crypto]==2.13.0
# via pygithub
pylint==2.17.7
pyjwt[crypto]==2.15.0
# via
# -r tools/packaging_automation/requirements.in
# pygithub
# pyjwt
pylint==3.0.0
# via
# prospector
# pylint-celery
Expand All @@ -181,13 +187,12 @@ pylint==2.17.7
# pylint-plugin-utils
pylint-celery==0.3
# via prospector
pylint-django==2.5.3
pylint-django==2.6.1
# via prospector
pylint-flask==0.6
# via prospector
pylint-plugin-utils==0.7
pylint-plugin-utils==0.8
# via
# prospector
# pylint-celery
# pylint-django
# pylint-flask
Expand Down Expand Up @@ -232,7 +237,7 @@ requests==2.33.0
# docker
# pygithub
# pyroma
requirements-detector==1.2.2
requirements-detector==1.3.1
# via prospector
rich==13.7.1
# via bandit
Expand All @@ -247,9 +252,7 @@ six==1.16.0
smmap==5.0.1
# via gitdb
sniffio==1.3.1
# via
# anyio
# httpx
# via httpx
snowballstemmer==2.2.0
# via pydocstyle
sqlalchemy==2.0.30
Expand Down Expand Up @@ -295,7 +298,7 @@ typing-extensions==4.15.0
# pygithub
# pyjwt
# sqlalchemy
urllib3==2.7.0
urllib3==2.8.0
# via
# -r tools/packaging_automation/requirements.in
# docker
Expand All @@ -305,12 +308,14 @@ vulture==2.11
# via prospector
wcwidth==0.2.13
# via prettytable
wheel==0.46.2
wheel==0.48.0
# via -r tools/packaging_automation/requirements.in
wrapt==1.16.0
# via
# astroid
# deprecated
# via deprecated

# The following packages are considered to be unsafe in a requirements file:
# setuptools
setuptools==83.0.0
# via
# -r tools/packaging_automation/requirements.in
# pyroma
# pytablewriter
33 changes: 33 additions & 0 deletions packaging_automation/tests/test_prepare_release_parameters.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import argparse

import pytest

from ..prepare_release import validate_parameters


@pytest.mark.parametrize(
"major_release,cherry_pick,earliest_date,schema_version,error",
[
(True, False, None, None, None),
(False, False, None, None, None),
(False, True, "2026.10.05", None, None),
(False, False, None, "15.0-1", None),
(True, True, None, None, "Cherry pick could be enabled only for patch release"),
(True, False, "2026.10.05", None, "earliest_pr_date could not be used"),
(True, False, None, "15.0-1", "schema_version could not be set"),
(False, True, None, None, "earliest_pr_date parameter could not be empty"),
],
)
def test_validate_parameters(
major_release, cherry_pick, earliest_date, schema_version, error
):
arguments = argparse.Namespace(
cherry_pick_enabled=cherry_pick,
earliest_pr_date=earliest_date,
schema_version=schema_version,
)
if error is None:
validate_parameters(major_release, arguments)
else:
with pytest.raises(ValueError, match=error):
validate_parameters(major_release, arguments)
Loading