Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: support new algoliasearch and django versions #336

Draft
wants to merge 33 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
099b778
chore: upgrade tooling
shortcuts Nov 20, 2024
6b398ad
chore: update ci
shortcuts Nov 20, 2024
2587b37
chore: update pr and issue template
shortcuts Nov 20, 2024
9d9c876
chore: minor python version
shortcuts Nov 20, 2024
2f9aa46
chore: use pip3
shortcuts Nov 20, 2024
ca426a7
chore: format and setup linter
shortcuts Nov 20, 2024
5907b3e
chore: setup pyright
shortcuts Nov 20, 2024
523958e
fix: use algoliasearch v4 syntax
shortcuts Nov 21, 2024
f6dd4e7
fix: some types
shortcuts Nov 21, 2024
1e0054b
fix: remove user agent for now
shortcuts Nov 22, 2024
d232e1a
fix: some tests and types
shortcuts Nov 22, 2024
2efcc03
chore: remove deprecation notices
shortcuts Nov 25, 2024
f0db28d
fix: assertions
shortcuts Nov 25, 2024
ace44b1
fix: django settings upgrade and some cleanup
shortcuts Nov 25, 2024
466d528
fix: prepare for next python release
shortcuts Nov 26, 2024
bf70da4
chore: format
shortcuts Nov 26, 2024
2cf07af
chore: some types improvements
shortcuts Nov 26, 2024
bc74b9d
fix: decorators
shortcuts Nov 26, 2024
19f93b7
fix: requirements and install from source
shortcuts Nov 26, 2024
3b5b25b
fix: circular import
shortcuts Nov 26, 2024
c85fce2
fix: pull from source until end of bfcm
shortcuts Nov 26, 2024
8f1b561
fix: lint before tests
shortcuts Nov 26, 2024
790dce6
chore: add timeout
shortcuts Nov 26, 2024
893f3f4
fix: types and
shortcuts Nov 26, 2024
999f115
fix: more tests
shortcuts Nov 26, 2024
f7e1282
fix: commands and index tests
shortcuts Nov 26, 2024
be333a1
trigger
shortcuts Nov 26, 2024
651654e
fix: lint and ci
shortcuts Nov 26, 2024
f4f6012
trigger
shortcuts Nov 27, 2024
4a5d054
chore: longer timeout?
shortcuts Nov 27, 2024
d4b2085
chore: ignore at the correct spot
shortcuts Nov 27, 2024
2fb46ff
chore: issue template dir
shortcuts Nov 27, 2024
5df5c84
chore: review
shortcuts Nov 28, 2024
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
89 changes: 70 additions & 19 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,73 @@
<!--
Please use this issue tracker only for reporting bugs or feature requests.
name: Bug Report
description: File a bug report.
title: '[bug]: '
labels: ['bug', 'triage']
body:
- type: markdown
attributes:
value: |
## Please help us help you!

If you need support, please use:

- our community forum
http://discourse.algolia.com

- StackOverflow with the `algolia` tag
https://stackoverflow.com/questions/tagged/algolia
Before filing your issue, ask yourself:
- Is there an issue already opened for this bug?
- Can I reproduce it?

