Skip to content

Commit

Permalink
Moved .done files into a subdirectory
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Maier <[email protected]>
  • Loading branch information
andy-maier committed Nov 22, 2023
1 parent f2eecea commit 7ff6864
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ cover
.vagrant
hmc*.yaml
/*.done
/done/*.done
/try/
session.yml
# Files created by releasenotes build
Expand Down
29 changes: 16 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ test_end2end_py_files := \
$(wildcard $(test_dir)/end2end/*/*.py) \
$(wildcard $(test_dir)/end2end/*/*/*.py) \

# Directory for .done files
done_dir := done

# Determine whether py.test has the --no-print-logs option.
pytest_no_log_opt := $(shell py.test --help 2>/dev/null |grep '\--no-print-logs' >/dev/null; if [ $$? -eq 0 ]; then echo '--no-print-logs'; else echo ''; fi)

Expand Down Expand Up @@ -279,17 +282,17 @@ ifeq (,$(package_version))
$(error Package version could not be determined)
endif

base_$(pymn)_$(PACKAGE_LEVEL).done: Makefile base-requirements.txt minimum-constraints.txt
$(done_dir)/base_$(pymn)_$(PACKAGE_LEVEL).done: Makefile base-requirements.txt minimum-constraints.txt
-$(call RM_FUNC,$@)
@echo "Installing/upgrading pip, setuptools and wheel with PACKAGE_LEVEL=$(PACKAGE_LEVEL)"
$(PYTHON_CMD) -m pip install $(pip_level_opts) -r base-requirements.txt
echo "done" >$@

.PHONY: develop
develop: develop_$(pymn)_$(PACKAGE_LEVEL).done
develop: $(done_dir)/develop_$(pymn)_$(PACKAGE_LEVEL).done
@echo "Makefile: $@ done."

develop_$(pymn)_$(PACKAGE_LEVEL).done: base_$(pymn)_$(PACKAGE_LEVEL).done install_$(pymn)_$(PACKAGE_LEVEL).done dev-requirements.txt requirements.txt minimum-constraints.txt
$(done_dir)/develop_$(pymn)_$(PACKAGE_LEVEL).done: $(done_dir)/base_$(pymn)_$(PACKAGE_LEVEL).done $(done_dir)/install_$(pymn)_$(PACKAGE_LEVEL).done dev-requirements.txt requirements.txt minimum-constraints.txt
@echo 'Installing runtime and development requirements with PACKAGE_LEVEL=$(PACKAGE_LEVEL)'
$(PYTHON_CMD) -m pip install $(pip_level_opts) $(pip_level_opts_new) -r dev-requirements.txt
echo "done" >$@
Expand Down Expand Up @@ -348,22 +351,22 @@ doccoverage:
@echo "Makefile: $@ done."

.PHONY: check
check: flake8_$(pymn)_$(PACKAGE_LEVEL).done
check: $(done_dir)/flake8_$(pymn)_$(PACKAGE_LEVEL).done
@echo "Makefile: $@ done."

.PHONY: pylint
pylint: pylint_$(pymn)_$(PACKAGE_LEVEL).done
pylint: $(done_dir)/pylint_$(pymn)_$(PACKAGE_LEVEL).done
@echo "Makefile: $@ done."

.PHONY: safety
safety: safety_$(pymn)_$(PACKAGE_LEVEL).done
safety: $(done_dir)/safety_$(pymn)_$(PACKAGE_LEVEL).done
@echo "Makefile: $@ done."

.PHONY: install
install: install_$(pymn)_$(PACKAGE_LEVEL).done
install: $(done_dir)/install_$(pymn)_$(PACKAGE_LEVEL).done
@echo "Makefile: $@ done."

