Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,36 +25,44 @@ env:
jobs:
build:
runs-on: ubuntu-latest
env:
PYTHONUNBUFFERED: 1
UV_PYTHON: "3.9"
UV_LOCKED: 1
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
lfs: true

- name: Setup Github Pages
uses: actions/configure-pages@v5

- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
cache: "pipenv"
- name: Install pipenv
run: pip install pipenv
- name: Install dependencies
run: |
pipenv install --dev --python=3.9 --deploy

- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
version: "0.11.16"

- name: Build docs
run: |
pipenv run sphinx-apidoc -f -o docs meilisearch/
pipenv run sphinx-build docs ./docs/_build/html/
uv run --only-group docs sphinx-apidoc -f -o docs meilisearch/
uv run --only-group docs sphinx-build docs ./docs/_build/html/
# CNAME file is required for GitHub pages custom domain
- name: Create CNAME file
run: |
echo "$CUSTOM_DOMAIN" > ./docs/_build/html/CNAME
echo "Created CNAME in ./docs/_build/html/: $CUSTOM_DOMAIN"

- name: Upload artifacts
uses: actions/upload-pages-artifact@v3
with:
path: "./docs/_build/html"

deploy:
needs: build
environment:
Expand Down
20 changes: 14 additions & 6 deletions .github/workflows/pre-release-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,28 @@ jobs:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
name: integration-tests-against-rc
runs-on: ubuntu-latest
env:
PYTHONUNBUFFERED: 1
UV_PYTHON: ${{ matrix.python-version }}
UV_LOCKED: 1
steps:
- uses: actions/checkout@v6

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pipenv"
- name: Install pipenv
run: pip install pipenv
- name: Install dependencies
run: pipenv install --dev --python=${{ matrix.python-version }} --deploy

- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
version: "0.11.16"

- name: Get the latest Meilisearch RC
run: echo "MEILISEARCH_VERSION=$(curl https://raw.githubusercontent.com/meilisearch/integration-guides/main/scripts/get-latest-meilisearch-rc.sh | bash)" >> $GITHUB_ENV

- name: Meilisearch (${{ env.MEILISEARCH_VERSION }}) setup with Docker
run: docker run -d -p 7700:7700 getmeili/meilisearch-enterprise:${{ env.MEILISEARCH_VERSION }} meilisearch --master-key=masterKey --no-analytics

- name: Test with pytest
run: pipenv run pytest
run: uv run pytest
23 changes: 14 additions & 9 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,30 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest
env:
PYTHONUNBUFFERED: 1
UV_PYTHON: "3.9"
steps:
- uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
cache: "pipenv"

- name: Check release validity
run: sh .github/scripts/check-release.sh
- name: Install pipenv
run: pip install pipenv
- name: Install dependencies
run: |
pipenv install
pipenv run pip3 install build setuptools wheel twine

- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
version: "0.11.16"
Comment thread
coderabbitai[bot] marked this conversation as resolved.
enable-cache: false

- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: "pypi-${{ secrets.PYPI_API_TOKEN }}"
run: |
pipenv run python3 -m build
pipenv run twine upload dist/*
uv build
uvx twine@6.2.0 upload dist/*
91 changes: 61 additions & 30 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,89 +18,120 @@ jobs:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
name: integration-tests
runs-on: ubuntu-latest
env:
PYTHONUNBUFFERED: 1
UV_PYTHON: ${{ matrix.python-version }}
UV_LOCKED: 1
steps:
- uses: actions/checkout@v6

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pipenv"
- name: Install pipenv
run: pip install pipenv
- name: Install dependencies
run: pipenv install --dev --python=${{ matrix.python-version }} --deploy

- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
version: "0.11.16"

- name: Meilisearch (latest version) setup with Docker
run: docker run -d -p 7700:7700 getmeili/meilisearch-enterprise:latest meilisearch --no-analytics --master-key=masterKey

- name: Test with pytest
run: pipenv run pytest --cov-report=xml
run: uv run pytest --cov-report=xml

pylint:
name: pylint
runs-on: ubuntu-latest
env:
PYTHONUNBUFFERED: 1
UV_PYTHON: "3.9"
UV_LOCKED: 1
steps:
- uses: actions/checkout@v6

- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: "3.9"
cache: "pipenv"
- name: Install pipenv
run: pip install pipenv
- name: Install dependencies
run: pipenv install --dev --python=3.9 --deploy

- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
version: "0.11.16"

- name: Linter with pylint
run: pipenv run pylint meilisearch tests
run: uv run pylint meilisearch tests

mypy:
name: mypy
runs-on: ubuntu-latest
env:
PYTHONUNBUFFERED: 1
UV_PYTHON: "3.9"
UV_LOCKED: 1
steps:
- uses: actions/checkout@v6

- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
cache: "pipenv"
- name: Install pipenv
run: pip install pipenv
- name: Install dependencies
run: pipenv install --dev --python=3.9 --deploy

- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
version: "0.11.16"

- name: mypy type check
run: pipenv run mypy meilisearch
run: uv run mypy meilisearch

black:
name: black
runs-on: ubuntu-latest
env:
PYTHONUNBUFFERED: 1
UV_PYTHON: "3.9"
UV_LOCKED: 1
steps:
- uses: actions/checkout@v6

- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
cache: "pipenv"
- name: Install pipenv
run: pip install pipenv
- name: Install dependencies
run: pipenv install --dev --python=3.9 --deploy

- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
version: "0.11.16"

Comment thread
coderabbitai[bot] marked this conversation as resolved.
- name: black
run: pipenv run black meilisearch tests --check
run: uv run black meilisearch tests --check

isort:
name: isort
runs-on: ubuntu-latest
env:
PYTHONUNBUFFERED: 1
UV_PYTHON: "3.9"
UV_LOCKED: 1
steps:
- uses: actions/checkout@v6

- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
cache: "pipenv"
- name: Install pipenv
run: pip install pipenv
- name: Install dependencies
run: pipenv install --dev --python=3.9 --deploy

- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
version: "0.11.16"

- name: isort
run: pipenv run isort meilisearch tests --check-only
run: uv run isort meilisearch tests --check-only
Comment thread
coderabbitai[bot] marked this conversation as resolved.

yaml-lint:
name: Yaml linting check
Expand Down
9 changes: 1 addition & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,9 @@ target/
profile_default/
ipython_config.py

# pyenv
# uv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

Expand Down
16 changes: 8 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ You can set up your local environment natively or using `docker`, check out the

Example of running all the checks with docker:
```bash
docker-compose run --rm package bash -c "pipenv install --dev && pipenv run mypy meilisearch && pipenv run pylint meilisearch tests && pipenv run pytest tests"
docker-compose run --rm package bash -c "uv run mypy meilisearch && uv run pylint meilisearch tests && uv run pytest tests"
```

To install dependencies:

```bash
pipenv install --dev
uv sync
```

### Tests and Linter <!-- omit in toc -->
Expand All @@ -62,23 +62,23 @@ Your PR also needs to be formatted using black and isort.
# Tests
curl -L https://install.meilisearch.com | sh # download Meilisearch
./meilisearch --master-key=masterKey --no-analytics # run Meilisearch
pipenv run pytest tests
uv run pytest tests
# MyPy
pipenv run mypy meilisearch
uv run mypy meilisearch
# Linter
pipenv run pylint meilisearch tests
uv run pylint meilisearch tests
# Black
pipenv run black meilisearch tests
uv run black meilisearch tests
# Isort
pipenv run isort meilisearch tests
uv run isort meilisearch tests
```

Optionally tox can be used to run test on all supported version of Python, mypy, and linting.

```bash
docker pull getmeili/meilisearch:latest # Fetch the latest version of Meilisearch image from Docker Hub
docker run -p 7700:7700 getmeili/meilisearch:latest meilisearch --master-key=masterKey --no-analytics
pipenv run tox
uv run tox
```

To check if your `yaml` files are correctly formatted, you need to [install yamllint](https://yamllint.readthedocs.io/en/stable/quickstart.html#installing-yamllint) and then run `yamllint .`
Expand Down
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
FROM python:3.9-buster

COPY Pipfile .
COPY Pipfile.lock .
COPY pyproject.toml .
COPY uv.lock .
Comment thread
coderabbitai[bot] marked this conversation as resolved.

RUN apt-get update -y
Comment thread
Strift marked this conversation as resolved.

# Install pipenv and compilation dependencies
RUN pip3 install pipenv
RUN pipenv install --dev
# Install uv
COPY --from=ghcr.io/astral-sh/uv:0.11.16 /uv /uvx /bin/

# Install dependencies
RUN uv sync --frozen --no-install-project
27 changes: 0 additions & 27 deletions Pipfile

This file was deleted.

Loading
Loading