-->
If you are not sure about the origin of the issue, or if it impacts your customer experience, please contact [our support team](https://alg.li/support).
- type: textarea
attributes:
label: Description
description: A clear and concise description of what the bug is.
validations:
required: true
- type: dropdown
id: python version
attributes:
label: python version
description: What is the Python version you've reproduced the error with
options:
- 3.8
- 3.9
- 3.10
- 3.11
- 3.12
- 3.13
validations:
required: true
- type: dropdown
id: django version
attributes:
label: Django version
description: What is the Django version you've reproduced the error with
options:
- 4.0
- 4.1
- 4.2
- 5.0
- 5.1
validations:
required: true
- type: textarea
attributes:
label: Steps to reproduce
description: Write down the steps to reproduce the bug, please include any information that seems relevant for us to reproduce it properly
placeholder: |
1. Use method `...`
2. With parameters `...`
3. See error
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell
- type: checkboxes
attributes:
label: Self-service
description: |
If you feel like you could contribute to this issue, please check the box below. This would tell us and other people looking for contributions that someone's working on it.
If you do check this box, please send a pull request within 7 days so we can still delegate this to someone else.
options:
- label: I'd be willing to fix this bug myself.

- Django version:
- Algolia Django integration version:
- Algolia Client Version: #.#.#
- Language Version:

### Description


### Steps To Reproduce
17 changes: 6 additions & 11 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
| Q | A
| ----------------- | ----------
| Bug fix? | yes/no
| New feature? | yes/no <!-- please update the /CHANGELOG.md file -->
| BC breaks? | no
| Related Issue | Fix #... <!-- will close issue automatically, if any -->
| Need Doc update | yes/no
## 🧭 What and Why

🎟 JIRA Ticket:
shortcuts marked this conversation as resolved.
Show resolved Hide resolved

## Describe your change
### Changes included:

<!--
Please describe your change, add as much detail as
necessary to understand your code.
-->

## What problem is this fixing?
## 🧪 Test

<!--
Please include everything needed to understand the problem,
its context and consequences, and, if possible, how to recreate it.
Please include detail that could help the maintainers of this repository
to assert the changes you've made (e.g. written tests, scenarios).
-->
93 changes: 55 additions & 38 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,51 +17,68 @@ jobs:
strategy:
matrix:
include:
- version: "3.5.4"
toxenv: py35-django20
os: ubuntu-20.04
- version: "3.6.7"
toxenv: py36-django32
os: ubuntu-20.04
- version: "3.7.5"
toxenv: py37-django32
os: ubuntu-20.04
- version: "3.8.15"
toxenv: py38-django32
os: ubuntu-20.04
- version: "3.9"
toxenv: py39-django30
os: ubuntu-latest
- version: "3.9"
toxenv: py39-django31
os: ubuntu-latest
- version: "3.9"
toxenv: py39-django32
os: ubuntu-latest
# django 4.0
- version: "3.8"
toxenv: py38-django40
os: ubuntu-22.04
- version: "3.9"
toxenv: py39-django40
os: ubuntu-latest
- version: "3.9"
toxenv: py39-django41
os: ubuntu-latest
- version: "3.9"
toxenv: py39-django42
os: ubuntu-latest
os: ubuntu-22.04
- version: "3.10"
toxenv: py310-django40
os: ubuntu-latest
os: ubuntu-22.04
# django 4.1
- version: "3.8"
toxenv: py38-django41
os: ubuntu-22.04
- version: "3.9"
toxenv: py39-django41
os: ubuntu-22.04
- version: "3.10"
toxenv: py310-django41
os: ubuntu-latest
- version: "3.10"
toxenv: py310-django42
os: ubuntu-latest
os: ubuntu-22.04
- version: "3.11"
toxenv: py311-django41
os: ubuntu-latest
os: ubuntu-22.04
# django 4.2
- version: "3.8"
toxenv: py38-django42
os: ubuntu-22.04
- version: "3.9"
toxenv: py39-django42
os: ubuntu-22.04
- version: "3.10"
toxenv: py310-django42
os: ubuntu-22.04
- version: "3.11"
toxenv: py311-django42
os: ubuntu-latest
os: ubuntu-22.04
- version: "3.12"
toxenv: py312-django42
os: ubuntu-22.04
# django 5.0
- version: "3.10"
toxenv: py310-django50
os: ubuntu-22.04
- version: "3.11"
toxenv: py311-django50
os: ubuntu-22.04
- version: "3.12"
toxenv: py312-django50
os: ubuntu-22.04
# django 5.1
- version: "3.10"
toxenv: py310-django51
os: ubuntu-22.04
- version: "3.11"
toxenv: py311-django51
os: ubuntu-22.04
- version: "3.12"
toxenv: py312-django51
os: ubuntu-22.04
- version: "3.13"
toxenv: py313-django51
os: ubuntu-22.04

steps:
- uses: actions/checkout@v3
Expand All @@ -72,10 +89,10 @@ jobs:
python-version: ${{ matrix.version }}

- name: Install dependencies and run tests
timeout-minutes: 20
run: |
python -m venv python-ci-run
source python-ci-run/bin/activate
python -m pip install --upgrade pip
python -m pip install tox
python -m pip install -r requirements.txt
pip3 install --upgrade pip
pip3 install tox
TOXENV=${{ matrix.toxenv }} ALGOLIA_APPLICATION_ID=${{ secrets.ALGOLIA_APPLICATION_ID }} ALGOLIA_API_KEY=${{ secrets.ALGOLIA_API_KEY }} tox
46 changes: 6 additions & 40 deletions DOCKER_README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,7 @@
In this page you will find our recommended way of installing Docker on your machine.
This guide is made for OSX users.

## Install Docker

First install Docker using [Homebrew](https://brew.sh/)
```
$ brew install docker
```

You can then install [Docker Desktop](https://docs.docker.com/get-docker/) if you wish, or use `docker-machine`. As we prefer the second option, we will only document this one.

## Setup your Docker

Install `docker-machine`
```
$ brew install docker-machine
```

Then install [VirtualBox](https://www.virtualbox.org/) with [Homebrew Cask](https://github.com/Homebrew/homebrew-cask) to get a driver for your Docker machine
```
$ brew cask install virtualbox
```

You may need to enter your password and authorize the application in your `System Settings` > `Security & Privacy`.

Create now a new machine, set it up as default and connect your shell to it (here we use zsh. The commands should anyway be displayed in each steps' output)

```
$ docker-machine create --driver virtualbox default
$ docker-machine env default
$ eval "$(docker-machine env default)"
```

Now you're all setup to use our provided Docker image!

## Build the image

> Make sure to have [Docker installed](https://docs.docker.com/engine/install/)

```bash
docker build -t algoliasearch-django .
```
Expand All @@ -53,8 +19,8 @@ docker run -it --rm --env ALGOLIA_APPLICATION_ID=XXXXXX \
However, we advise you to export them. That way, you can use [Docker's shorten syntax](https://docs.docker.com/engine/reference/commandline/run/#set-environment-variables--e---env---env-file) to set your variables.

```bash
export ALGOLIA_APPLICATION_ID=XXXXXX
export ALGOLIA_API_KEY=XXX
export ALGOLIA_APPLICATION_ID=XXXXXX
export ALGOLIA_API_KEY=XXX

docker run -it --rm --env ALGOLIA_APPLICATION_ID --env ALGOLIA_API_KEY -v $PWD:/code -w /code algoliasearch-django bash
```
Expand All @@ -64,8 +30,8 @@ Once your container is running, any changes you make in your IDE are directly re
To launch the tests, you can use this command

```bash
tox -e py36-django31
tox -e py313-django51
```

If you'd like to sue an env other that `py36-django31`, run `tox --listenvs` to see the list of available envs.
If you'd like to sue an env other that `py313-django51`, run `tox --listenvs` to see the list of available envs.
Feel free to contact us if you have any questions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8-slim
FROM python:3.13-slim

# Force the stdout and stderr streams to be unbuffered.
# Ensure python output goes to your terminal
Expand All @@ -7,6 +7,6 @@ ENV PYTHONUNBUFFERED=1
WORKDIR /code
COPY requirements.txt /code/

RUN pip install -r requirements.txt
RUN pip3 install --upgrade pip && pip3 install -r requirements.txt

COPY . /code/
2 changes: 1 addition & 1 deletion MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

| Name | Email |
|-----------------|---------------------|
| Paul-Louis Nech | [email protected] |
| Algolia | [email protected] |
shortcuts marked this conversation as resolved.
Show resolved Hide resolved
Loading