Skip to content

Commit e192813

Browse files
committed
merge: bring branch up-to-date with master branch
2 parents b61bcea + 991d950 commit e192813

441 files changed

Lines changed: 14829 additions & 5444 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2.1
33
jobs:
44
test:
55
docker:
6-
- image: cimg/python:3.12.8
6+
- image: cimg/python:3.13.7
77
steps:
88
- checkout
99
- run:
@@ -25,7 +25,7 @@ jobs:
2525
command: make openapi-generate
2626
build:
2727
docker:
28-
- image: cimg/python:3.12.8
28+
- image: cimg/python:3.13.7
2929
steps:
3030
- checkout
3131
- run:

.github/workflows/database.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Checkout
11-
uses: actions/checkout@v4
11+
uses: actions/checkout@v5
1212
- name: Lint
1313
run: |
1414
set -e
@@ -17,11 +17,20 @@ jobs:
1717
echo "$filename"
1818
./csvlint -lazyquotes "$filename" # TODO: remove lazyquotes when https://github.com/Clever/csvlint/issues/45 will be addressed
1919
done
20+
openapi:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v5
25+
- name: Generate OpenAPI schema
26+
run: |
27+
make install
28+
make openapi-generate
2029
sqlite:
2130
runs-on: ubuntu-latest
2231
steps:
2332
- name: Checkout
24-
uses: actions/checkout@v4
33+
uses: actions/checkout@v5
2534
with:
2635
submodules: recursive
2736
- name: Start pokeapi
@@ -39,7 +48,7 @@ jobs:
3948
runs-on: ubuntu-latest
4049
steps:
4150
- name: Checkout
42-
uses: actions/checkout@v4
51+
uses: actions/checkout@v5
4352
with:
4453
submodules: recursive
4554
- name: Build

.github/workflows/docker-build-and-push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v4
16+
uses: actions/checkout@v5
1717
with:
1818
submodules: recursive
1919
- name: Docker meta

.github/workflows/docker-k8s.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Checkout
11-
uses: actions/checkout@v4
11+
uses: actions/checkout@v5
1212
with:
1313
submodules: recursive
1414
- name: Docker meta
@@ -37,7 +37,7 @@ jobs:
3737
runs-on: ubuntu-latest
3838
steps:
3939
- name: Checkout
40-
uses: actions/checkout@v4
40+
uses: actions/checkout@v5
4141
with:
4242
submodules: recursive
4343
- name: Docker meta
@@ -103,12 +103,12 @@ jobs:
103103
runs-on: ubuntu-latest
104104
steps:
105105
- name: Checkout
106-
uses: actions/checkout@v4
106+
uses: actions/checkout@v5
107107
- name: Build dev environment
108108
run: |
109109
docker compose -f docker-compose.yml -f docker-compose-dev.yml up -d
110110
sleep 30
111111
- name: Assert containers running
112112
run: |
113113
last_command=$(docker ps | grep 'pokeapi-' | wc -l)
114-
test "$last_command" -eq 5
114+
test "$last_command" -eq 5

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v4
13+
uses: actions/checkout@v5
1414
with:
1515
submodules: recursive
1616
- name: Start pokeapi (docker)
@@ -32,7 +32,7 @@ jobs:
3232
nohup make serve &
3333
sleep 3
3434
- name: Release
35-
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda
35+
uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8
3636
if: startsWith(github.ref, 'refs/tags/')
3737
with:
3838
draft: true

CONTRIBUTING.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,18 @@ git checkout -b my_new_branch
2626

2727
Simple!
2828

