File tree 6 files changed +38
-68
lines changed
6 files changed +38
-68
lines changed Original file line number Diff line number Diff line change 20
20
python-version : ' 3.x'
21
21
- name : Install dependencies
22
22
run : |
23
- pip install --upgrade pip
24
- pip install -e .[test]
23
+ pip install tox
25
24
- name : Run code format checks
26
25
run : |
27
- black --check .
28
- flake8
26
+ tox -e linters_check
Original file line number Diff line number Diff line change 1
- [tool .black ]
1
+ [tool .ruff ]
2
+ target-version = " py39"
2
3
line-length = 100
4
+ lint.isort = { known-first-party = [
5
+ " braket" ,
6
+ ] }
7
+ lint.extend-select = [" I" ]
8
+ lint.preview = true
9
+
Original file line number Diff line number Diff line change @@ -7,30 +7,3 @@ addopts =
7
7
--verbose -n auto
8
8
testpaths = test/unit_tests
9
9
10
- [isort]
11
- line_length = 100
12
- multi_line_output = 3
13
- include_trailing_comma = true
14
-
15
- [flake8]
16
- ignore =
17
- # not pep8, black adds whitespace before ':'
18
- E203,
19
- # not pep8, black adds line break before binary operator
20
- W503,
21
- # needed for model regexes
22
- F722,
23
- # needed for model regexes
24
- F821,
25
- # Google Python style is not RST until after processed by Napoleon
26
- # See https://github.com/peterjc/flake8-rst-docstrings/issues/17
27
- RST201,RST203,RST301,
28
- max_line_length = 100
29
- max-complexity = 10
30
- exclude =
31
- __pycache__
32
- .tox
33
- .git
34
- bin
35
- build
36
- venv
Original file line number Diff line number Diff line change 29
29
install_requires = ["pydantic>2" ],
30
30
extras_require = {
31
31
"test" : [
32
- "black" ,
33
- "flake8" ,
34
- "flake8-rst-docstrings" ,
35
- "isort" ,
36
32
"jsonschema" ,
37
33
"numpy" ,
38
34
"pre-commit" ,
39
- "pylint" ,
40
35
"pytest" ,
41
36
"pytest-cov" ,
42
37
"pytest-rerunfailures" ,
43
38
"pytest-xdist" ,
39
+ "tox" ,
40
+ ],
41
+ "linters" : [
42
+ "ruff" ,
43
+ "tox" ,
44
+ ],
45
+ "docs" : [
44
46
"sphinx" ,
45
47
"sphinx-rtd-theme" ,
46
48
"sphinxcontrib-apidoc" ,
47
- "tox" ,
48
- ]
49
+ ],
49
50
},
50
51
url = "https://github.com/amazon-braket/amazon-braket-schemas-python" ,
51
52
author = "Amazon Web Services" ,
Original file line number Diff line number Diff line change 12
12
# language governing permissions and limitations under the License.
13
13
14
14
"""Version information.
15
- Version number (major.minor.patch[-label])
15
+ Version number (major.minor.patch[-label])
16
16
"""
17
17
18
18
__version__ = "1.22.2.dev0"
Original file line number Diff line number Diff line change @@ -10,50 +10,41 @@ extras = test
10
10
11
11
[testenv:linters]
12
12
basepython = python3
13
- skip_install = true
13
+ # Remove this to check what versions are installed for the env. This stops running pip freeze.
14
+ list_dependencies_command = echo
14
15
deps =
15
- {[testenv:isort]deps}
16
- {[testenv:black]deps}
17
- {[testenv:flake8]deps}
16
+ {[testenv:ruff-format]deps}
17
+ {[testenv:ruff-check]deps}
18
18
commands =
19
- # isort MUST come before black as it will revert any changes made by black
20
- {[testenv:isort]commands}
21
- {[testenv:black]commands}
22
- {[testenv:flake8]commands}
19
+ {[testenv:ruff-format]commands}
20
+ {[testenv:ruff-check]commands}
23
21
24
- [testenv:flake8]
22
+ # Read only linter env
23
+ [testenv:linters_check]
25
24
basepython = python3
26
- skip_install = true
27
- deps =
28
- flake8
29
- flake8-rst-docstrings
25
+ extras = linters
30
26
commands =
31
- flake8 {posargs }
27
+ {[testenv:ruff-check]commands }
32
28
33
- [testenv:isort ]
29
+ [testenv:ruff-check ]
34
30
basepython = python3
35
- skip_install = true
36
- deps =
37
- isort
31
+ extras = linters
32
+ deps = ruff
38
33
commands =
39
- isort -rc . {posargs}
34
+ ruff check src {posargs}
40
35
41
- [testenv:black ]
36
+ [testenv:ruff-format ]
42
37
basepython = python3
43
- skip_install = true
44
- deps =
45
- black
38
+ extras = linters
39
+ deps = ruff
46
40
commands =
47
- black ./ {posargs}
41
+ ruff format . {posargs}
48
42
49
43
[testenv:docs]
50
44
basepython = python3
51
- deps =
52
- sphinx
53
- sphinx-rtd-theme
54
- sphinxcontrib-apidoc
55
45
commands =
56
46
sphinx-build -E -T -b html doc build/documentation/html
47
+ extras = docs
57
48
58
49
[testenv:serve-docs]
59
50
basepython = python3
You can’t perform that action at this time.
0 commit comments