Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare isort black formatters and checks #766

Merged
Merged
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
bd19a92
start introducing format target
bpkroth Jun 28, 2024
a1fc746
new global vars to help reuse elsewhere
bpkroth Jun 28, 2024
2af7971
clean format targets on conda rebuild
bpkroth Jun 28, 2024
d6d2e9b
rework some dependencies in some rules
bpkroth Jun 28, 2024
77d3982
rework pytest rules for simplicity
bpkroth Jun 28, 2024
89a2907
Rename a clean target for consistency
bpkroth Jun 28, 2024
fdf400b
introduce clean-format target
bpkroth Jun 28, 2024
7a2e645
fixup message
bpkroth Jun 28, 2024
b890eae
Adjust the Makefile check rules to only rerun checks on files that ha…
bpkroth Jun 28, 2024
e7880fb
Introduce pyproject.toml and new build mechanisms, refactor version.py
bpkroth Jun 28, 2024
287fb4f
Revert back to prefering default conda repo instead of conda forge
bpkroth Jun 28, 2024
4dd6b5b
This directive was moved to pyproject.toml files
bpkroth Jun 28, 2024
3a7ab0c
Omit the notebooks from the sdist and whl files
bpkroth Jun 28, 2024
2777483
include a toml extension in vscode
bpkroth Jun 28, 2024
b9767d9
Prepare isort and black formatters and checks, but don't enable them …
bpkroth Jun 28, 2024
148ca57
comment
bpkroth Jun 28, 2024
7ca2026
not ready for that one yet
bpkroth Jun 28, 2024
ebdd526
CI trigger
bpkroth Jun 28, 2024
e77f585
CI trigger
bpkroth Jun 28, 2024
04a674a
CI trigger
bpkroth Jun 28, 2024
2146d7a
CI trigger
bpkroth Jun 28, 2024
8ae75ec
Merge branch 'main' into makefile-improvements-with-incremental-support
bpkroth Jul 1, 2024
d68383b
Merge branch 'makefile-improvements-with-incremental-support' into py…
bpkroth Jul 1, 2024
2a74dbc
Leave those changes stagged in another PR for now
bpkroth Jul 1, 2024
f179046
revert for now
bpkroth Jul 1, 2024
0c0cc59
Fetch more of the history for Github CI workers
bpkroth Jul 1, 2024
f887ad8
Merge branch 'main' into pyproject-toml-build-changes
bpkroth Jul 1, 2024
a898393
make sure setuptools-scm is available from pip
bpkroth Jul 1, 2024
134b473
with a version
bpkroth Jul 1, 2024
03eae63
Merge branch 'pyproject-toml-build-changes' into prepare-isort-black-…
bpkroth Jul 1, 2024
f292abb
Merge branch 'main' into pyproject-toml-build-changes
bpkroth Jul 1, 2024
4782b7e
Merge branch 'main' into pyproject-toml-build-changes
bpkroth Jul 2, 2024
5c95cca
makefile fixups
bpkroth Jul 2, 2024
0f4840c
include more specific documentation urls
bpkroth Jul 2, 2024
0f7f4f4
docs also depend on unshallow repo
bpkroth Jul 2, 2024
7faa0ab
fixup windows build tests
bpkroth Jul 2, 2024
1db8351
Merge branch 'pyproject-toml-build-changes' into prepare-isort-black-…
bpkroth Jul 2, 2024
4d7bb2a
Merge branch 'main' into prepare-isort-black-formatters-and-checks
bpkroth Jul 2, 2024
7c096bd
Merge branch 'main' into prepare-isort-black-formatters-and-checks
bpkroth Jul 3, 2024
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
Next Next commit
start introducing format target
  • Loading branch information
bpkroth committed Jun 28, 2024
commit bd19a923a147a08ad2d20df4ce7f45a9e4eb6dfb
43 changes: 42 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ MAKEFLAGS += -j$(shell nproc)
#MAKEFLAGS += -Oline

.PHONY: all
all: check test dist dist-test doc licenseheaders
all: format check test dist dist-test doc | conda-env

.PHONY: conda-env
conda-env: build/conda-env.${CONDA_ENV_NAME}.build-stamp
Expand All @@ -45,6 +45,47 @@ clean-conda-env:
conda env remove -y ${CONDA_INFO_LEVEL} -n ${CONDA_ENV_NAME}
rm -f build/conda-env.${CONDA_ENV_NAME}.build-stamp


# Since these targets potentially change the files we need to run them in sequence.
# In future versions of make we can do that by marking each as a .NOTPARALLEL psuedo target.
# But with make 4.3 that changes the entire Makefile to be serial.

# Here we make dynamic prereqs to apply to other targets that need to run in sequence.
FORMAT_PREREQS :=

.PHONY: format
format: build/format.${CONDA_ENV_NAME}.build-stamp

ifneq (,$(filter format,$(MAKECMDGOALS)))
FORMAT_PREREQS += build/format.${CONDA_ENV_NAME}.build-stamp
endif

build/format.${CONDA_ENV_NAME}.build-stamp: build/licenseheaders.${CONDA_ENV_NAME}.build-stamp
# TODO: add isort and black formatters
build/format.${CONDA_ENV_NAME}.build-stamp:
touch $@

.PHONY: licenseheaders
licenseheaders: build/licenseheaders.${CONDA_ENV_NAME}.build-stamp

ifneq (,$(filter licenseheaders,$(MAKECMDGOALS)))
FORMAT_PREREQS += build/licenseheaders.${CONDA_ENV_NAME}.build-stamp
endif

build/licenseheaders.${CONDA_ENV_NAME}.build-stamp: build/conda-env.${CONDA_ENV_NAME}.build-stamp
build/licenseheaders.${CONDA_ENV_NAME}.build-stamp: $(PYTHON_FILES)
build/licenseheaders.${CONDA_ENV_NAME}.build-stamp: $(SCRIPT_FILES)
build/licenseheaders.${CONDA_ENV_NAME}.build-stamp: $(SQL_FILES) doc/mit-license.tmpl
build/licenseheaders.${CONDA_ENV_NAME}.build-stamp: doc/mit-license.tmpl
build/licenseheaders.${CONDA_ENV_NAME}.build-stamp:
# Note: to avoid makefile dependency loops, we don't touch the setup.py
# files as that would force the conda-env to be rebuilt.
conda run -n ${CONDA_ENV_NAME} licenseheaders -t doc/mit-license.tmpl \
-E .py .sh .ps1 .sql .cmd \
-x mlos_bench/setup.py mlos_core/setup.py mlos_viz/setup.py
touch $@


.PHONY: check
check: pycodestyle pydocstyle pylint mypy # cspell licenseheaders markdown-link-check

Expand Down