-
Notifications
You must be signed in to change notification settings - Fork 24
/
setup.cfg
155 lines (128 loc) · 6.46 KB
/
setup.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
[tool:pytest]
; Add flags to print out summary info at end of test run
addopts = -rf
; Prevent top-level test discovery from discovering tests in certain directories
norecursedirs =
; Airflow tests are run separately
recidiviz/airflow
; node_modules can be quite large and won't contain any tests
node_modules
; no need to look in hidden directories
.*
; or at pycache
__pycache__
; fixture directories can also be large and don't contain tests
recidiviz/tests/admin_panel/fixtures
recidiviz/tests/admin_panel/routes/fixtures
recidiviz/tests/auth/fixtures
recidiviz/tests/case_triage/pathways/fixtures
recidiviz/tests/cloud_storage/fixtures
recidiviz/tests/ingest/direct/direct_ingest_fixtures
recidiviz/tests/ingest/direct/fixtures_templates
recidiviz/tests/ingest/direct/ingest_mappings/fixtures
recidiviz/tests/ingest/direct/raw_data/raw_data_diff_fixtures
recidiviz/tests/justice_counts/bulk_upload/bulk_upload_fixtures
recidiviz/tests/metrics/export/fixtures
recidiviz/tests/tools/datasets/fixtures
recidiviz/tests/tools/docs/fixtures
recidiviz/tests/tools/fixtures
recidiviz/tests/tools/ingest/development/create_ingest_config_skeleton_test_fixtures
recidiviz/tests/tools/justice_counts/fixtures
recidiviz/tests/tools/looker/raw_data/fixtures
recidiviz/tests/tools/looker/state/fixtures
recidiviz/tests/validation/fixtures
recidiviz/tests/validation/views/metadata/fixtures
recidiviz/tests/workflows/etl/fixtures
filterwarnings =
; By default, error on warnings, except in the one package where we actually
; explicitly emit a warning and test that we do so.
error:::^(?!recidiviz\.calculator.modeling.population_projection.utils.spark_preprocessing_utils).+
; Filter out warnings of any kind from 3rd-party packages
ignore:::^(?!recidiviz).+
; TODO(#18145): Remove this when we have fixed all these warnings and upgraded to
; SQLAlchemy to 2.0.
ignore::sqlalchemy.exc.RemovedIn20Warning:recidiviz.*
; Spark
ignore::FutureWarning:recidiviz.calculator.modeling.population_projection.*
ignore::FutureWarning:recidiviz.tests.calculator.modeling.population_projection.*
ignore::pandas.errors.PerformanceWarning:recidiviz.calculator.modeling.population_projection.full_compartment.*
ignore::pandas.errors.PerformanceWarning:recidiviz.calculator.modeling.population_projection.shell_compartment.*
; Doppler
ignore::DeprecationWarning:recidiviz.tests.ingest.direct.views.raw_table_query_builder_test.*
ignore::FutureWarning:recidiviz.tests.validation.checks.sameness_check_test.*
; Justice Counts
; TODO(#20142): Revisit whether we need all of these exclusions once Phase 0 code has been removed from the codebase
ignore::FutureWarning:recidiviz.tools.datasets.refresh_county_resident_populations.*
ignore::FutureWarning:recidiviz.tools.datasets.refresh_county_fips.*
ignore::FutureWarning:recidiviz.tests.calculator.query.justice_counts.*
ignore::sqlalchemy.exc.SAWarning:recidiviz.tools.justice_counts.load_fixtures.*
ignore::sqlalchemy.exc.SAWarning:recidiviz.justice_counts.*
ignore::sqlalchemy.exc.SAWarning:recidiviz.tests.justice_counts.*
ignore::sqlalchemy.exc.SAWarning:recidiviz.tests.persistence.database.schema.justice_counts.*
[isort]
profile=black
known_first_party=recidiviz
[mypy]
plugins = recidiviz/tools/lint/mypy_plugin.py
; Show mypy errors when imports that can't be statically resolved (e.g. because an external library does not ship mypy
; stub files). In general, we should aim to only use libraries with mypy types defined.
;
; If we must use a library that does not have types defined we should (in this order):
; 1) Search for a third-party package with mypy stubs for this library and include that package in the dev-packages
; section of the Pipfile
; 2) Find a different library to use that does have mypy types defined
; 3) Define your own stub files for portions of the library we use
; (https://mypy.readthedocs.io/en/stable/stubs.html#stub-files)
; 4) Exempt the library below (discouraged)
;
; Where to find our custom stubs
mypy_path=stubs
; A list of libraries that have been grandfathered to allow types that cannot resolve can be found below.
ignore_missing_imports = False
; Requires that all functions have complete mypy type definitions
disallow_untyped_defs = True
; Configure mypy error messages to show codes in brackets at the end of the message. These can be used to specify which
; error to ignore when using `type: ignore` annotations.
show_error_codes = True
; Treat every namespace (e.g. directory) as a package for the purposes of typechecking, since Python versions >= 3.3
; support packages without __init__.py files. For more info, see:
; https://docs.python.org/3/whatsnew/3.3.html#pep-420-implicit-namespace-packages and
; https://mypy.readthedocs.io/en/stable/config_file.html#confval-namespace_packages.
namespace_packages = True
; TODO(#4334): Find mypy stub files files for all critical libraries and remove exemptions below.
; ~~~~ START ignore_missing_imports EXEMPTIONS ~~~~~
[mypy-airflow.*]
ignore_missing_imports = True
[mypy-gevent.*]
ignore_missing_imports = True
[mypy-googleapiclient.discovery.*]
ignore_missing_imports = True
[mypy-google.cloud.pubsub_v1]
; TODO(googleapis/python-pubsub#536): Mypy stubs are not included for google.cloud.pubsub
ignore_missing_imports = True
[mypy-google.cloud.storage.*]
; TODO(googleapis/python-storage#393): Mypy stubs are not enabled for google.cloud.storage
ignore_missing_imports = True
[mypy-google.oauth2.*]
ignore_missing_imports = True
[mypy-lxml.*]
ignore_missing_imports = True
[mypy-pandas.*]
; Exemption potentially can be removed once we include the data-science-types package
; (https://github.com/predictive-analytics-lab/data-science-types), which provides mypy stubs for pandas and numpy.
ignore_missing_imports = True
[mypy-parameterized.*]
; This is test only, and someday hopefully we can ditch unittest and won't need this.
ignore_missing_imports = True
[mypy-scipy.*]
ignore_missing_imports = True
[mypy-sqlalchemy.*]
; Exemption potentially can be removed once we include the sqlalchemy-stubs package for v1.4:
; https://docs.sqlalchemy.org/en/14/orm/extensions/mypy.html
ignore_missing_imports = True
; ~~~~ END ignore_missing_imports EXEMPTIONS ~~~~~
; Defined for use by autopep8 to autoformat.
; `max_line_length` is duplicated in pylintrc, these should be kept in sync.
[pycodestyle]
max_line_length = 120
aggressive = 1