| # Copyright (C) 2023 The Android Open Source Project | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| [tool.black] | |
| line-length = 80 | |
| target-version = ['py36', 'py37', 'py38', 'py39', 'py310', 'py311'] #, 'py312' | |
| # Config file for the isort python module. | |
| # This is used to enforce import sorting standards. | |
| # | |
| # https://pycqa.github.io/isort/docs/configuration/options.html | |
| [tool.isort] | |
| # Be compatible with `black` since it also matches what we want. | |
| profile = 'black' | |
| line_length = 80 | |
| length_sort = false | |
| force_single_line = true | |
| lines_after_imports = 2 | |
| from_first = false | |
| case_sensitive = false | |
| force_sort_within_sections = true | |
| order_by_type = false | |
| # Ignore generated files. | |
| extend_skip_glob = '*_pb2.py' | |
| # Allow importing multiple classes on a single line from these modules. | |
| # https://google.github.io/styleguide/pyguide#s2.2-imports | |
| single_line_exclusions = ['abc', 'collections.abc', 'typing'] | |
| [tool.pytest.ini_options] | |
| addopts = [ | |
| "--durations=5", | |
| "--durations-min=1.0", | |
| "--strict-markers", | |
| "--numprocesses=auto", | |
| # Currently the test suite doesn't seem to get faster with more threads, | |
| # so cap it here for now since there's a startup cost for every one. | |
| "--maxprocesses=32", | |
| ] | |
| markers = """ | |
| skip_cq: Skip tests in the CQ. Should be rarely used! | |
| e2e: Hermetic end-to-end tests (tests/e2e/). Deselect with -m 'not e2e'. | |
| """ | |
| # Only keep the temp dirs of failed tests. By default, pytest keeps the temp | |
| # dirs of all tests for the last 3 runs, and each e2e test has its own checkout. | |
| # Use `-o tmp_path_retention_policy=all` to inspect the dirs of passing tests. | |
| tmp_path_retention_policy = "failed" | |
| # https://pyrefly.org/en/docs/configuration/ | |
| [tool.pyrefly] | |
| project-includes = [ | |
| # go/keep-sorted start | |
| "**/*.py*", | |
| "release/update-hooks", | |
| "release/update-manpages", | |
| "repo", | |
| "run_tests", | |
| # go/keep-sorted end | |
| ] | |
| # We use relative module imports for our own modules. | |
| enable-fallback-search-path = true | |
| # NB: Do not add more modules here. We need to shrink this list. | |
| project-excludes = [ | |
| "command.py", | |
| "git_command.py", | |
| "git_config.py", | |
| "git_refs.py", | |
| "git_status.py", | |
| "git_superproject.py", | |
| "main.py", | |
| "manifest_xml.py", | |
| "project.py", | |
| "subcmds/branches.py", | |
| "subcmds/cherry_pick.py", | |
| "subcmds/config.py", | |
| "subcmds/diffmanifests.py", | |
| "subcmds/forall.py", | |
| "subcmds/gc.py", | |
| "subcmds/grep.py", | |
| "subcmds/help.py", | |
| "subcmds/info.py", | |
| "subcmds/init.py", | |
| "subcmds/manifest.py", | |
| "subcmds/rebase.py", | |
| "subcmds/selfupdate.py", | |
| "subcmds/smartsync.py", | |
| "subcmds/stage.py", | |
| "subcmds/start.py", | |
| "subcmds/status.py", | |
| "subcmds/sync.py", | |
| "subcmds/upload.py", | |
| "subcmds/version.py", | |
| "subcmds/wipe.py", | |
| "tests/e2e/harness.py", | |
| "tests/e2e/test_groups.py", | |
| "tests/test_command.py", | |
| "tests/test_git_command.py", | |
| "tests/test_git_config.py", | |
| "tests/test_git_superproject.py", | |
| "tests/test_git_trace2_event_log.py", | |
| "tests/test_manifest_xml.py", | |
| "tests/test_project.py", | |
| "tests/test_subcmds_info.py", | |
| "tests/test_subcmds_sync.py", | |
| "tests/test_subcmds_wipe.py", | |
| "tests/test_wrapper.py", | |
| ] |