Merge pull request #509 from PokeAPI/staging

Force-merging
This commit is contained in:
Alessandro Pezzè 2020-07-23 17:24:02 +02:00 committed by GitHub
commit 3db9fa71ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6888 changed files with 87 additions and 21 deletions

View file

@ -6,6 +6,11 @@ jobs:
- image: circleci/python:3.7
steps:
- checkout
- run:
name: Pull Submodules
command: |
git submodule init
git submodule update --remote
- run:
name: Install deps
command: sudo make dev-install
@ -21,6 +26,11 @@ jobs:
image: ubuntu-1604:201903-01 # https://circleci.com/docs/2.0/configuration-reference/#available-machine-images with Docker 18.09.3
steps:
- checkout
- run:
name: Pull Submodules
command: |
git submodule init
git submodule update --remote
- add_ssh_keys:
fingerprints:
- "d3:5f:9d:68:ea:12:9a:42:d3:d3:e1:db:b0:6a:fc:d2"

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "data/v2/sprites"]
path = data/v2/sprites
url = https://github.com/PokeAPI/sprites.git

View file

@ -40,7 +40,7 @@ Once you've signed up visit [PokéAPI on Slack](https://pokeapi.slack.com)
## Setup [![pyVersion37](https://img.shields.io/badge/python-3.7-blue.svg)](https://www.python.org/download/releases/3.7/)
- Download this source code into a working directory.
- Download this source code into a working directory, be sure to use the flag `--recurse-submodules` to clone also our submodules.
- Install the requirements using pip:
@ -151,7 +151,7 @@ To contribute to this repository:
- Download the forked project using git clone:
```sh
git clone git@github.com:<YOUR_USERNAME>/pokeapi.git
git clone --recurse-submodules git@github.com:<YOUR_USERNAME>/pokeapi.git
```
- Create a new branch with a descriptive name:

View file

