2021-10-14 16:48:42 +02:00
|
|
|
.PHONY: env38
|
|
|
|
PY_SOURCE ?= ingestion/src
|
2021-08-01 14:27:44 -07:00
|
|
|
|
|
|
|
env38:
|
|
|
|
# virtualenv -p python3.8 env38
|
|
|
|
python3.8 -m venv env38
|
|
|
|
clean_env37:
|
|
|
|
rm -rf env38
|
2021-10-14 16:48:42 +02:00
|
|
|
|
2021-10-15 00:22:59 +02:00
|
|
|
install:
|
2021-12-15 23:23:55 +05:30
|
|
|
python3 -m pip install ingestion/
|
2021-10-15 00:22:59 +02:00
|
|
|
|
2021-10-14 16:48:42 +02:00
|
|
|
install_test:
|
2022-01-07 10:28:38 +01:00
|
|
|
python3 -m pip install "ingestion[test]/"
|
2021-10-15 00:22:59 +02:00
|
|
|
|
2021-10-21 23:51:38 +02:00
|
|
|
install_dev:
|
2022-01-07 10:28:38 +01:00
|
|
|
python3 -m pip install "ingestion[dev]/"
|
2021-10-21 23:51:38 +02:00
|
|
|
|
2021-10-15 00:22:59 +02:00
|
|
|
precommit_install:
|
|
|
|
@echo "Installing pre-commit hooks"
|
|
|
|
@echo "Make sure to first run `make install_test`"
|
2022-01-07 03:53:21 +01:00
|
|
|
pre-commit install
|
2021-10-15 00:22:59 +02:00
|
|
|
|
|
|
|
isort:
|
|
|
|
isort $(PY_SOURCE) --skip $(PY_SOURCE)/metadata/generated --profile black --multi-line 3
|
2021-10-14 16:48:42 +02:00
|
|
|
|
|
|
|
lint:
|
|
|
|
find $(PY_SOURCE) -path $(PY_SOURCE)/metadata/generated -prune -false -o -type f -name "*.py" | xargs pylint
|
|
|
|
|
|
|
|
black:
|
|
|
|
black $(PY_SOURCE) --exclude $(PY_SOURCE)/metadata/generated
|
|
|
|
|
|
|
|
black_check:
|
|
|
|
black --check --diff $(PY_SOURCE) --exclude $(PY_SOURCE)/metadata/generated
|
2021-10-21 23:51:38 +02:00
|
|
|
|
|
|
|
generate:
|
2021-11-23 04:36:05 +05:30
|
|
|
@echo "Running Datamodel Code Generator"
|
2022-01-22 21:08:14 +01:00
|
|
|
@echo "Make sure to first run the install_dev recipe"
|
2021-10-21 23:51:38 +02:00
|
|
|
datamodel-codegen --input catalog-rest-service/src/main/resources/json --input-file-type jsonschema --output ingestion/src/metadata/generated
|
2022-01-22 21:08:14 +01:00
|
|
|
make install
|
2021-11-21 17:02:31 +01:00
|
|
|
|
2021-11-25 11:50:36 +05:30
|
|
|
run_ometa_integration_tests:
|
2022-01-07 10:28:38 +01:00
|
|
|
coverage run -m pytest -c ingestion/setup.cfg --doctest-modules --junitxml=ingestion/junit/test-results-integration.xml --override-ini=testpaths="ingestion/tests/integration/ometa ingestion/tests/integration/stage"
|
|
|
|
|
|
|
|
unit_ingestion:
|
|
|
|
coverage run -m pytest -c ingestion/setup.cfg -s --doctest-modules --junitxml=ingestion/junit/test-results-unit.xml --override-ini=testpaths="ingestion/tests/unit"
|
|
|
|
|
|
|
|
coverage:
|
|
|
|
coverage erase
|
|
|
|
make unit_ingestion
|
|
|
|
make run_ometa_integration_tests
|
|
|
|
coverage xml -i -o ingestion/coverage.xml
|
|
|
|
|
|
|
|
sonar_ingestion:
|
|
|
|
docker run \
|
|
|
|
--rm \
|
|
|
|
-e SONAR_HOST_URL="https://sonarcloud.io" \
|
|
|
|
-e SONAR_LOGIN=$(token) \
|
|
|
|
-v ${PWD}:/usr/src \
|
|
|
|
sonarsource/sonar-scanner-cli \
|
|
|
|
-Dproject.settings=ingestion/sonar-project.properties
|
2021-11-25 11:50:36 +05:30
|
|
|
|
2021-11-21 17:02:31 +01:00
|
|
|
publish:
|
|
|
|
make install_dev generate
|
|
|
|
cd ingestion; \
|
|
|
|
python setup.py install sdist bdist_wheel; \
|
|
|
|
twine check dist/*; \
|
|
|
|
twine upload dist/*
|
2021-12-18 16:41:38 +01:00
|
|
|
|
|
|
|
build_docker_base:
|
|
|
|
make install_dev generate
|
|
|
|
docker build -f ingestion/connectors/Dockerfile-base ingestion/ -t openmetadata/ingestion-connector-base
|
|
|
|
|
|
|
|
build_docker_connectors:
|
|
|
|
@echo "Building Docker connectors. Make sure to run build_docker_base first"
|
|
|
|
python ingestion/connectors/docker-cli.py build
|
|
|
|
|
|
|
|
push_docker_connectors:
|
|
|
|
@echo "Pushing Docker connectors. Make sure to run build_docker_connectors first"
|
|
|
|
python ingestion/connectors/docker-cli.py push
|
2021-12-28 23:16:52 +05:30
|
|
|
|
|
|
|
yarn_install_cache:
|
|
|
|
cd openmetadata-ui/src/main/resources/ui && yarn install --frozen-lockfile
|
|
|
|
|
|
|
|
yarn_start_dev_ui:
|
|
|
|
cd openmetadata-ui/src/main/resources/ui && yarn start
|