diff --git a/metadata-ingestion/pyproject.toml b/metadata-ingestion/pyproject.toml new file mode 100644 index 0000000000..ae12a75daa --- /dev/null +++ b/metadata-ingestion/pyproject.toml @@ -0,0 +1,18 @@ +[build-system] +build-backend = "setuptools.build_meta" +requires = ["setuptools", "wheel", "pip"] + +[tool.black] +extend-exclude = ''' +# A regex preceded with ^/ will apply only to files and directories +# in the root of the project. +^/tmp +''' +include = '\.pyi?$' +target-version = ['py36', 'py37', 'py38'] + +[tool.isort] +indent = ' ' +profile = 'black' +sections = 'FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER' +skip_glob = 'src/datahub/metadata' diff --git a/metadata-ingestion/setup.cfg b/metadata-ingestion/setup.cfg index 792766b43f..200c6a05a1 100644 --- a/metadata-ingestion/setup.cfg +++ b/metadata-ingestion/setup.cfg @@ -1,8 +1,8 @@ [flake8] -# We ignore the line length issues here, since black will take care of them. -max-line-length = 150 max-complexity = 15 ignore = + # Ignore: line length issues, since black's formatter will take care of them. + E501, # Ignore: 1 blank line required before class docstring. D203, # See https://stackoverflow.com/a/57074416. @@ -29,12 +29,6 @@ disallow_untyped_decorators = yes # eventually we'd like to enable these disallow_untyped_defs = no -[isort] -profile = black -indent=' ' -sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER -skip_glob=src/datahub/metadata - [tool:pytest] addopts = --cov src --cov-report term --cov-config setup.cfg --strict-markers markers = diff --git a/metadata-ingestion/tests/unit/test_rest_sink.py b/metadata-ingestion/tests/unit/test_rest_sink.py index ef378a1076..c4f78e9d63 100644 --- a/metadata-ingestion/tests/unit/test_rest_sink.py +++ b/metadata-ingestion/tests/unit/test_rest_sink.py @@ -43,7 +43,7 @@ basicAuditStamp = models.AuditStampClass( ), "datasets", json.loads( - '{"snapshot": {"urn": "urn:li:dataset:(urn:li:dataPlatform:bigquery,downstream,PROD)", "aspects": [{"com.linkedin.dataset.UpstreamLineage": {"upstreams": [{"auditStamp": {"time": 1618987484580, "actor": "urn:li:corpuser:datahub"}, "dataset": "urn:li:dataset:(urn:li:dataPlatform:bigquery,upstream1,PROD)", "type": "TRANSFORMED"}, {"auditStamp": {"time": 1618987484580, "actor": "urn:li:corpuser:datahub"}, "dataset": "urn:li:dataset:(urn:li:dataPlatform:bigquery,upstream2,PROD)", "type": "TRANSFORMED"}]}}]}}' # noqa: E501 + '{"snapshot": {"urn": "urn:li:dataset:(urn:li:dataPlatform:bigquery,downstream,PROD)", "aspects": [{"com.linkedin.dataset.UpstreamLineage": {"upstreams": [{"auditStamp": {"time": 1618987484580, "actor": "urn:li:corpuser:datahub"}, "dataset": "urn:li:dataset:(urn:li:dataPlatform:bigquery,upstream1,PROD)", "type": "TRANSFORMED"}, {"auditStamp": {"time": 1618987484580, "actor": "urn:li:corpuser:datahub"}, "dataset": "urn:li:dataset:(urn:li:dataPlatform:bigquery,upstream2,PROD)", "type": "TRANSFORMED"}]}}]}}' ), ), (