From 09fc08de1ef7187ec262ec5b0983163389da631f Mon Sep 17 00:00:00 2001 From: blag Date: Fri, 3 Apr 2020 15:53:06 -0700 Subject: [PATCH 1/6] Move .sdist-requirements target --- Makefile | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 114fc56a6e..e86f70f8bc 100644 --- a/Makefile +++ b/Makefile @@ -437,6 +437,21 @@ distclean: clean @echo rm -rf $(VIRTUALENV_DIR) +.PHONY: .sdist-requirements +.sdist-requirements: + # Copy over shared dist utils module which is needed by setup.py + @for component in $(COMPONENTS_WITH_RUNNERS); do\ + cp -f ./scripts/dist_utils.py $$component/dist_utils.py;\ + scripts/write-headers.sh $$component/dist_utils.py || break;\ + done + + # Copy over CHANGELOG.RST, CONTRIBUTING.RST and LICENSE file to each component directory + #@for component in $(COMPONENTS_TEST); do\ + # test -s $$component/README.rst || cp -f README.rst $$component/; \ + # cp -f CONTRIBUTING.rst $$component/; \ + # cp -f LICENSE $$component/; \ + #done + .PHONY: requirements requirements: virtualenv .sdist-requirements install-runners @echo @@ -934,22 +949,6 @@ debs: $(foreach COM,$(COMPONENTS), pushd $(COM); make deb; popd;) pushd st2client && make deb && popd -# >>>> -.PHONY: .sdist-requirements -.sdist-requirements: - # Copy over shared dist utils module which is needed by setup.py - @for component in $(COMPONENTS_WITH_RUNNERS); do\ - cp -f ./scripts/dist_utils.py $$component/dist_utils.py;\ - scripts/write-headers.sh $$component/dist_utils.py || break;\ - done - - # Copy over CHANGELOG.RST, CONTRIBUTING.RST and LICENSE file to each component directory - #@for component in $(COMPONENTS_TEST); do\ - # test -s $$component/README.rst || cp -f README.rst $$component/; \ - # cp -f CONTRIBUTING.rst $$component/; \ - # cp -f LICENSE $$component/; \ - #done - .PHONY: ci ci: ci-checks ci-unit ci-integration ci-mistral ci-packs-tests From 03485ece3a6b7ffa6d88ba2f882d333150f27aba Mon Sep 17 00:00:00 2001 From: blag Date: Fri, 3 Apr 2020 15:55:43 -0700 Subject: [PATCH 2/6] Split out .requirements target from requirements target --- Makefile | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index e86f70f8bc..25cdd99270 100644 --- a/Makefile +++ b/Makefile @@ -452,21 +452,8 @@ distclean: clean # cp -f LICENSE $$component/; \ #done -.PHONY: requirements -requirements: virtualenv .sdist-requirements install-runners - @echo - @echo "==================== requirements ====================" - @echo - # If you update these versions, make sure you also update the versions in the - # .st2client-install-check target and .travis.yml to match - # Make sure we use latest version of pip - $(VIRTUALENV_DIR)/bin/pip --version - $(VIRTUALENV_DIR)/bin/pip install --upgrade "pip==20.0.2" - # setuptools >= 41.0.1 is required for packs.install in dev envs - # setuptools >= 42 is required so setup.py install respects dependencies' python_requires - $(VIRTUALENV_DIR)/bin/pip install --upgrade "setuptools==44.1.0" - $(VIRTUALENV_DIR)/bin/pip install --upgrade "pbr==5.4.3" # workaround for pbr issue - +.PHONY: .requirements +.requirements: virtualenv # Generate all requirements to support current CI pipeline. $(VIRTUALENV_DIR)/bin/python scripts/fixate-requirements.py --skip=virtualenv,virtualenv-osx -s st2*/in-requirements.txt contrib/runners/*/in-requirements.txt -f fixed-requirements.txt -o requirements.txt @@ -482,6 +469,21 @@ requirements: virtualenv .sdist-requirements install-runners @echo "===========================================================" +.PHONY: requirements +requirements: virtualenv .requirements .sdist-requirements install-runners + @echo + @echo "==================== requirements ====================" + @echo + # If you update these versions, make sure you also update the versions in the + # .st2client-install-check target and .travis.yml to match + # Make sure we use latest version of pip + $(VIRTUALENV_DIR)/bin/pip --version + $(VIRTUALENV_DIR)/bin/pip install --upgrade "pip>=19.3.1" + # setuptools >= 41.0.1 is required for packs.install in dev envs + # setuptools >= 42 is required so setup.py install respects dependencies' python_requires + $(VIRTUALENV_DIR)/bin/pip install --upgrade "setuptools>=42" + $(VIRTUALENV_DIR)/bin/pip install --upgrade "pbr==5.4.3" # workaround for pbr issue + # Fix for Travis CI race $(VIRTUALENV_DIR)/bin/pip install "six==1.12.0" From fda3c2638ac96cbc2962e2bfd13c83af3c7fafb8 Mon Sep 17 00:00:00 2001 From: blag Date: Fri, 3 Apr 2020 16:03:49 -0700 Subject: [PATCH 3/6] Split out part of check-requirements into .check-requirements --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 25cdd99270..896dbea64d 100644 --- a/Makefile +++ b/Makefile @@ -161,7 +161,7 @@ install-runners: done .PHONY: check-requirements -check-requirements: requirements +.check-requirements: @echo @echo "============== CHECKING REQUIREMENTS ==============" @echo @@ -169,6 +169,9 @@ check-requirements: requirements git status -- *requirements.txt */*requirements.txt | grep -q "nothing to commit" @echo "All requirements files up-to-date!" +.PHONY: check-requirements +check-requirements: .requirements .check-requirements + .PHONY: check-python-packages check-python-packages: # Make target which verifies all the components Python packages are valid From e1abbf7294c6c45720bbba658f948465d1546d72 Mon Sep 17 00:00:00 2001 From: blag Date: Fri, 3 Apr 2020 16:06:22 -0700 Subject: [PATCH 4/6] Give directions on how to update requirements properly --- Makefile | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 896dbea64d..7bc49e4ee8 100644 --- a/Makefile +++ b/Makefile @@ -166,8 +166,21 @@ install-runners: @echo "============== CHECKING REQUIREMENTS ==============" @echo # Update requirements and then make sure no files were changed - git status -- *requirements.txt */*requirements.txt | grep -q "nothing to commit" - @echo "All requirements files up-to-date!" + git status -- *requirements.txt */*requirements.txt | grep -q "nothing to commit" || { \ + echo "It looks like you directly modified a requirements.txt file, an"; \ + echo "in-requirements.txt file, or fixed-requirements.txt without running:"; \ + echo ""; \ + echo " make .requirements"; \ + echo ""; \ + echo "Please update all of the requirements.txt files by running that command"; \ + echo "and committing all of the changed files. You can quickly check the results"; \ + echo "with:"; \ + echo ""; \ + echo " make .check-requirements"; \ + echo ""; \ + exit 1; \ + } + @echo "All requirements files are up-to-date!" .PHONY: check-requirements check-requirements: .requirements .check-requirements From bd18848be6829771a5d4d0ec0f75bf2226369fb7 Mon Sep 17 00:00:00 2001 From: blag Date: Fri, 3 Apr 2020 16:09:04 -0700 Subject: [PATCH 5/6] Add targets for checking the sdsist-requirements were updated properly --- Makefile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Makefile b/Makefile index 7bc49e4ee8..2a9a84a2d2 100644 --- a/Makefile +++ b/Makefile @@ -185,6 +185,31 @@ install-runners: .PHONY: check-requirements check-requirements: .requirements .check-requirements +.PHONY: .check-sdist-requirements +.check-sdist-requirements: + @echo + @echo "============== CHECKING SDIST REQUIREMENTS ==============" + @echo + # Update requirements and then make sure no files were changed + git status -- */dist_utils.py contrib/runners/*/dist_utils.py | grep -q "nothing to commit" || { \ + echo "It looks like you directly modified a dist_utils.py, or the source "; \ + echo "scripts/dist_utils.py file without running:"; \ + echo ""; \ + echo " make .sdist-requirements"; \ + echo ""; \ + echo "Please update all of the dist_utils.py files by running that command"; \ + echo "and committing all of the changed files. You can quickly check the results"; \ + echo "with:"; \ + echo ""; \ + echo " make .check-sdist-requirements"; \ + echo ""; \ + exit 1; \ + } + @echo "All dist_utils.py files are up-to-date!" + +.PHONY: check-sdist-requirements +check-sdist-requirements: .sdist-requirements .check-sdist-requirements + .PHONY: check-python-packages check-python-packages: # Make target which verifies all the components Python packages are valid From a9c8786edf87d918ccf96e4429d45c8a378bc6c0 Mon Sep 17 00:00:00 2001 From: blag Date: Fri, 3 Apr 2020 16:10:11 -0700 Subject: [PATCH 6/6] Integrate new check-sdist-requirements target into check targets --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 2a9a84a2d2..e900c3ae9a 100644 --- a/Makefile +++ b/Makefile @@ -143,7 +143,7 @@ play: @echo .PHONY: check -check: check-requirements flake8 checklogs +check: check-requirements check-sdist-requirements flake8 checklogs # NOTE: We pass --no-deps to the script so we don't install all the # package dependencies which are already installed as part of "requirements" @@ -997,7 +997,7 @@ debs: ci: ci-checks ci-unit ci-integration ci-mistral ci-packs-tests .PHONY: ci-checks -ci-checks: compile .generated-files-check .pylint .flake8 check-requirements .st2client-dependencies-check .st2common-circular-dependencies-check circle-lint-api-spec .rst-check .st2client-install-check check-python-packages +ci-checks: compile .generated-files-check .pylint .flake8 check-requirements check-sdist-requirements .st2client-dependencies-check .st2common-circular-dependencies-check circle-lint-api-spec .rst-check .st2client-install-check check-python-packages .PHONY: ci-py3-unit ci-py3-unit: