2022-06-29 14:35:19 -04:00
|
|
|
PACKAGE_NAME := unstructured
|
2023-07-27 14:38:51 -07:00
|
|
|
PIP_VERSION := 23.2.1
|
2023-03-21 13:46:09 -07:00
|
|
|
CURRENT_DIR := $(shell pwd)
|
2023-05-05 17:16:28 -07:00
|
|
|
ARCH := $(shell uname -m)
|
2022-06-29 14:35:19 -04:00
|
|
|
|
|
|
|
.PHONY: help
|
|
|
|
help: Makefile
|
|
|
|
@sed -n 's/^\(## \)\([a-zA-Z]\)/\2/p' $<
|
|
|
|
|
|
|
|
|
|
|
|
###########
|
|
|
|
# Install #
|
|
|
|
###########
|
|
|
|
|
|
|
|
## install-base: installs core requirements needed for text processing bricks
|
|
|
|
.PHONY: install-base
|
|
|
|
install-base: install-base-pip-packages install-nltk-models
|
|
|
|
|
|
|
|
## install: installs all test, dev, and experimental requirements
|
|
|
|
.PHONY: install
|
2023-08-01 11:31:13 -04:00
|
|
|
install: install-base-pip-packages install-dev install-nltk-models install-test install-huggingface install-all-docs
|
2022-06-29 14:35:19 -04:00
|
|
|
|
|
|
|
.PHONY: install-ci
|
2023-09-19 13:20:23 -04:00
|
|
|
install-ci: install-base-pip-packages install-nltk-models install-huggingface install-all-docs install-test
|
2022-06-29 14:35:19 -04:00
|
|
|
|
2023-08-19 12:56:13 -04:00
|
|
|
.PHONY: install-base-ci
|
|
|
|
install-base-ci: install-base-pip-packages install-nltk-models install-test
|
|
|
|
|
2022-06-29 14:35:19 -04:00
|
|
|
.PHONY: install-base-pip-packages
|
|
|
|
install-base-pip-packages:
|
|
|
|
python3 -m pip install pip==${PIP_VERSION}
|
2023-04-11 00:11:50 -07:00
|
|
|
python3 -m pip install -r requirements/base.txt
|
2022-06-29 14:35:19 -04:00
|
|
|
|
2022-10-13 11:18:27 -04:00
|
|
|
.PHONY: install-huggingface
|
|
|
|
install-huggingface:
|
|
|
|
python3 -m pip install pip==${PIP_VERSION}
|
2023-04-11 00:11:50 -07:00
|
|
|
python3 -m pip install -r requirements/huggingface.txt
|
2022-10-13 11:18:27 -04:00
|
|
|
|
2022-06-29 14:35:19 -04:00
|
|
|
.PHONE: install-nltk-models
|
|
|
|
install-nltk-models:
|
|
|
|
python -c "import nltk; nltk.download('punkt')"
|
|
|
|
python -c "import nltk; nltk.download('averaged_perceptron_tagger')"
|
|
|
|
|
|
|
|
.PHONY: install-test
|
|
|
|
install-test:
|
2023-04-11 00:11:50 -07:00
|
|
|
python3 -m pip install -r requirements/test.txt
|
2023-09-14 18:27:18 -05:00
|
|
|
# NOTE(yao) - CI seem to always install tesseract to test so it would make sense to also require
|
|
|
|
# pytesseract installation into the virtual env for testing
|
|
|
|
python3 -m pip install unstructured.pytesseract -c requirements/constraints.in
|
|
|
|
python3 -m pip install argilla -c requirements/constraints.in
|
2023-06-01 16:48:54 -04:00
|
|
|
# NOTE(robinson) - Installing weaviate-client separately here because the requests
|
|
|
|
# version conflicts with label_studio_sdk
|
2023-09-13 18:19:20 -05:00
|
|
|
python3 -m pip install weaviate-client -c requirements/constraints.in
|
|
|
|
# TODO (yao): find out if how to constrain argilla properly without causing conflicts
|
2023-09-11 11:40:56 -04:00
|
|
|
python3 -m pip install argilla
|
2022-06-29 14:35:19 -04:00
|
|
|
|
|
|
|
.PHONY: install-dev
|
|
|
|
install-dev:
|
2023-04-11 00:11:50 -07:00
|
|
|
python3 -m pip install -r requirements/dev.txt
|
2022-06-29 14:35:19 -04:00
|
|
|
|
|
|
|
.PHONY: install-build
|
|
|
|
install-build:
|
2023-04-11 00:11:50 -07:00
|
|
|
python3 -m pip install -r requirements/build.txt
|
2022-06-29 14:35:19 -04:00
|
|
|
|
2023-08-01 11:31:13 -04:00
|
|
|
.PHONY: install-csv
|
|
|
|
install-csv:
|
|
|
|
python3 -m pip install -r requirements/extra-csv.txt
|
|
|
|
|
|
|
|
.PHONY: install-docx
|
|
|
|
install-docx:
|
|
|
|
python3 -m pip install -r requirements/extra-docx.txt
|
|
|
|
|
2023-08-12 16:02:06 -05:00
|
|
|
.PHONY: install-epub
|
|
|
|
install-epub:
|
|
|
|
python3 -m pip install -r requirements/extra-epub.txt
|
|
|
|
|
2023-08-01 11:31:13 -04:00
|
|
|
.PHONY: install-odt
|
|
|
|
install-odt:
|
|
|
|
python3 -m pip install -r requirements/extra-odt.txt
|
|
|
|
|
|
|
|
.PHONY: install-pypandoc
|
|
|
|
install-pypandoc:
|
|
|
|
python3 -m pip install -r requirements/extra-pandoc.txt
|
|
|
|
|
|
|
|
.PHONY: install-markdown
|
|
|
|
install-markdown:
|
|
|
|
python3 -m pip install -r requirements/extra-markdown.txt
|
|
|
|
|
|
|
|
.PHONY: install-msg
|
|
|
|
install-msg:
|
|
|
|
python3 -m pip install -r requirements/extra-msg.txt
|
|
|
|
|
|
|
|
.PHONY: install-pdf-image
|
|
|
|
install-pdf-image:
|
|
|
|
python3 -m pip install -r requirements/extra-pdf-image.txt
|
|
|
|
|
|
|
|
.PHONY: install-pptx
|
|
|
|
install-pptx:
|
|
|
|
python3 -m pip install -r requirements/extra-pptx.txt
|
|
|
|
|
|
|
|
.PHONY: install-xlsx
|
|
|
|
install-xlsx:
|
|
|
|
python3 -m pip install -r requirements/extra-xlsx.txt
|
|
|
|
|
|
|
|
.PHONY: install-all-docs
|
2023-08-12 16:02:06 -05:00
|
|
|
install-all-docs: install-base install-csv install-docx install-epub install-odt install-pypandoc install-markdown install-msg install-pdf-image install-pptx install-xlsx
|
2023-08-01 11:31:13 -04:00
|
|
|
|
2023-03-07 06:01:02 +00:00
|
|
|
.PHONY: install-ingest-google-drive
|
|
|
|
install-ingest-google-drive:
|
2023-04-11 00:11:50 -07:00
|
|
|
python3 -m pip install -r requirements/ingest-google-drive.txt
|
2023-03-07 06:01:02 +00:00
|
|
|
|
2023-02-14 12:27:45 -08:00
|
|
|
## install-ingest-s3: install requirements for the s3 connector
|
|
|
|
.PHONY: install-ingest-s3
|
|
|
|
install-ingest-s3:
|
2023-04-11 00:11:50 -07:00
|
|
|
python3 -m pip install -r requirements/ingest-s3.txt
|
2023-02-14 12:27:45 -08:00
|
|
|
|
2023-06-21 15:14:50 -07:00
|
|
|
.PHONY: install-ingest-gcs
|
|
|
|
install-ingest-gcs:
|
|
|
|
python3 -m pip install -r requirements/ingest-gcs.txt
|
|
|
|
|
2023-06-30 17:08:27 -07:00
|
|
|
.PHONY: install-ingest-dropbox
|
|
|
|
install-ingest-dropbox:
|
|
|
|
python3 -m pip install -r requirements/ingest-dropbox.txt
|
|
|
|
|
2023-03-11 00:43:40 +01:00
|
|
|
.PHONY: install-ingest-azure
|
|
|
|
install-ingest-azure:
|
2023-04-11 00:11:50 -07:00
|
|
|
python3 -m pip install -r requirements/ingest-azure.txt
|
2023-03-11 00:43:40 +01:00
|
|
|
|
2023-07-31 18:10:10 -07:00
|
|
|
.PHONY: install-ingest-box
|
|
|
|
install-ingest-box:
|
|
|
|
python3 -m pip install -r requirements/ingest-box.txt
|
|
|
|
|
2023-08-22 10:19:46 -04:00
|
|
|
.PHONY: install-ingest-delta-table
|
|
|
|
install-ingest-delta-table:
|
|
|
|
python3 -m pip install -r requirements/ingest-delta-table.txt
|
|
|
|
|
2023-05-16 11:46:30 -07:00
|
|
|
.PHONY: install-ingest-discord
|
|
|
|
install-ingest-discord:
|
|
|
|
pip install -r requirements/ingest-discord.txt
|
|
|
|
|
2023-02-27 23:36:44 +01:00
|
|
|
.PHONY: install-ingest-github
|
|
|
|
install-ingest-github:
|
2023-04-11 00:11:50 -07:00
|
|
|
python3 -m pip install -r requirements/ingest-github.txt
|
2023-02-27 23:36:44 +01:00
|
|
|
|
2023-08-21 15:16:50 -04:00
|
|
|
.PHONY: install-ingest-biomed
|
|
|
|
install-ingest-biomed:
|
|
|
|
python3 -m pip install -r requirements/ingest-biomed.txt
|
|
|
|
|
2023-03-08 09:15:21 +01:00
|
|
|
.PHONY: install-ingest-gitlab
|
|
|
|
install-ingest-gitlab:
|
2023-04-11 00:11:50 -07:00
|
|
|
python3 -m pip install -r requirements/ingest-gitlab.txt
|
2023-03-08 09:15:21 +01:00
|
|
|
|
2023-07-13 14:57:54 -06:00
|
|
|
.PHONY: install-ingest-onedrive
|
|
|
|
install-ingest-onedrive:
|
|
|
|
python3 -m pip install -r requirements/ingest-onedrive.txt
|
|
|
|
|
2023-07-25 21:09:26 -07:00
|
|
|
.PHONY: install-ingest-outlook
|
|
|
|
install-ingest-outlook:
|
|
|
|
python3 -m pip install -r requirements/ingest-outlook.txt
|
|
|
|
|
2023-02-27 09:11:04 +01:00
|
|
|
.PHONY: install-ingest-reddit
|
|
|
|
install-ingest-reddit:
|
2023-04-11 00:11:50 -07:00
|
|
|
python3 -m pip install -r requirements/ingest-reddit.txt
|
2023-02-27 09:11:04 +01:00
|
|
|
|
2023-04-16 12:34:43 -07:00
|
|
|
.PHONY: install-ingest-slack
|
|
|
|
install-ingest-slack:
|
|
|
|
pip install -r requirements/ingest-slack.txt
|
|
|
|
|
2023-02-28 09:25:11 +01:00
|
|
|
.PHONY: install-ingest-wikipedia
|
|
|
|
install-ingest-wikipedia:
|
2023-04-11 00:11:50 -07:00
|
|
|
python3 -m pip install -r requirements/ingest-wikipedia.txt
|
2023-02-28 09:25:11 +01:00
|
|
|
|
2023-07-01 18:45:28 +01:00
|
|
|
.PHONY: install-ingest-elasticsearch
|
|
|
|
install-ingest-elasticsearch:
|
|
|
|
python3 -m pip install -r requirements/ingest-elasticsearch.txt
|
2023-07-18 19:29:41 +01:00
|
|
|
|
|
|
|
.PHONY: install-ingest-confluence
|
|
|
|
install-ingest-confluence:
|
|
|
|
python3 -m pip install -r requirements/ingest-confluence.txt
|
|
|
|
|
2023-08-11 22:02:51 +03:00
|
|
|
.PHONY: install-ingest-airtable
|
|
|
|
install-ingest-airtable:
|
|
|
|
python3 -m pip install -r requirements/ingest-airtable.txt
|
|
|
|
|
2023-08-15 00:15:44 -05:00
|
|
|
.PHONY: install-ingest-sharepoint
|
|
|
|
install-ingest-sharepoint:
|
|
|
|
python3 -m pip install -r requirements/ingest-sharepoint.txt
|
|
|
|
|
2023-08-21 15:16:50 -04:00
|
|
|
.PHONY: install-ingest-local
|
|
|
|
install-ingest-local:
|
|
|
|
echo "no unique dependencies for local connector"
|
|
|
|
|
|
|
|
.PHONY: install-ingest-notion
|
|
|
|
install-ingest-notion:
|
|
|
|
python3 -m pip install -r requirements/ingest-notion.txt
|
|
|
|
|
2023-09-02 08:50:31 -07:00
|
|
|
.PHONY: install-ingest-salesforce
|
|
|
|
install-ingest-salesforce:
|
|
|
|
python3 -m pip install -r requirements/ingest-salesforce.txt
|
|
|
|
|
feat: jira connector (cloud) (#1238)
This connector:
- takes a Jira Cloud URL, user email and api token; to authenticate into
Jira Cloud
- ingests:
- either all issues in all projects in a Jira Cloud Organization
- or
- issues in user specified projects, boards
- user specified issues
- processes this kind of data:
- text fields such as issue summary, description, and comments
- dropdown fields such as issue type, status, priority, assignee,
reporter, labels, and components
- other data such as issue id, issue key, project id, information on
subtasks
- notes down attachment URLs, however does not process attachments
- stores each downloaded issue in a txt file, in a predefined template
form (consisting of the data above)
- then processes each downloaded issue document into elements using
unstructured library
- related to: https://github.com/Unstructured-IO/unstructured/issues/263
To test the changes, make the necessary setups and run the relevant
ingest test scripts.
---------
Co-authored-by: ryannikolaidis <1208590+ryannikolaidis@users.noreply.github.com>
Co-authored-by: ahmetmeleq <ahmetmeleq@users.noreply.github.com>
2023-09-06 13:10:48 +03:00
|
|
|
.PHONY: install-ingest-jira
|
|
|
|
install-ingest-jira:
|
|
|
|
python3 -m pip install -r requirements/ingest-jira.txt
|
|
|
|
|
2023-01-04 16:19:05 -06:00
|
|
|
.PHONY: install-unstructured-inference
|
|
|
|
install-unstructured-inference:
|
2023-04-11 00:11:50 -07:00
|
|
|
python3 -m pip install -r requirements/local-inference.txt
|
2023-01-04 16:19:05 -06:00
|
|
|
|
|
|
|
## install-local-inference: installs requirements for local inference
|
|
|
|
.PHONY: install-local-inference
|
2023-08-01 11:31:13 -04:00
|
|
|
install-local-inference: install install-all-docs
|
2023-01-04 16:19:05 -06:00
|
|
|
|
2023-05-26 15:38:48 -04:00
|
|
|
.PHONY: install-pandoc
|
|
|
|
install-pandoc:
|
|
|
|
ARCH=${ARCH} ./scripts/install-pandoc.sh
|
|
|
|
|
2023-09-15 17:05:48 -07:00
|
|
|
.PHONY: install-paddleocr
|
|
|
|
install-paddleocr:
|
|
|
|
ARCH=${ARCH} ./scripts/install-paddleocr.sh
|
2023-05-26 15:38:48 -04:00
|
|
|
|
2022-06-29 14:35:19 -04:00
|
|
|
## pip-compile: compiles all base/dev/test requirements
|
|
|
|
.PHONY: pip-compile
|
|
|
|
pip-compile:
|
2023-09-01 14:47:50 -05:00
|
|
|
@for file in $(shell ls requirements/*.in); do \
|
|
|
|
if [[ "$${file}" =~ "constraints" ]]; then \
|
|
|
|
continue; \
|
|
|
|
fi; \
|
|
|
|
echo "running: pip-compile --upgrade $${file}"; \
|
2023-08-31 18:19:53 -04:00
|
|
|
pip-compile --upgrade $${file}; \
|
2023-09-01 14:47:50 -05:00
|
|
|
done
|
2022-06-29 14:35:19 -04:00
|
|
|
cp requirements/build.txt docs/requirements.txt
|
2023-08-31 18:19:53 -04:00
|
|
|
|
|
|
|
|
2022-06-29 14:35:19 -04:00
|
|
|
|
|
|
|
## install-project-local: install unstructured into your local python environment
|
|
|
|
.PHONY: install-project-local
|
|
|
|
install-project-local: install
|
|
|
|
# MAYBE TODO: fail if already exists?
|
|
|
|
pip install -e .
|
|
|
|
|
|
|
|
## uninstall-project-local: uninstall unstructured from your local python environment
|
|
|
|
.PHONY: uninstall-project-local
|
|
|
|
uninstall-project-local:
|
|
|
|
pip uninstall ${PACKAGE_NAME}
|
|
|
|
|
|
|
|
#################
|
|
|
|
# Test and Lint #
|
|
|
|
#################
|
|
|
|
|
2023-06-29 10:31:01 -07:00
|
|
|
export CI ?= false
|
|
|
|
|
2022-06-29 14:35:19 -04:00
|
|
|
## test: runs all unittests
|
|
|
|
.PHONY: test
|
|
|
|
test:
|
2023-06-29 10:31:01 -07:00
|
|
|
PYTHONPATH=. CI=$(CI) pytest test_${PACKAGE_NAME} --cov=${PACKAGE_NAME} --cov-report term-missing
|
2022-06-29 14:35:19 -04:00
|
|
|
|
2023-07-26 16:55:35 -04:00
|
|
|
.PHONY: test-unstructured-api-unit
|
|
|
|
test-unstructured-api-unit:
|
|
|
|
scripts/test-unstructured-api-unit.sh
|
|
|
|
|
2023-08-19 12:56:13 -04:00
|
|
|
.PHONY: test-no-extras
|
|
|
|
# TODO(newelh) Add json test when fixed
|
|
|
|
test-no-extras:
|
|
|
|
PYTHONPATH=. CI=$(CI) pytest \
|
|
|
|
test_${PACKAGE_NAME}/partition/test_text.py \
|
|
|
|
test_${PACKAGE_NAME}/partition/test_email.py \
|
|
|
|
test_${PACKAGE_NAME}/partition/test_html_partition.py \
|
2023-08-31 18:19:53 -04:00
|
|
|
test_${PACKAGE_NAME}/partition/test_xml_partition.py
|
2023-08-19 12:56:13 -04:00
|
|
|
|
|
|
|
.PHONY: test-extra-csv
|
|
|
|
test-extra-csv:
|
|
|
|
PYTHONPATH=. CI=$(CI) pytest \
|
|
|
|
test_${PACKAGE_NAME}/partition/csv
|
|
|
|
|
|
|
|
.PHONY: test-extra-docx
|
|
|
|
test-extra-docx:
|
|
|
|
PYTHONPATH=. CI=$(CI) pytest \
|
|
|
|
test_${PACKAGE_NAME}/partition/docx
|
|
|
|
|
|
|
|
.PHONY: test-extra-markdown
|
|
|
|
test-extra-markdown:
|
|
|
|
PYTHONPATH=. CI=$(CI) pytest \
|
|
|
|
test_${PACKAGE_NAME}/partition/markdown
|
|
|
|
|
|
|
|
.PHONY: test-extra-msg
|
|
|
|
test-extra-msg:
|
|
|
|
PYTHONPATH=. CI=$(CI) pytest \
|
|
|
|
test_${PACKAGE_NAME}/partition/msg
|
|
|
|
|
|
|
|
.PHONY: test-extra-odt
|
|
|
|
test-extra-odt:
|
|
|
|
PYTHONPATH=. CI=$(CI) pytest \
|
|
|
|
test_${PACKAGE_NAME}/partition/odt
|
|
|
|
|
|
|
|
.PHONY: test-extra-pdf-image
|
|
|
|
test-extra-pdf-image:
|
|
|
|
PYTHONPATH=. CI=$(CI) pytest \
|
|
|
|
test_${PACKAGE_NAME}/partition/pdf-image
|
|
|
|
|
|
|
|
.PHONY: test-extra-pptx
|
|
|
|
test-extra-pptx:
|
|
|
|
PYTHONPATH=. CI=$(CI) pytest \
|
|
|
|
test_${PACKAGE_NAME}/partition/pptx
|
|
|
|
|
|
|
|
.PHONY: test-extra-epub
|
2023-08-29 01:49:18 -05:00
|
|
|
test-extra-epub:
|
2023-08-19 12:56:13 -04:00
|
|
|
PYTHONPATH=. CI=$(CI) pytest \
|
|
|
|
test_${PACKAGE_NAME}/partition/epub
|
|
|
|
|
|
|
|
.PHONY: test-extra-pypandoc
|
|
|
|
test-extra-pypandoc:
|
|
|
|
PYTHONPATH=. CI=$(CI) pytest \
|
|
|
|
test_${PACKAGE_NAME}/partition/pypandoc
|
|
|
|
|
|
|
|
.PHONY: test-extra-xlsx
|
|
|
|
test-extra-xlsx:
|
|
|
|
PYTHONPATH=. CI=$(CI) pytest \
|
|
|
|
test_${PACKAGE_NAME}/partition/xlsx
|
|
|
|
|
2022-06-29 14:35:19 -04:00
|
|
|
## check: runs linters (includes tests)
|
|
|
|
.PHONY: check
|
2022-10-10 13:11:48 -05:00
|
|
|
check: check-src check-tests check-version
|
2022-06-29 14:35:19 -04:00
|
|
|
|
|
|
|
## check-src: runs linters (source only, no tests)
|
|
|
|
.PHONY: check-src
|
|
|
|
check-src:
|
2023-09-19 15:32:46 -07:00
|
|
|
ruff . --select I,UP015,UP032,UP034,UP018,COM,C4,PT,SIM,PLR0402 --ignore COM812,PT011,PT012,SIM117
|
2022-06-29 14:35:19 -04:00
|
|
|
black --line-length 100 ${PACKAGE_NAME} --check
|
|
|
|
flake8 ${PACKAGE_NAME}
|
2022-11-14 17:57:05 +00:00
|
|
|
mypy ${PACKAGE_NAME} --ignore-missing-imports --check-untyped-defs
|
2022-06-29 14:35:19 -04:00
|
|
|
|
|
|
|
.PHONY: check-tests
|
|
|
|
check-tests:
|
|
|
|
black --line-length 100 test_${PACKAGE_NAME} --check
|
2023-09-11 11:40:56 -04:00
|
|
|
black --line-length 100 test_${PACKAGE_NAME}_ingest --check
|
2022-06-29 14:35:19 -04:00
|
|
|
flake8 test_${PACKAGE_NAME}
|
2023-09-11 11:40:56 -04:00
|
|
|
flake8 test_${PACKAGE_NAME}_ingest
|
2022-06-29 14:35:19 -04:00
|
|
|
|
2022-09-29 15:24:28 -04:00
|
|
|
## check-scripts: run shellcheck
|
|
|
|
.PHONY: check-scripts
|
|
|
|
check-scripts:
|
|
|
|
# Fail if any of these files have warnings
|
|
|
|
scripts/shellcheck.sh
|
|
|
|
|
2022-10-10 13:11:48 -05:00
|
|
|
## check-version: run check to ensure version in CHANGELOG.md matches version in package
|
|
|
|
.PHONY: check-version
|
|
|
|
check-version:
|
|
|
|
# Fail if syncing version would produce changes
|
2023-04-21 05:48:38 +09:00
|
|
|
scripts/version-sync.sh -c \
|
|
|
|
-f "unstructured/__version__.py" semver
|
2022-10-10 13:11:48 -05:00
|
|
|
|
2022-06-29 14:35:19 -04:00
|
|
|
## tidy: run black
|
|
|
|
.PHONY: tidy
|
|
|
|
tidy:
|
2023-02-27 17:30:54 +01:00
|
|
|
ruff . --select I,UP015,UP032,UP034,UP018,COM,C4,PT,SIM,PLR0402 --fix-only || true
|
2022-06-29 14:35:19 -04:00
|
|
|
black --line-length 100 ${PACKAGE_NAME}
|
|
|
|
black --line-length 100 test_${PACKAGE_NAME}
|
2023-09-11 11:40:56 -04:00
|
|
|
black --line-length 100 test_${PACKAGE_NAME}_ingest
|
2022-06-29 14:35:19 -04:00
|
|
|
|
2022-10-10 13:11:48 -05:00
|
|
|
## version-sync: update __version__.py with most recent version from CHANGELOG.md
|
|
|
|
.PHONY: version-sync
|
|
|
|
version-sync:
|
2023-04-21 05:48:38 +09:00
|
|
|
scripts/version-sync.sh \
|
|
|
|
-f "unstructured/__version__.py" semver
|
2022-10-10 13:11:48 -05:00
|
|
|
|
2022-06-29 14:35:19 -04:00
|
|
|
.PHONY: check-coverage
|
|
|
|
check-coverage:
|
|
|
|
coverage report --fail-under=95
|
2023-03-14 13:40:01 -07:00
|
|
|
|
2023-05-24 17:29:35 -05:00
|
|
|
## check-deps: check consistency of dependencies
|
|
|
|
.PHONY: check-deps
|
|
|
|
check-deps:
|
|
|
|
scripts/consistent-deps.sh
|
|
|
|
|
2023-03-14 13:40:01 -07:00
|
|
|
##########
|
|
|
|
# Docker #
|
|
|
|
##########
|
|
|
|
|
|
|
|
# Docker targets are provided for convenience only and are not required in a standard development environment
|
|
|
|
|
2023-04-06 00:34:07 -07:00
|
|
|
DOCKER_IMAGE ?= unstructured:dev
|
2023-03-29 00:02:39 -07:00
|
|
|
|
2023-03-14 13:40:01 -07:00
|
|
|
.PHONY: docker-build
|
|
|
|
docker-build:
|
2023-04-06 00:34:07 -07:00
|
|
|
PIP_VERSION=${PIP_VERSION} DOCKER_IMAGE_NAME=${DOCKER_IMAGE} ./scripts/docker-build.sh
|
2023-03-14 13:40:01 -07:00
|
|
|
|
|
|
|
.PHONY: docker-start-bash
|
|
|
|
docker-start-bash:
|
2023-04-06 00:34:07 -07:00
|
|
|
docker run -ti --rm ${DOCKER_IMAGE}
|
2023-03-21 13:46:09 -07:00
|
|
|
|
2023-08-31 14:26:29 -05:00
|
|
|
.PHONY: docker-start-dev
|
|
|
|
docker-start-dev:
|
|
|
|
docker run --rm \
|
|
|
|
-v ${CURRENT_DIR}:/mnt/local_unstructued \
|
|
|
|
-ti ${DOCKER_IMAGE}
|
|
|
|
|
2023-03-21 13:46:09 -07:00
|
|
|
.PHONY: docker-test
|
|
|
|
docker-test:
|
2023-04-06 00:34:07 -07:00
|
|
|
docker run --rm \
|
2023-08-29 18:01:44 -07:00
|
|
|
-v ${CURRENT_DIR}/test_unstructured:/home/notebook-user/test_unstructured \
|
|
|
|
-v ${CURRENT_DIR}/test_unstructured_ingest:/home/notebook-user/test_unstructured_ingest \
|
2023-06-29 10:31:01 -07:00
|
|
|
$(if $(wildcard uns_test_env_file),--env-file uns_test_env_file,) \
|
2023-03-29 00:02:39 -07:00
|
|
|
$(DOCKER_IMAGE) \
|
2023-06-29 10:31:01 -07:00
|
|
|
bash -c "CI=$(CI) pytest $(if $(TEST_NAME),-k $(TEST_NAME),) test_unstructured"
|
2023-03-30 13:23:30 -07:00
|
|
|
|
|
|
|
.PHONY: docker-smoke-test
|
|
|
|
docker-smoke-test:
|
2023-04-06 10:03:42 -07:00
|
|
|
DOCKER_IMAGE=${DOCKER_IMAGE} ./scripts/docker-smoke-test.sh
|
2023-05-31 17:01:23 +03:00
|
|
|
|
|
|
|
|
|
|
|
###########
|
|
|
|
# Jupyter #
|
|
|
|
###########
|
|
|
|
|
|
|
|
.PHONY: docker-jupyter-notebook
|
|
|
|
docker-jupyter-notebook:
|
|
|
|
docker run -p 8888:8888 --mount type=bind,source=$(realpath .),target=/home --entrypoint jupyter-notebook -t --rm ${DOCKER_IMAGE} --allow-root --port 8888 --ip 0.0.0.0 --NotebookApp.token='' --NotebookApp.password=''
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: run-jupyter
|
|
|
|
run-jupyter:
|
2023-06-01 16:48:54 -04:00
|
|
|
PYTHONPATH=$(realpath .) JUPYTER_PATH=$(realpath .) jupyter-notebook --NotebookApp.token='' --NotebookApp.password=''
|