mirror of https://github.com/microsoft/autogen.git
pyproject.toml & switch to Ruff (#976)
* unify config to pyproject.toml replace flake8 with Ruff * drop configs * update * fixing * Apply suggestions from code review Co-authored-by: Zvi Baratz <z.baratz@gmail.com> * setup * ci * pr template * reword --------- Co-authored-by: Zvi Baratz <z.baratz@gmail.com> Co-authored-by: Li Jiang <lijiang1@microsoft.com>
This commit is contained in:
parent
a8752b6aa0
commit
73bb6e7667
5
.flake8
5
.flake8
|
@ -1,5 +0,0 @@
|
|||
[flake8]
|
||||
ignore = E203, E266, E501, W503, F403, F401, C901
|
||||
max-line-length = 127
|
||||
max-complexity = 10
|
||||
select = B,C,E,F,W,T4,B9
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
## Checks
|
||||
|
||||
- [ ] I've used [pre-commit](https://microsoft.github.io/FLAML/docs/Contribute#pre-commit) to lint the changes in this PR, or I've made sure [lint with flake8](https://github.com/microsoft/FLAML/blob/816a82a1155b4de4705b21a615ccdff67c6da379/.github/workflows/python-package.yml#L54-L59) output is two 0s.
|
||||
- I've used [pre-commit](https://microsoft.github.io/FLAML/docs/Contribute#pre-commit) to lint the changes in this PR (note the same in integrated in our CI checks).
|
||||
- [ ] I've included any doc changes needed for https://microsoft.github.io/FLAML/. See https://microsoft.github.io/FLAML/docs/Contribute#documentation to build and test documentation locally.
|
||||
- [ ] I've added tests (if relevant) corresponding to the changes introduced in this PR.
|
||||
- [ ] I've made sure all auto checks have passed.
|
||||
|
|
|
@ -82,12 +82,6 @@ jobs:
|
|||
run: |
|
||||
# Uninstall pyspark to test env without pyspark
|
||||
pip uninstall -y pyspark
|
||||
- name: Lint with flake8
|
||||
run: |
|
||||
# stop the build if there are Python syntax errors or undefined names
|
||||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
||||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
||||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
||||
- name: Test with pytest
|
||||
if: (matrix.python-version != '3.7' || matrix.os == 'macos-latest') && matrix.python-version != '3.10'
|
||||
run: |
|
||||
|
|
|
@ -7,15 +7,6 @@ ci:
|
|||
autoupdate_schedule: 'quarterly'
|
||||
|
||||
repos:
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 23.1.0
|
||||
hooks:
|
||||
- id: black
|
||||
args: ["--line-length=120"]
|
||||
- repo: https://github.com/pycqa/flake8
|
||||
rev: 6.0.0
|
||||
hooks:
|
||||
- id: flake8
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.4.0
|
||||
hooks:
|
||||
|
@ -31,3 +22,12 @@ repos:
|
|||
- id: trailing-whitespace
|
||||
- id: end-of-file-fixer
|
||||
- id: no-commit-to-branch
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 23.3.0
|
||||
hooks:
|
||||
- id: black
|
||||
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
||||
rev: v0.0.261
|
||||
hooks:
|
||||
- id: ruff
|
||||
args: ["--fix"]
|
||||
|
|
|
@ -2324,10 +2324,7 @@ class HoltWinters(ARIMA):
|
|||
if self.params["trend"] == "mul" and (train_df.y == 0).sum() > 0:
|
||||
self.params["trend"] = "add"
|
||||
|
||||
if not self.params["seasonal"] or not self.params["trend"] in [
|
||||
"mul",
|
||||
"add",
|
||||
]:
|
||||
if not self.params["seasonal"] or self.params["trend"] not in ["mul", "add"]:
|
||||
self.params["damped_trend"] = False
|
||||
|
||||
model = HWExponentialSmoothing(
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
[metadata]
|
||||
license_file = "LICENSE"
|
||||
description-file = "README.md"
|
||||
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
addopts = '-m "not conda"'
|
||||
markers = [
|
||||
"conda: test related to conda forge distribution"
|
||||
]
|
||||
|
||||
[tool.black]
|
||||
# https://github.com/psf/black
|
||||
line-length = 120
|
||||
exclude = "(.eggs|.git|.hg|.mypy_cache|.venv|_build|buck-out|build|dist)"
|
||||
|
||||
|
||||
[tool.ruff]
|
||||
line-length = 120
|
||||
# Enable Pyflakes `E` and `F` codes by default.
|
||||
select = [
|
||||
"E", "W", # see: https://pypi.org/project/pycodestyle
|
||||
"F", # see: https://pypi.org/project/pyflakes
|
||||
# "D", # see: https://pypi.org/project/pydocstyle
|
||||
# "N", # see: https://pypi.org/project/pep8-naming
|
||||
# "S", # see: https://pypi.org/project/flake8-bandit
|
||||
]
|
||||
ignore = [
|
||||
"E501",
|
||||
"F401",
|
||||
"F403",
|
||||
"C901",
|
||||
]
|
||||
# Exclude a variety of commonly ignored directories.
|
||||
exclude = [
|
||||
".eggs",
|
||||
".git",
|
||||
".mypy_cache",
|
||||
".ruff_cache",
|
||||
"__pypackages__",
|
||||
"_build",
|
||||
"build",
|
||||
"dist",
|
||||
"docs"
|
||||
]
|
||||
ignore-init-module-imports = true
|
||||
unfixable = ["F401"]
|
||||
|
||||
[tool.ruff.mccabe]
|
||||
# Unlike Flake8, default to a complexity level of 10.
|
||||
max-complexity = 10
|
|
@ -1,4 +0,0 @@
|
|||
[pytest]
|
||||
addopts = -m "not conda"
|
||||
markers =
|
||||
conda: test related to conda forge distribution
|
Loading…
Reference in New Issue