From 80a0015bab959d8cb136de897cb6a2bce8f508fa Mon Sep 17 00:00:00 2001 From: Tobias Sterbak Date: Fri, 25 Aug 2023 11:58:02 +0200 Subject: [PATCH] Update workflows --- .github/workflows/publish-to-pypi.yml | 25 +++++++++++++++++++++++++ .github/workflows/python-app.yml | 17 +++++++++-------- Makefile | 3 --- 3 files changed, 34 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/publish-to-pypi.yml diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml new file mode 100644 index 0000000..845a15e --- /dev/null +++ b/.github/workflows/publish-to-pypi.yml @@ -0,0 +1,25 @@ +name: Publish package to PyPI +on: + push: + tags: + - '*.*.*' +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install Poetry + run: curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python + - name: Add Poetry to path + run: echo "${HOME}/.poetry/bin" >> $GITHUB_PATH + - name: Install dependencies + run: | + poetry install --with dev,docs + poetry run python -m spacy download en_core_web_sm + - run: poetry config pypi-token.pypi "${{ secrets.PYPI }}" + - name: Publish package + run: poetry publish --build \ No newline at end of file diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 8ab85b4..b1f891a 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -13,28 +13,29 @@ permissions: contents: read jobs: - build: - + test: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 - name: Set up Python 3.10 uses: actions/setup-python@v3 with: python-version: "3.10" + - name: Install Poetry + run: curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python + - name: Add Poetry to path + run: echo "${HOME}/.poetry/bin" >> $GITHUB_PATH - name: Install dependencies run: | - python -m pip install --upgrade pip - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - python -m spacy download en_core_web_sm + poetry install --with dev,docs + poetry run python -m spacy download en_core_web_sm - name: Lint with Ruff run: | - ruff --format=github --target-version=py310 --ignore E501 biaslyze/ + poetry run ruff --format=github --target-version=py310 --ignore E501 biaslyze/ continue-on-error: true - name: Test with pytest run: | - pytest --cov=biaslyze tests/ --junitxml=junit/test-results.xml --cov-report=xml --cov-report=html + poetry run pytest --cov=biaslyze tests/ --junitxml=junit/test-results.xml --cov-report=xml --cov-report=html - name: Upload pytest test results uses: actions/upload-artifact@v3 with: diff --git a/Makefile b/Makefile index a9ad488..f92a084 100644 --- a/Makefile +++ b/Makefile @@ -2,9 +2,6 @@ install: poetry install --with dev,docs poetry run python -m spacy download en_core_web_sm -export: - poetry export -f requirements.txt --output requirements.txt --with dev --without-hashes - jupyter: poetry run jupyter lab