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

Change formatter to black to strongly enforce pep8 style #744

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions .devcontainer/build/Dockerfile
jsfreischuetz marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ FROM node:lts-slim
# Install some basic dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
apt-transport-https ca-certificates curl gnupg2 software-properties-common \
less jq \
build-essential g++ libx11-dev libxkbfile-dev libsecret-1-dev python-is-python3 python3-minimal
apt-transport-https ca-certificates curl gnupg2 software-properties-common \
less jq \
build-essential g++ libx11-dev libxkbfile-dev libsecret-1-dev python-is-python3 python3-minimal

# Install docker CLI
# https://docs.docker.com/engine/install/debian/
RUN install -m 0755 -d /etc/apt/keyrings \
&& curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg \
&& chmod a+r /etc/apt/keyrings/docker.gpg \
&& echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | tee /etc/apt/sources.list.d/docker.list \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | tee /etc/apt/sources.list.d/docker.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends docker-ce-cli docker-buildx-plugin docker-compose-plugin

Expand Down
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"lextudio.restructuredtext",
"matangover.mypy",
"ms-azuretools.vscode-docker",
"ms-python.autopep8",
"ms-python.black-formatter",
"ms-python.flake8",
"ms-python.pylint",
"ms-python.python",
Expand Down
13 changes: 8 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
// See Also:
// - https://github.com/microsoft/vscode/issues/2809#issuecomment-1544387883
// - mlos_bench/config/schemas/README.md

{
"fileMatch": [
"mlos_bench/mlos_bench/tests/config/schemas/environments/test-cases/**/*.jsonc",
Expand Down Expand Up @@ -129,15 +128,19 @@
"--experimental"
],
"[python]": {
"editor.defaultFormatter": "ms-python.autopep8",
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "modifications"
"editor.formatOnSaveMode": "modifications",
"editor.codeActionsOnSave": {
"source.organizeImports": true,
"source.fixAll": "always"
},
},
// See Also .vscode/launch.json for environment variable args to pytest during debug sessions.
// For the rest, see setup.cfg
"python.testing.pytestArgs": [
"--log-level=DEBUG",
"."
jsfreischuetz marked this conversation as resolved.
Show resolved Hide resolved
],
"python.testing.unittestEnabled": false
"python.testing.unittestEnabled": false,
"restructuredtext.pythonRecommendation.disabled": true
}
32 changes: 16 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,23 @@ clean-conda-env:
rm -f build/conda-env.${CONDA_ENV_NAME}.build-stamp

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

.PHONY: pycodestyle
pycodestyle: conda-env
pycodestyle: build/pycodestyle.mlos_core.${CONDA_ENV_NAME}.build-stamp
pycodestyle: build/pycodestyle.mlos_bench.${CONDA_ENV_NAME}.build-stamp
pycodestyle: build/pycodestyle.mlos_viz.${CONDA_ENV_NAME}.build-stamp
.PHONY: black
black: conda-env
black: build/black.mlos_core.${CONDA_ENV_NAME}.build-stamp
black: build/black.mlos_bench.${CONDA_ENV_NAME}.build-stamp
black: build/black.mlos_viz.${CONDA_ENV_NAME}.build-stamp


build/pycodestyle.mlos_core.${CONDA_ENV_NAME}.build-stamp: $(MLOS_CORE_PYTHON_FILES)
build/pycodestyle.mlos_bench.${CONDA_ENV_NAME}.build-stamp: $(MLOS_BENCH_PYTHON_FILES)
build/pycodestyle.mlos_viz.${CONDA_ENV_NAME}.build-stamp: $(MLOS_VIZ_PYTHON_FILES)
build/black.mlos_core.${CONDA_ENV_NAME}.build-stamp: $(MLOS_CORE_PYTHON_FILES)
build/black.mlos_bench.${CONDA_ENV_NAME}.build-stamp: $(MLOS_BENCH_PYTHON_FILES)
build/black.mlos_viz.${CONDA_ENV_NAME}.build-stamp: $(MLOS_VIZ_PYTHON_FILES)

build/pycodestyle.%.${CONDA_ENV_NAME}.build-stamp: build/conda-env.${CONDA_ENV_NAME}.build-stamp setup.cfg
# Check for decent pep8 code style with pycodestyle.
# Note: if this fails, try using autopep8 to fix it.
conda run -n ${CONDA_ENV_NAME} pycodestyle $(filter-out setup.cfg,$+)
build/black.%.${CONDA_ENV_NAME}.build-stamp: build/conda-env.${CONDA_ENV_NAME}.build-stamp setup.cfg
# Check for decent pep8 code style with black.
# Note: if this fails, try using black to fix it.
conda run -n ${CONDA_ENV_NAME} black --check $(filter-out setup.cfg,$+)
jsfreischuetz marked this conversation as resolved.
Show resolved Hide resolved
touch $@

