diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 31ee9c7..d34f80f 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -2,6 +2,7 @@ name: Continuous Deployment on: release: types: [published] + workflow_dispatch: jobs: @@ -10,7 +11,6 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout uses: actions/checkout@v4 @@ -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: @@ -65,6 +66,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: @@ -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 "github-pages@artefactory.com" - sh docs/scripts/buildsite.sh + poetry run git config --global user.name "Github-Pages Bot" + poetry run git config --global user.email "github-pages@artefactory.com" + poetry run sh docs/scripts/buildsite.sh shell: bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 31f627d..bb9b3ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: | diff --git a/docker/Dockerfile b/docker/Dockerfile index d3cca11..a4e0138 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -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/ diff --git a/nlpretext/textloader.py b/nlpretext/textloader.py index cf2444b..7497159 100644 --- a/nlpretext/textloader.py +++ b/nlpretext/textloader.py @@ -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, ) diff --git a/pyproject.toml b/pyproject.toml index a91cf01..f4d4026 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,9 +33,8 @@ 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" @@ -43,11 +42,11 @@ 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" @@ -55,8 +54,8 @@ 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} @@ -64,15 +63,21 @@ torch = {version = "^1.9.0", optional = true} 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" @@ -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