diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000..aa4949aa1c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,2 @@ +[tool.black] +line-length = 100 diff --git a/requirements/tox/black_requirements.txt b/requirements/tox/black_requirements.txt new file mode 100644 index 0000000000..70f3034c8d --- /dev/null +++ b/requirements/tox/black_requirements.txt @@ -0,0 +1 @@ +black==24.3.0 diff --git a/requirements/tox/twine_requirements.txt b/requirements/tox/twine_requirements.txt index f9d2c8fdce..489eeb83e0 100644 --- a/requirements/tox/twine_requirements.txt +++ b/requirements/tox/twine_requirements.txt @@ -1 +1 @@ -twine==3.8.0 +twine==5.0.0 diff --git a/tox.ini b/tox.ini index f92654842d..718e968013 100644 --- a/tox.ini +++ b/tox.ini @@ -100,28 +100,33 @@ commands = [testenv:flake8] skipdist = true skip_install = true +deps = + -r requirements/tox/flake8_requirements.txt commands = - pip install --exists-action=w -r requirements/tox/flake8_requirements.txt flake8 [testenv:pylint] skipdist = true skip_install = true +deps = + -r requirements/tox/pylint_requirements.txt commands = - pip install --exists-action=w -r requirements/tox/pylint_requirements.txt python -m pylint --rcfile=.pylintrc -j 0 src/sagemaker [testenv:spelling] skipdist = true skip_install = true +deps = + -r requirements/tox/spelling_requirements.txt commands = - pip install --exists-action=w -r requirements/tox/spelling_requirements.txt python -m pylint --rcfile=.pylintrc --disable all --enable spelling --spelling-dict en_US src/sagemaker/{posargs} [testenv:twine] # https://packaging.python.org/guides/making-a-pypi-friendly-readme/#validating-restructuredtext-markup +skip_install = true +deps = + -r requirements/tox/twine_requirements.txt commands = - pip install --exists-action=w -r requirements/tox/twine_requirements.txt python setup.py sdist twine check dist/*.tar.gz @@ -136,25 +141,32 @@ commands = sphinx-build -T -W -b html -d _build/doctrees-readthedocs -D language=en . _build/html [testenv:doc8] +deps = + -r requirements/tox/doc8_requirements.txt commands = - pip install --exists-action=w -r requirements/tox/doc8_requirements.txt doc8 --ignore-path tests/data/serve_resources/mlflow/pytorch/data/pickle_module_info.txt [testenv:black-format] # Used during development (before committing) to format .py files. +skip_install = true setenv = LC_ALL=C.UTF-8 LANG=C.UTF-8 +deps = + -r requirements/tox/black_requirements.txt commands = - black -l 100 ./ + black ./ [testenv:black-check] # Used by automated build steps to check that all files are properly formatted. +skip_install = true setenv = LC_ALL=C.UTF-8 LANG=C.UTF-8 +deps = + -r requirements/tox/black_requirements.txt commands = - black -l 100 --diff --color --check ./ + black --diff --color --check ./ [testenv:clean] skip_install = true @@ -162,13 +174,20 @@ commands = coverage erase [testenv:typing] +# Do not skip installation here, the extras are needed for mypy to get type info +skip_install = false +extras = + all +deps = + -r requirements/tox/mypy_requirements.txt commands = - pip install --exists-action=w -r requirements/tox/mypy_requirements.txt mypy src/sagemaker [testenv:docstyle] +skip_install = true +deps = + -r requirements/tox/pydocstyle_requirements.txt commands = - pip install --exists-action=w -r requirements/tox/pydocstyle_requirements.txt pydocstyle src/sagemaker [testenv:collect-tests]