.PHONY: pydocstyle
Expand Down Expand Up @@ -528,9 +528,9 @@ clean-check:
rm -f build/pylint.${CONDA_ENV_NAME}.build-stamp
rm -f build/pylint.mlos_*.${CONDA_ENV_NAME}.build-stamp
rm -f build/mypy.mlos_*.${CONDA_ENV_NAME}.build-stamp
rm -f build/pycodestyle.build-stamp
rm -f build/pycodestyle.${CONDA_ENV_NAME}.build-stamp
rm -f build/pycodestyle.mlos_*.${CONDA_ENV_NAME}.build-stamp
rm -f build/black.build-stamp
rm -f build/black.${CONDA_ENV_NAME}.build-stamp
rm -f build/black.mlos_*.${CONDA_ENV_NAME}.build-stamp
rm -f build/pydocstyle.build-stamp
rm -f build/pydocstyle.${CONDA_ENV_NAME}.build-stamp
rm -f build/pydocstyle.mlos_*.${CONDA_ENV_NAME}.build-stamp
Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ MLOS is a project to enable autotuning for systems.
<!-- TOC -->

- [MLOS](#mlos)
jsfreischuetz marked this conversation as resolved.
Show resolved Hide resolved
- [Contents](#contents)
- [Overview](#overview)
- [Organization](#organization)
- [Contributing](#contributing)
- [Getting Started](#getting-started)
- [conda activation](#conda-activation)
- [Usage Examples](#usage-examples)
- [mlos-core](#mlos-core)
- [mlos-bench](#mlos-bench)
- [mlos-viz](#mlos-viz)
- [Installation](#installation)
- [See Also](#see-also)
- [Examples](#examples)
- [Contents](#contents)
- [Overview](#overview)
- [Organization](#organization)
- [Contributing](#contributing)
- [Getting Started](#getting-started)
- [conda activation](#conda-activation)
- [Usage Examples](#usage-examples)
- [mlos-core](#mlos-core)
- [mlos-bench](#mlos-bench)
- [mlos-viz](#mlos-viz)
- [Installation](#installation)
- [See Also](#see-also)
- [Examples](#examples)

<!-- /TOC -->

Expand Down
14 changes: 7 additions & 7 deletions SECURITY.md
jsfreischuetz marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ You should receive a response within 24 hours. If for some reason you do not, pl

Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:

* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
* Full paths of source file(s) related to the manifestation of the issue
* The location of the affected source code (tag/branch/commit or direct URL)
* Any special configuration required to reproduce the issue
* Step-by-step instructions to reproduce the issue
* Proof-of-concept or exploit code (if possible)
* Impact of the issue, including how an attacker might exploit the issue
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
* Full paths of source file(s) related to the manifestation of the issue
* The location of the affected source code (tag/branch/commit or direct URL)
* Any special configuration required to reproduce the issue
* Step-by-step instructions to reproduce the issue
* Proof-of-concept or exploit code (if possible)
* Impact of the issue, including how an attacker might exploit the issue

This information will help us triage your report more quickly.

Expand Down
32 changes: 16 additions & 16 deletions conda-envs/mlos-3.10.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies:
# All other dependencies for the mlos modules come from pip.
- pip
- pylint
- pycodestyle
- black
- pydocstyle
- flake8
- setuptools
Expand All @@ -24,18 +24,18 @@ dependencies:
# See comments in mlos.yml.
#- gcc_linux-64
- pip:
- autopep8>=1.7.0
- bump2version
- check-jsonschema
- licenseheaders
- mypy
- pandas-stubs
- types-beautifulsoup4
- types-colorama
- types-jsonschema
- types-pygments
- types-requests
- types-setuptools
- "--editable ../mlos_core[full-tests]"
- "--editable ../mlos_bench[full-tests]"
- "--editable ../mlos_viz[full-tests]"
- autopep8>=1.7.0
- bump2version
- check-jsonschema
- licenseheaders
- mypy
- pandas-stubs
- types-beautifulsoup4
- types-colorama
- types-jsonschema
- types-pygments
- types-requests
- types-setuptools
- "--editable ../mlos_core[full-tests]"
- "--editable ../mlos_bench[full-tests]"
- "--editable ../mlos_viz[full-tests]"
32 changes: 16 additions & 16 deletions conda-envs/mlos-3.11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies:
# All other dependencies for the mlos modules come from pip.
- pip
- pylint
- pycodestyle
- black
- pydocstyle
- flake8
- setuptools
Expand All @@ -24,18 +24,18 @@ dependencies:
# See comments in mlos.yml.
#- gcc_linux-64
- pip:
- autopep8>=1.7.0
- bump2version
- check-jsonschema
- licenseheaders
- mypy
- pandas-stubs
- types-beautifulsoup4
- types-colorama
- types-jsonschema
- types-pygments
- types-requests
- types-setuptools
- "--editable ../mlos_core[full-tests]"
- "--editable ../mlos_bench[full-tests]"
- "--editable ../mlos_viz[full-tests]"
- autopep8>=1.7.0
- bump2version
- check-jsonschema
- licenseheaders
- mypy
- pandas-stubs
- types-beautifulsoup4
- types-colorama
- types-jsonschema
- types-pygments
- types-requests
- types-setuptools
- "--editable ../mlos_core[full-tests]"
- "--editable ../mlos_bench[full-tests]"
- "--editable ../mlos_viz[full-tests]"
32 changes: 16 additions & 16 deletions conda-envs/mlos-3.8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies:
# All other dependencies for the mlos modules come from pip.
- pip
- pylint
- pycodestyle
- black
- pydocstyle
- flake8
- setuptools
Expand All @@ -24,18 +24,18 @@ dependencies:
# See comments in mlos.yml.
#- gcc_linux-64
- pip:
- autopep8>=1.7.0
- bump2version
- check-jsonschema
- licenseheaders
- mypy
- pandas-stubs
- types-beautifulsoup4
- types-colorama
- types-jsonschema
- types-pygments
- types-requests
- types-setuptools
- "--editable ../mlos_core[full-tests]"
- "--editable ../mlos_bench[full-tests]"
- "--editable ../mlos_viz[full-tests]"
- autopep8>=1.7.0
- bump2version
- check-jsonschema
- licenseheaders
- mypy
- pandas-stubs
- types-beautifulsoup4
- types-colorama
- types-jsonschema
- types-pygments
- types-requests
- types-setuptools
- "--editable ../mlos_core[full-tests]"
- "--editable ../mlos_bench[full-tests]"
- "--editable ../mlos_viz[full-tests]"
32 changes: 16 additions & 16 deletions conda-envs/mlos-3.9.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies:
# All other dependencies for the mlos modules come from pip.
- pip
- pylint
- pycodestyle
- black
- pydocstyle
- flake8
- setuptools
Expand All @@ -24,18 +24,18 @@ dependencies:
# See comments in mlos.yml.
#- gcc_linux-64
- pip:
- autopep8>=1.7.0
- bump2version
- check-jsonschema
- licenseheaders
- mypy
- pandas-stubs
- types-beautifulsoup4
- types-colorama
- types-jsonschema
- types-pygments
- types-requests
- types-setuptools
- "--editable ../mlos_core[full-tests]"
- "--editable ../mlos_bench[full-tests]"
- "--editable ../mlos_viz[full-tests]"
- autopep8>=1.7.0
- bump2version
- check-jsonschema
- licenseheaders
- mypy
- pandas-stubs
- types-beautifulsoup4
- types-colorama
- types-jsonschema
- types-pygments
- types-requests
- types-setuptools
- "--editable ../mlos_core[full-tests]"
- "--editable ../mlos_bench[full-tests]"
- "--editable ../mlos_viz[full-tests]"
34 changes: 17 additions & 17 deletions conda-envs/mlos-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies:
# All other dependencies for the mlos modules come from pip.
- pip
- pylint
- pycodestyle
- black
- pydocstyle
- flake8
- setuptools
Expand All @@ -28,19 +28,19 @@ dependencies:
# This also requires a more recent vs2015_runtime from conda-forge.
- conda-forge::pyrfr>=0.9.0
- pip:
- autopep8>=1.7.0
- bump2version
- check-jsonschema
- licenseheaders
- mypy
- pandas-stubs
- types-beautifulsoup4
- types-colorama
- types-jsonschema
- types-pygments
- types-requests
- types-setuptools
- pyarrow
- "--editable ../mlos_core[full-tests]"
- "--editable ../mlos_bench[full-tests]"
- "--editable ../mlos_viz[full-tests]"
- autopep8>=1.7.0
- bump2version
- check-jsonschema
- licenseheaders
- mypy
- pandas-stubs
- types-beautifulsoup4
- types-colorama
- types-jsonschema
- types-pygments
- types-requests
- types-setuptools
- pyarrow
- "--editable ../mlos_core[full-tests]"
- "--editable ../mlos_bench[full-tests]"
- "--editable ../mlos_viz[full-tests]"
Loading
Loading