Skip to content

Commit

Permalink
Removed old conditionals for Pythopn 2.6/3.4 from Makefile
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
  • Loading branch information
andy-maier committed Jun 14, 2022
1 parent 5bfcd73 commit 26e9578
Showing 1 changed file with 4 additions and 53 deletions.
57 changes: 4 additions & 53 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -361,23 +361,14 @@ else
endif
pytest_end2end_opts := -v --tb=short $(pytest_opts) --es-file $(test_dir)/end2endtest/es_server.yml --es-schema-file $(test_dir)/end2endtest/es_schema.yml

ifeq ($(python_mn_version),3.4)
pytest_cov_opts :=
else
pytest_cov_opts := --cov $(package_name) --cov $(mock_package_name) $(coverage_report) --cov-config .coveragerc
endif
pytest_cov_opts := --cov $(package_name) --cov $(mock_package_name) $(coverage_report) --cov-config .coveragerc

ifeq ($(python_m_version),3)
pytest_warning_opts := -W default -W ignore::PendingDeprecationWarning
pytest_end2end_warning_opts := $(pytest_warning_opts)
else
ifeq ($(python_mn_version),2.6)
pytest_warning_opts := -W default
pytest_end2end_warning_opts := $(pytest_warning_opts)
else
pytest_warning_opts := -W default -W ignore::PendingDeprecationWarning
pytest_end2end_warning_opts := $(pytest_warning_opts)
endif
pytest_warning_opts := -W default -W ignore::PendingDeprecationWarning
pytest_end2end_warning_opts := $(pytest_warning_opts)
endif

# Files to be put into distribution archive.
Expand Down Expand Up @@ -417,11 +408,7 @@ dist_dependent_files := \
# Packages whose dependencies are checked using pip-missing-reqs
check_reqs_packages := pytest coverage coveralls flake8 pylint safety sphinx twine jupyter notebook

ifeq ($(python_mn_version),2.6)
PIP_INSTALL_CMD := $(PIP_CMD) install
else
PIP_INSTALL_CMD := $(PYTHON_CMD) -m pip install
endif
PIP_INSTALL_CMD := $(PYTHON_CMD) -m pip install

.PHONY: help
help:
Expand Down Expand Up @@ -684,75 +671,51 @@ html: develop_$(pymn).done $(doc_build_dir)/html/index.html
@echo "Makefile: Target $@ done."

$(doc_build_dir)/html/index.html: Makefile $(doc_utility_help_files) $(doc_dependent_files)
ifeq ($(python_mn_version),2.6)
@echo "Makefile: Warning: Skipping Sphinx doc build for target $@ on Python $(python_version)" >&2
else
@echo "Makefile: Creating the documentation as HTML pages"
-$(call RM_FUNC,$@)
bash -c "pushd docs; $(doc_cmd) -b html $(doc_opts) ../$(doc_build_dir)/html; popd"
@echo "Makefile: Done creating the documentation as HTML pages; top level file: $@"
endif

.PHONY: pdf
pdf: develop_$(pymn).done Makefile $(doc_utility_help_files) $(doc_dependent_files)
ifeq ($(python_mn_version),2.6)
@echo "Makefile: Warning: Skipping Sphinx doc build for target $@ on Python $(python_version)" >&2
else
@echo "Makefile: Creating the documentation as PDF file"
-$(call RM_FUNC,$@)
bash -c "pushd docs; $(doc_cmd) -b latex $(doc_opts) ../$(doc_build_dir)/pdf; popd"
@echo "Makefile: Running LaTeX files through pdflatex..."
$(MAKE) -C $(doc_build_dir)/pdf all-pdf
@echo "Makefile: Done creating the documentation as PDF file in: $(doc_build_dir)/pdf/"
@echo "Makefile: Target $@ done."
endif

.PHONY: man
man: develop_$(pymn).done Makefile $(doc_utility_help_files) $(doc_dependent_files)
ifeq ($(python_mn_version),2.6)
@echo "Makefile: Warning: Skipping Sphinx doc build for target $@ on Python $(python_version)" >&2
else
@echo "Makefile: Creating the documentation as man pages"
-$(call RM_FUNC,$@)
bash -c "pushd docs; $(doc_cmd) -b man $(doc_opts) ../$(doc_build_dir)/man; popd"
@echo "Makefile: Done creating the documentation as man pages in: $(doc_build_dir)/man/"
@echo "Makefile: Target $@ done."
endif

