Skip to content

Commit

Permalink
ci: fix cd
Browse files Browse the repository at this point in the history
  • Loading branch information
julesbertrand committed Nov 9, 2023
1 parent 23d14b8 commit 4432fb1
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 35 deletions.
25 changes: 13 additions & 12 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Continuous Deployment
on:
release:
types: [published]
workflow_dispatch:

jobs:

Expand All @@ -10,7 +11,6 @@ jobs:
runs-on: ubuntu-latest

steps:

- name: Checkout
uses: actions/checkout@v4

Expand Down Expand Up @@ -48,6 +48,7 @@ jobs:
with:
image: "ghcr.io/artefactory/nlpretext:${{ steps.tag.outputs.tag_name }}"
acs-report-enable: true

- name: upload Anchore scan SARIF report
uses: github/codeql-action/upload-sarif@v1
with:
Expand All @@ -65,6 +66,7 @@ jobs:

- name: Checkout
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand All @@ -87,19 +89,18 @@ jobs:
- name: Install dependencies
run: |
poetry install -E torch
poetry install -E torch -E dask
- name: Publish to PyPI
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
poetry config pypi-token.pypi $PYPI_TOKEN
poetry publish --build
# - name: Publish to PyPI
# env:
# PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
# run: |
# poetry config pypi-token.pypi $PYPI_TOKEN
# poetry publish --build

- name: Run build script for Sphinx pages
run: |
source $(poetry env info | grep Path | awk '{ print $2 }')/bin/activate
git config --global user.name "Github-Pages Bot"
git config --global user.email "[email protected]"
sh docs/scripts/buildsite.sh
poetry run git config --global user.name "Github-Pages Bot"
poetry run git config --global user.email "[email protected]"
poetry run sh docs/scripts/buildsite.sh
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
- name: Install dependencies
run: |
poetry run pip install --upgrade pip
poetry install -E torch
poetry install -E torch dask
- name: Run safety checks
run: |
Expand Down
9 changes: 3 additions & 6 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,14 @@ RUN mkdir -p /home/docker_user/workspace
WORKDIR /home/docker_user/workspace

# Install Poetry
RUN curl -sSL -o install-poetry.py https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py \
&& echo 'daad01ac0c1636f1c0154575c6b3b37a0867e9cedd67d1224fc4259c07b03a86 install-poetry.py' | sha256sum --check \
&& POETRY_HOME=/home/docker_user/poetry python install-poetry.py \
&& rm install-poetry.py
RUN curl -sSL https://install.python-poetry.org | python3 -

ENV PATH="${PATH}:/home/docker_user/.poetry/bin:/home/docker_user/poetry/bin"

COPY pyproject.toml ./
COPY poetry.lock ./

RUN poetry install --no-root --no-dev
RUN poetry lock
RUN poetry install --no-root --no-dev --no-interaction

COPY . /home/docker_user/workspace/

Expand Down
2 changes: 1 addition & 1 deletion nlpretext/textloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from nlpretext._utils import daskloader
except ImportError:
warnings.warn(
"Dask not found, switching to pandas. To be able to use Dask, run : pip install dask[complete]", # noqa: E501
"Dask not found, switching to pandas. To be able to use Dask, run : pip install nlpretext[dask]", # noqa: E501
stacklevel=2,
)

Expand Down
30 changes: 15 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,46 +33,51 @@ classifiers = [ # Update me

[tool.poetry.dependencies]
python = ">=3.8,<3.11"
importlib_metadata = {version = ">=1.6.0", python = "<3.8"}
typer = {extras = ["all"], version = ">=0.3.2"}
rich = ">=10.1.0"
rich = ">=10.1"
chardet = ">=3.0.4"
emoji = ">=2.0.0"
flashtext = ">=2.7"
ftfy = ">=4.2.0"
mosestokenizer = ">=1.1.0"
nlpaug = ">=1.0.1"
nltk = ">=3.4.2"
numpy = ">1.22.0"
numpy = "^1.22"
phonenumbers = ">=8.10.12"
regex = ">=2019.8.19"
sacremoses = ">=0.0.13"
scikit-learn = ">=0.23.2"
scikit-learn = ">=0.23.2, <2"
spacy = ">=3.0.5"
pillow = ">=8.2.1"
thinc = ">=8.0.4"
stop-words = ">=2018.7.23"
pandas = "^1.3"
pyarrow = ">=4.0.0"
fastparquet = ">=0.4.1"
dask = {version = ">=2021.5.0", extras = ["complete"]}
distributed = ">=2021.5.0"
dask = {version = ">=2021.5.0", extras = ["complete"], optional = true}
distributed = {version = ">=2021.5.0", extras = ["complete"], optional = true}
tornado = ">=6.0.3"
torch = {version = "^1.9.0", optional = true}

[tool.poetry.group.dev.dependencies]
isort = ">=5.8.0"
pyupgrade = ">=2.12.0"
black = ">=20.8b1"
ruff = "^0.1.5"
mypy = ">=0.812"
bandit = ">=1.7.0"
safety = ">=1.10.3"
pytest = ">=6.2.1"
pytest-cov = ">=2.10.1"
pylint = ">=2.6.0"
pydocstyle = ">=6.0.0"
coverage = ">=5.3"
pre-commit = ">=2.12.0"
mypy-extensions = ">=0.4.3"
types-emoji = ">=1.2.2"
types-chardet = ">=0.1.3"
types-click = ">=7.1.2"


[tool.poetry.group.docs.dependencies]
nbsphinx = ">=0.8.0"
notebook = ">=6.1.5"
Pygments = ">=2.8.0"
Expand All @@ -88,16 +93,11 @@ sphinxcontrib-serializinghtml = ">=1.1.4"
sphinx-autodoc-typehints = ">=1.11.1"
sphinx_rtd_theme = ">=0.5.2"
sphinx-multiversion-pre-post-build = ">=0.2.4"
coverage = ">=5.3"
python-dotenv = ">=0.5.1"
setuptools = ">=40.8.0"
types-emoji = ">=1.2.2"
types-chardet = ">=0.1.3"
types-click = ">=7.1.2"
ruff = "^0.1.5"


[tool.poetry.extras]
torch = ["torch"]
dask = ["dask", "distributed"]

[tool.black]
# https://github.com/psf/black
Expand Down

0 comments on commit 4432fb1

Please sign in to comment.