diff --git a/.github/workflows/update_pypi.yml b/.github/workflows/update_pypi.yml new file mode 100644 index 00000000..be3c57d9 --- /dev/null +++ b/.github/workflows/update_pypi.yml @@ -0,0 +1,28 @@ +name: Upload Python Package - etk + +on: + push: + tags: + - '*' +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.7' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: usc_isi_i2_admin + TWINE_PASSWORD: ${{ secrets.PYPI }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* diff --git a/etk/etk.py b/etk/etk.py index 399c4d89..2d563c5b 100644 --- a/etk/etk.py +++ b/etk/etk.py @@ -165,7 +165,7 @@ def process_ems(self, doc: Document) -> List[Document]: # self.log(str(e) + " processing with " + str(type(a_em)), "error", doc.doc_id, doc.url) # raise e - if self.kg_schema.legacy: + if self.kg_schema and self.kg_schema.legacy: # Do house cleaning. doc.insert_kg_into_cdr() Utility.make_json_serializable(doc.cdr_document)