.PHONY: docchanges
docchanges: develop_$(pymn).done
ifeq ($(python_mn_version),2.6)
@echo "Makefile: Warning: Skipping Sphinx doc build for target $@ on Python $(python_version)" >&2
else
@echo "Makefile: Creating the doc changes overview file"
bash -c "pushd docs; $(doc_cmd) -b changes $(doc_opts) ../$(doc_build_dir)/changes; popd"
@echo
@echo "Makefile: Done creating the doc changes overview file in: $(doc_build_dir)/changes/"
@echo "Makefile: Target $@ done."
endif

.PHONY: doclinkcheck
doclinkcheck: develop_$(pymn).done
ifeq ($(python_mn_version),2.6)
@echo "Makefile: Warning: Skipping Sphinx doc build for target $@ on Python $(python_version)" >&2
else
@echo "Makefile: Creating the doc link errors file"
bash -c "pushd docs; $(doc_cmd) -b linkcheck $(doc_opts) ../$(doc_build_dir)/linkcheck; popd"
@echo
@echo "Makefile: Done creating the doc link errors file: $(doc_build_dir)/linkcheck/output.txt"
@echo "Makefile: Target $@ done."
endif

.PHONY: doccoverage
doccoverage: develop_$(pymn).done
ifeq ($(python_mn_version),2.6)
@echo "Makefile: Warning: Skipping Sphinx doc build for target $@ on Python $(python_version)" >&2
else
@echo "Makefile: Creating the doc coverage results file"
bash -c "pushd docs; $(doc_cmd) -b coverage $(doc_opts) ../$(doc_build_dir)/coverage; popd"
@echo "Makefile: Done creating the doc coverage results file: $(doc_build_dir)/coverage/python.txt"
@echo "Makefile: Target $@ done."
endif

# Note: distutils depends on the right files specified in MANIFEST.in, even when
# they are already specified e.g. in 'package_data' in setup.py.
Expand Down Expand Up @@ -825,9 +788,6 @@ $(moftab_files): install_$(pymn).done $(moftab_dependent_files) build_moftab.py
pylint_$(pymn).done: develop_$(pymn).done Makefile $(pylint_rc_file) $(py_src_files) $(py_test_files)
ifeq ($(python_m_version),2)
@echo "Makefile: Warning: Skipping Pylint on Python $(python_version)" >&2
else
ifeq ($(python_mn_version),3.4)
@echo "Makefile: Warning: Skipping Pylint on Python $(python_version)" >&2
else
@echo "Makefile: Running Pylint"
-$(call RM_FUNC,$@)
Expand All @@ -837,19 +797,14 @@ else
echo "done" >$@
@echo "Makefile: Done running Pylint"
endif
endif

flake8_$(pymn).done: develop_$(pymn).done Makefile $(flake8_rc_file) $(py_src_files) $(py_test_files)
ifeq ($(python_mn_version),2.6)
@echo "Makefile: Warning: Skipping Flake8 on Python $(python_version)" >&2
else
@echo "Makefile: Running Flake8"
-$(call RM_FUNC,$@)
flake8 --version
flake8 --statistics --config=$(flake8_rc_file) --filename='*' $(py_src_files) $(py_test_files)
echo "done" >$@
@echo "Makefile: Done running Flake8"
endif

safety_$(pymn).done: develop_$(pymn).done Makefile minimum-constraints.txt
@echo "Makefile: Running pyup.io safety check"
Expand All @@ -867,9 +822,6 @@ endif
todo_$(pymn).done: develop_$(pymn).done Makefile $(pylint_rc_file) $(py_src_files) $(py_test_files)
ifeq ($(python_m_version),2)
@echo "Makefile: Warning: Skipping checking for TODOs on Python $(python_version)" >&2
else
ifeq ($(python_mn_version),3.4)
@echo "Makefile: Warning: Skipping checking for TODOs on Python $(python_version)" >&2
else
@echo "Makefile: Checking for TODOs"
-$(call RM_FUNC,$@)
Expand All @@ -878,7 +830,6 @@ else
echo "done" >$@
@echo "Makefile: Done checking for TODOs"
endif
endif

.PHONY: check_reqs
check_reqs: develop_$(pymn).done minimum-constraints.txt requirements.txt
Expand Down

0 comments on commit 26e9578

Please sign in to comment.