Skip to content

Commit

Permalink
feat!: support new algoliasearch and django versions (#336)
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts authored Dec 24, 2024
1 parent 7f23fc2 commit b71984f
Show file tree
Hide file tree
Showing 30 changed files with 1,107 additions and 967 deletions.
22 changes: 0 additions & 22 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

73 changes: 73 additions & 0 deletions .github/ISSUE_TEMPLATE/Bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Bug Report
description: File a bug report.
title: '[bug]: '
labels: ['bug', 'triage']
body:
- type: markdown
attributes:
value: |
## Please help us help you!
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.

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

🎟 Related Issue:

## 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/
6 changes: 3 additions & 3 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## `algolia/algoliasearch-django` maintainers

| Name | Email |
|-----------------|---------------------|
| Paul-Louis Nech | support@algolia.com |
| Name | Email |
|-----------------|------------------------|
| Algolia | https://alg.li/support |
Loading

0 comments on commit b71984f

Please sign in to comment.