Skip to content

Commit

Permalink
Merge pull request #225 from KotlinIsland/basedmypy
Browse files Browse the repository at this point in the history
(🎁) add basedmypy 2.1.0
  • Loading branch information
ymyzk authored Sep 30, 2023
2 parents 1338edb + ea7c60b commit 593def1
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 3 deletions.
3 changes: 3 additions & 0 deletions app/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ default-python-version = "3.11"
python-versions = ["3.9", "3.10", "3.11"]
mypy-versions = [
["mypy latest", "latest"],
["basedmypy 2.1.0", "basedmypy-2.1.0"],
]

# Example to use Cloud Functions
Expand All @@ -15,6 +16,8 @@ cloud-functions-identity-token = "TOKEN"

[cloud-functions-names]
latest = "mypy-latest"
"basedmypy 2.1.0" = "basedmypy-2.1.0"

[docker-images]
latest = "ymyzk/mypy-playground-sandbox:latest"
"basedmypy 2.1.0" = "ymyzk/mypy-playground-sandbox:basedmypy-2.1.0"
2 changes: 1 addition & 1 deletion app/mypy_playground/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
define(
"mypy_versions",
type=ListPairOption,
default=[("mypy latest", "latest")],
default=[("mypy latest", "latest"), ("basedmypy 2.1.0", "basedmypy-2.1.0")],
help="List of mypy versions used by a sandbox",
)
define(
Expand Down
1 change: 1 addition & 0 deletions sandbox/cloud_functions/basedmypy-2.1.0/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
../main.py
1 change: 1 addition & 0 deletions sandbox/cloud_functions/basedmypy-2.1.0/requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
basedmypy==2.1.0
14 changes: 14 additions & 0 deletions sandbox/cloud_functions/basedmypy-2.1.0/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#
# This file is autogenerated by pip-compile with python 3.10
# To update, run:
#
# pip-compile
#
basedmypy==2.1.0
# via -r requirements.in
basedtyping==0.0.3
# via basedmypy
mypy-extensions==1.0.0
# via basedmypy
typing-extensions==4.7.1
# via basedmypy
9 changes: 7 additions & 2 deletions sandbox/cloud_functions/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@ cd "$(dirname "$0")"

deploy() {
VERSION="$1"
# We cannot use "." in a function name.
FUNCTION_NAME="${FUNCTION_NAME_BASE}${VERSION//./-}"
if [[ $VERSION == basedmypy* ]]; then
# We cannot use "." in a function name.
FUNCTION_NAME="${VERSION//./-}"
else
# We cannot use "." in a function name.
FUNCTION_NAME="${FUNCTION_NAME_BASE}${VERSION//./-}"
fi
echo "Deploying ${VERSION} as ${FUNCTION_NAME}..."
gcloud functions deploy "${FUNCTION_NAME}" \
--trigger-http \
Expand Down
11 changes: 11 additions & 0 deletions sandbox/docker/basedmypy-2.1.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM python:3.11-slim

WORKDIR /tmp
COPY ./requirements.txt /tmp/

RUN pip install -r requirements.txt \
&& rm -rf /tmp/requirements.txt \
&& rm -rf /root/.cache

USER nobody
CMD ["mypy"]
1 change: 1 addition & 0 deletions sandbox/docker/basedmypy-2.1.0/requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
basedmypy==2.1.0
14 changes: 14 additions & 0 deletions sandbox/docker/basedmypy-2.1.0/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#
# This file is autogenerated by pip-compile with python 3.10
# To update, run:
#
# pip-compile
#
basedmypy==2.1.0
# via -r requirements.in
basedtyping==0.0.3
# via basedmypy
mypy-extensions==1.0.0
# via basedmypy
typing-extensions==4.7.1
# via basedmypy

0 comments on commit 593def1

Please sign in to comment.