@ -28,6 +28,9 @@ cleanexit() {
elif [ "$1" = "no-deploy" ]; then
notify_engine_pr "end_no_deploy"
exit 0
elif [ "$1" = "no-new-data" ]; then
notify_engine_pr "end_no_new_data"
exit 0
else
notify_engine_pr "end_failed"
exit 1
@ -141,9 +144,17 @@ pr_input_updater_end_failed() {
EOF
}
pr_input_updater_end_no_new_data() {
cat <<EOF
{
"body": "The updater script finished its job and the generated data didn't change. The deploy was thus skipped. For further information check [CircleCI's builds]($engine_circleci_status_url) and [logs](${CIRCLE_BUILD_URL})."
}
EOF
}
# If the job was started by a Pull Request, add a comment to notify the users
notify_engine_pr() {
if [[ $1 == "start" || $1 == "end_failed" || $1 == "end_success" || $1 == "end_no_deploy" ]]; then
if [[ $1 == "start" || $1 == "end_failed" || $1 == "end_success" || $1 == "end_no_deploy" || $1 == "end_no_new_data" ]]; then
engine_repo_pr_number=$(get_invokator_pr_number)
if [ "$engine_repo_pr_number" != "null" ]; then
curl -f "$auth_header" -X POST --data "$(pr_input_updater_$1)" "https://api.github.com/repos/$org/$engine_repo/issues/$engine_repo_pr_number/comments"
@ -164,8 +175,11 @@ run_updater() {
fi
# Run the updater
docker run --privileged -e COMMIT_EMAIL="$email" -e COMMIT_NAME="$username" -e BRANCH_NAME="$branch_name" -e REPO_POKEAPI="https://github.com/$org/$engine_repo.git" -e REPO_DATA="https://$MACHINE_USER_GITHUB_API_TOKEN@github.com/$org/$data_repo.git" pokeapi-updater
if [ $? -ne 0 ]; then
docker run --privileged -e REPO_POKEAPI_CHECKOUT_OBJECT="$CIRCLE_SHA1" -e COMMIT_EMAIL="$email" -e COMMIT_NAME="$username" -e BRANCH_NAME="$branch_name" -e REPO_POKEAPI="https://github.com/$org/$engine_repo.git" -e REPO_DATA="https://$MACHINE_USER_GITHUB_API_TOKEN@github.com/$org/$data_repo.git" pokeapi-updater
return_code=$?
if [ "$return_code" -eq 2 ]; then
cleanexit 'no-new-data' "Generated data is the same as old data, skipping deploy"
elif [ "$return_code" -ne 0 ]; then
cleanexit 'fail' "Failed to run the pokeapi-updater container"
fi

View file

@ -31,7 +31,7 @@ DB_VENDOR = connection.vendor
MEDIA_DIR = "/media/sprites/{0}"
IMAGE_DIR = os.getcwd() + "/data/v2/sprites/"
IMAGE_DIR = os.getcwd() + "/data/v2/sprites/sprites/"
RESOURCE_IMAGES = []
for root, dirs, files in os.walk(IMAGE_DIR):
@ -1347,27 +1347,45 @@ def _build_pokemons():
build_generic((Pokemon,), "pokemon.csv", csv_record_to_objects)
def csv_record_to_objects(info):
file_name = "%s.png" % info[0]
file_name_png = "%s.png" % info[0]
file_name_svg = "%s.svg" % info[0]
poke_sprites = "pokemon/{0}"
dream_world = "other/dream-world/{0}"
sprites = {
"front_default": file_path_or_none(poke_sprites.format(file_name)),
"front_default": file_path_or_none(poke_sprites.format(file_name_png)),
"front_female": file_path_or_none(
poke_sprites.format("female/" + file_name)
poke_sprites.format("female/" + file_name_png)
),
"front_shiny": file_path_or_none(
poke_sprites.format("shiny/" + file_name_png)
),
"front_shiny": file_path_or_none(poke_sprites.format("shiny/" + file_name)),
"front_shiny_female": file_path_or_none(
poke_sprites.format("shiny/female/" + file_name)
poke_sprites.format("shiny/female/" + file_name_png)
),
"back_default": file_path_or_none(
poke_sprites.format("back/" + file_name_png)
),
"back_default": file_path_or_none(poke_sprites.format("back/" + file_name)),
"back_female": file_path_or_none(
poke_sprites.format("back/female/" + file_name)
poke_sprites.format("back/female/" + file_name_png)
),
"back_shiny": file_path_or_none(
poke_sprites.format("back/shiny/" + file_name)
poke_sprites.format("back/shiny/" + file_name_png)
),
"back_shiny_female": file_path_or_none(
poke_sprites.format("back/shiny/female/" + file_name)
poke_sprites.format("back/shiny/female/" + file_name_png)
),
"other": {
"dream_world": {
"front_default": file_path_or_none(
poke_sprites.format(dream_world.format(file_name_svg))
),
"front_female": file_path_or_none(
poke_sprites.format(
dream_world.format("female/" + file_name_svg)
)
),
}
},
}
yield PokemonSprites(
id=int(info[0]),

1
data/v2/sprites Submodule

@ -0,0 +1 @@
Subproject commit 10a4d1cbb0e4d675d314eaa7afaff1d338c66e2e

Binary file not shown.

Before

Width:  |  Height:  |  Size: 254 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 309 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 376 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 271 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 252 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 248 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 544 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 505 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 597 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 688 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 650 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 524 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 574 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 577 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 555 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 595 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 454 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 569 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 629 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 576 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 505 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 582 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 544 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 535 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 548 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 716 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 768 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 605 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 565 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 590 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 615 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 654 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 598 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 684 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 479 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 587 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 491 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 395 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 603 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 527 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 520 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 639 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 658 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 541 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 563 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 563 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 723 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 651 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 561 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 549 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 686 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 614 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 640 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 523 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 673 B

Some files were not shown because too many files have changed in this diff Show more