29+
## AI assisted coding
30+
31+
Using AI assisted coding tools for auto complete, test generation, etc is allowed so long as a human is the overall primary author of a pull request.
32+
33+
Contributions from supervised AI assisted coding agents who build the majority (or all of) a change, such as [co pilot tasks](https://github.blog/changelog/2025-10-28-a-mission-control-to-assign-steer-and-track-copilot-coding-agent-tasks/), will be accepted only on the following basis:
34+
35+
1. A human can verifiably prove they have reviewed and checked that the contribution does what it says it does.
36+
2. The human author provides evidence of the prompt given to the AI agent, and the logs of it producing the change. (For example - co pilot tasks produces a public log).
37+
3. The human author explicitly calls out that an supervised AI agent created the change when they make a pull request.
38+
4. The human author is prepared to own the change (just like any other change they make) and fix any issues that arise from it.
39+
40+
2941
## Financial contributions
3042

3143
We also welcome financial contributions in full transparency on our [open collective](https://opencollective.com/pokeapi).

Makefile

Lines changed: 42 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ veekun_pokedex_repository = ../pokedex
22
local_config = --settings=config.local
33
docker_config = --settings=config.docker-compose
44
gql_compose_config = -f docker-compose.yml -f Resources/compose/docker-compose-prod-graphql.yml
5+
gqlv1beta_compose_config = -f docker-compose.yml -f Resources/compose/docker-compose-prod-graphql.yml -f Resources/compose/docker-compose-prod-graphql-v1beta.yml
6+
7+
# Auto-detect Python and pip commands
8+
PYTHON := $(shell which python3 2>/dev/null || which python 2>/dev/null || echo python3)
9+
PIP := $(shell which pip3 2>/dev/null || which pip 2>/dev/null || echo pip3)
510

611
.PHONY: help
712
.SILENT:
@@ -10,40 +15,40 @@ help:
1015
@grep -E '^[a-zA-Z_-]+:.*?# .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?# "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
1116

1217
install: # Install base requirements to run project
13-
pip install -r requirements.txt
18+
$(PIP) install -r requirements.txt
1419

1520
dev-install: # Install developer requirements + base requirements
16-
pip install -r test-requirements.txt
21+
$(PIP) install -r test-requirements.txt
1722

1823
setup: # Set up the project database
19-
python manage.py migrate ${local_config}
24+
$(PYTHON) manage.py migrate ${local_config}
2025

2126
build-db: # Build database
22-
echo "from data.v2.build import build_all; build_all()" | python manage.py shell ${local_config}
27+
echo "from data.v2.build import build_all; build_all()" | $(PYTHON) manage.py shell ${local_config}
2328

2429
wipe-sqlite-db: # Delete's the project database
2530
rm -rf db.sqlite3
2631

2732
serve: # Run the project locally
28-
python manage.py runserver ${local_config}
33+
$(PYTHON) manage.py runserver ${local_config}
2934

3035
test: # Run tests
31-
python manage.py test ${local_config}
36+
$(PYTHON) manage.py test ${local_config}
3237

3338
clean: # Remove any pyc files
3439
find . -type f -name '*.pyc' -delete
3540

3641
migrate: # Run any outstanding migrations
37-
python manage.py migrate ${local_config}
42+
$(PYTHON) manage.py migrate ${local_config}
3843

3944
make-migrations: # Create migrations files if schema has changed
40-
python manage.py makemigrations ${local_config}
45+
$(PYTHON) manage.py makemigrations ${local_config}
4146

4247
shell: # Load a shell
43-
python manage.py shell ${local_config}
48+
$(PYTHON) manage.py shell ${local_config}
4449

4550
openapi-generate:
46-
python manage.py spectacular --color --file openapi.yml ${local_config}
51+
$(PYTHON) manage.py spectacular --color --file openapi.yml ${local_config}
4752

4853
docker-up: # (Docker) Create services/volumes/networks
4954
docker compose up -d
@@ -82,10 +87,10 @@ docker-prod:
8287
docker-setup: docker-up docker-migrate docker-build-db # (Docker) Start services, prepare the latest DB schema, populate the DB
8388

8489
format: # Format the source code
85-
black .
90+
black . --extend-exclude '.+/scripts/.+'
8691

8792
format-check: # Check the source code has been formatted
88-
black . --check --exclude 'Resources/scripts/.*'
93+
black . --check --extend-exclude '.+/scripts/.+'
8994

9095
pull:
9196
git checkout master
@@ -104,11 +109,17 @@ sync-to-veekun: pull pull-veekun # Copy data from this repository to ../pokedex
104109
# read-env-file: # Exports ./.env into shell environment variables
105110
# export `egrep -v '^#' .env | xargs`
106111

112+
hasura-export-v1beta:
113+
hasura md export --project graphql/v1beta
114+
115+
hasura-apply-v1beta:
116+
hasura md apply --project graphql/v1beta
117+
107118
hasura-export: # Export Hasura configuration, be sure to have set HASURA_GRAPHQL_ADMIN_SECRET
108-
hasura md export --project graphql
119+
hasura md export --project graphql/v1beta2
109120

110121
hasura-apply: # Apply local Hasura configuration, be sure to have set HASURA_GRAPHQL_ADMIN_SECRET
111-
hasura md apply --project graphql
122+
hasura md apply --project graphql/v1beta2
112123

113124
hasura-get-anon-schema: # Dumps GraphQL schema
114125
gq http://localhost:8080/v1/graphql --introspect > graphql/schema.graphql
@@ -143,6 +154,23 @@ down-graphql-prod:
143154
docker volume prune --all --force
144155
sync; echo 3 > /proc/sys/vm/drop_caches
145156

157+
update-graphql-v1beta-data-prod:
158+
docker compose ${gqlv1beta_compose_config} stop
159+
git pull origin master
160+
git submodule update --remote --merge
161+
docker compose ${gqlv1beta_compose_config} up --pull always -d app cache db
162+
sync; echo 3 > /proc/sys/vm/drop_caches
163+
make docker-migrate
164+
make docker-build-db
165+
docker compose ${gqlv1beta_compose_config} stop app cache
166+
docker compose ${gqlv1beta_compose_config} up --pull always -d graphql-engine graphiql
167+
sleep 120
168+
make hasura-apply-v1beta
169+
docker compose ${gqlv1beta_compose_config} up --pull always -d web
170+
docker compose exec -T web sh -c 'rm -rf /tmp/cache/*'
171+
docker image prune -af
172+
sync; echo 3 > /proc/sys/vm/drop_caches
173+
146174
# Nginx doesn't start if upstream graphql-engine is down
147175
update-graphql-data-prod:
148176
docker compose ${gql_compose_config} stop

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ A RESTful API for Pokémon - [pokeapi.co](https://pokeapi.co)
3333
- [Join Us On Slack!](#join-us-on-slack)
3434
- [Contributing](#contributing)
3535

36-
## Setup <a id="setup"></a> &nbsp; [![pyVersion310](https://img.shields.io/badge/python-3.12-blue.svg)](https://www.python.org/download/releases/3.10/)
36+
## Setup <a id="setup"></a> &nbsp; [![pyVersion313](https://img.shields.io/badge/python-3.13-blue.svg)](https://www.python.org/downloads/release/python-3137/)
3737

3838
- Download this source code into a working directory, be sure to use the flag `--recurse-submodules` to clone also our submodules.
3939

@@ -122,7 +122,7 @@ When you start PokéAPI with the above Docker Compose setup, an [Hasura Engine](
122122

123123
```sh
124124
# hasura cli needs to be installed and available in your $PATH: https://hasura.io/docs/latest/graphql/core/hasura-cli/install-hasura-cli.html
125-
# hasura cli's version has to greater than v2.0.8
125+
# hasura cli's version has to greater than v2.48.1
126126
make hasura-apply
127127
```
128128

@@ -171,6 +171,8 @@ This k8s setup creates all k8s resources inside the _Namespace_ `pokeapi`, run `
171171
|.Net Standard |[mtrdp642/PokeApiNet](https://github.com/mtrdp642/PokeApiNet)|Auto caching |
172172
|Dart|[prathanbomb/pokedart](https://github.com/prathanbomb/pokedart)| |
173173
|Go|[mtslzr/pokeapi-go](https://github.com/mtslzr/pokeapi-go)|Auto caching |
174+
|Go|[JoshGuarino/PokeGo](https://github.com/JoshGuarino/PokeGo) |Auto caching |
175+
|Haxe|[KinoCreatesGames/poke-api](https://github.com/KinoCreatesGames/poke-api) |Auto caching |
174176
|PHP |[lmerotta/phpokeapi](https://github.com/lmerotta/phpokeapi)|Auto caching, lazy loading |
175177
|PowerShell|[Celerium/PokeAPI-PowerShellWrapper](https://github.com/Celerium/PokeAPI-PowerShellWrapper)| |
176178
|Python|[beastmatser/aiopokeapi](https://github.com/beastmatser/aiopokeapi)|Auto caching, asynchronous |
@@ -197,7 +199,7 @@ Thank you to all our backers! [Become a backer](https://opencollective.com/pokea
197199
Have a question or just want to discuss new ideas and improvements? Hit us up on Slack. ~~Consider talking with us here before creating a new issue.~~
198200
This way we can keep issues here a bit more organized and helpful in the long run. Be excellent to each other :smile:
199201
200-
[Sign up](https://join.slack.com/t/pokeapi/shared_invite/zt-2ampo6her-_tHSI3uOS65WzGypt7Y96w) easily!
202+
[Sign up](https://join.slack.com/t/pokeapi/shared_invite/zt-38w145rww-I_ROYnZME2n1c7mQXppEAQ) easily!
201203
202204
Once you've signed up visit [PokéAPI on Slack](https://pokeapi.slack.com)
203205

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# TODO: when removing v1beta, delete the file
2+
version: '2.4'
3+
services:
4+
graphiql:
5+
image: pokeapi/graphiql:v1beta-2.1.0
6+
web:
7+
volumes:
8+
- ./Resources/nginx/nginx-gql-v1beta.conf:/etc/nginx/nginx.conf:ro
9+
- ./Resources/nginx/ssl:/ssl:ro
10+
- graphql_cache:/tmp/cache

Resources/compose/docker-compose-prod-graphql.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,9 @@ services:
3333
HASURA_GRAPHQL_EVENTS_HTTP_POOL_SIZE: 10
3434

3535
graphiql:
36-
image: pokeapi/graphiql:2.0.0
36+
image: pokeapi/graphiql:v1beta2-2.1.0
3737
expose:
3838
- 80
3939
depends_on:
4040
- graphql-engine
4141
restart: always
42-
43-
volumes:
44-
graphiql:

0 commit comments

Comments
 (0)