install_$(pymn)_$(PACKAGE_LEVEL).done: base_$(pymn)_$(PACKAGE_LEVEL).done requirements.txt minimum-constraints.txt setup.py
$(done_dir)/install_$(pymn)_$(PACKAGE_LEVEL).done: $(done_dir)/base_$(pymn)_$(PACKAGE_LEVEL).done requirements.txt minimum-constraints.txt setup.py
@echo 'Installing $(package_name) (editable) with PACKAGE_LEVEL=$(PACKAGE_LEVEL)'
$(PYTHON_CMD) -m pip install $(pip_level_opts) $(pip_level_opts_new) -e .
$(WHICH) zhmc
Expand Down Expand Up @@ -439,27 +442,27 @@ $(bdist_file) $(sdist_file): _check_version Makefile MANIFEST.in $(dist_included
@echo 'Done: Created distribution archives: $@'

# TODO: Once PyLint has no more errors, remove the dash "-"
pylint_$(pymn)_$(PACKAGE_LEVEL).done: develop_$(pymn)_$(PACKAGE_LEVEL).done Makefile $(pylint_rc_file) $(check_py_files)
$(done_dir)/pylint_$(pymn)_$(PACKAGE_LEVEL).done: $(done_dir)/develop_$(pymn)_$(PACKAGE_LEVEL).done Makefile $(pylint_rc_file) $(check_py_files)
@echo "Makefile: Running Pylint"
-$(call RM_FUNC,$@)
pylint $(pylint_opts) --rcfile=$(pylint_rc_file) --output-format=text $(check_py_files)
echo "done" >$@
@echo "Makefile: Done running Pylint"

safety_$(pymn)_$(PACKAGE_LEVEL).done: develop_$(pymn)_$(PACKAGE_LEVEL).done Makefile $(safety_policy_file) minimum-constraints.txt
$(done_dir)/safety_$(pymn)_$(PACKAGE_LEVEL).done: $(done_dir)/develop_$(pymn)_$(PACKAGE_LEVEL).done Makefile $(safety_policy_file) minimum-constraints.txt
@echo "Makefile: Running Safety"
-$(call RM_FUNC,$@)
safety check --policy-file $(safety_policy_file) -r minimum-constraints.txt --full-report
echo "done" >$@
@echo "Makefile: Done running Safety"

flake8_$(pymn)_$(PACKAGE_LEVEL).done: develop_$(pymn)_$(PACKAGE_LEVEL).done Makefile $(flake8_rc_file) $(check_py_files)
$(done_dir)/flake8_$(pymn)_$(PACKAGE_LEVEL).done: $(done_dir)/develop_$(pymn)_$(PACKAGE_LEVEL).done Makefile $(flake8_rc_file) $(check_py_files)
-$(call RM_FUNC,$@)
flake8 $(check_py_files)
echo "done" >$@

.PHONY: check_reqs
check_reqs: develop_$(pymn)_$(PACKAGE_LEVEL).done minimum-constraints.txt requirements.txt
check_reqs: $(done_dir)/develop_$(pymn)_$(PACKAGE_LEVEL).done minimum-constraints.txt requirements.txt
@echo "Makefile: Checking missing dependencies of this package"
pip-missing-reqs $(package_name) --requirements-file=requirements.txt
pip-missing-reqs $(package_name) --requirements-file=minimum-constraints.txt
Expand All @@ -480,7 +483,7 @@ test: Makefile $(package_py_files) $(test_function_py_files) $(pytest_cov_files)
@echo "Makefile: $@ done."

.PHONY: end2end
end2end: Makefile develop_$(pymn)_$(PACKAGE_LEVEL).done $(package_py_files) $(test_end2end_py_files) $(pytest_cov_files)
end2end: Makefile $(done_dir)/develop_$(pymn)_$(PACKAGE_LEVEL).done $(package_py_files) $(test_end2end_py_files) $(pytest_cov_files)
-$(call RMDIR_R_FUNC,htmlcov.end2end)
bash -c "TESTEND2END_LOAD=true py.test --color=yes $(pytest_no_log_opt) -v -s $(test_dir)/end2end $(pytest_cov_opts) $(pytest_opts)"
@echo "Makefile: $@ done."
Expand Down
Empty file added done/.dummy
Empty file.

0 comments on commit 7ff6864

Please sign in to comment.