Skip to content

Commit

Permalink
feat: prepare release 0.0.2
Browse files Browse the repository at this point in the history
- add dockerfiles for others
- add script for auto sync version
- support host and port for starting mock server
  • Loading branch information
magiskboy committed Jul 2, 2023
1 parent 839dcd3 commit b567ed8
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 6 deletions.
5 changes: 5 additions & 0 deletions dockerfiles/python-3.10.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM python:3.10-alpine

RUN pip install "py-luke==0.0.2"

ENTRYPOINT ["luke"]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM python:3.11-alpine

RUN pip install py-luke
RUN pip install "py-luke==0.0.2"

ENTRYPOINT ["luke"]
5 changes: 5 additions & 0 deletions dockerfiles/python-3.7.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM python:3.7-alpine

RUN pip install "py-luke==0.0.2"

ENTRYPOINT ["luke"]
5 changes: 5 additions & 0 deletions dockerfiles/python-3.8.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM python:3.8-alpine

RUN pip install "py-luke==0.0.2"

ENTRYPOINT ["luke"]
5 changes: 5 additions & 0 deletions dockerfiles/python-3.9.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM python:3.9-alpine

RUN pip install "py-luke==0.0.2"

ENTRYPOINT ["luke"]
8 changes: 4 additions & 4 deletions luke/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .generators import ObjectFieldGenerator # type: ignore # noqa
from .server import ServerGenerator # type: ignore # noqa
from .openapi import OpenAPISpec # type: ignore # noqa
from .generators import ObjectFieldGenerator # type: ignore # noqa
from .server import ServerGenerator # type: ignore # noqa
from .openapi import OpenAPISpec # type: ignore # noqa

__version__ = '0.0.1'
__version__ = "0.0.2"
2 changes: 1 addition & 1 deletion luke/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def start_server(
spec.load(file)
generator = ServerGenerator()
server = generator.make_server(spec)
uvicorn.run(server, log_level=log_level)
uvicorn.run(server, log_level=log_level, host=host, port=port)


@cli.command("validate")
Expand Down
13 changes: 13 additions & 0 deletions scripts/sync-version
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

NEW_VERSION=$1

for file in $(ls dockerfiles); do
sed -i "" "s/\"\(py-luke\)==\(.*\)\"/\"\1==$NEW_VERSION\"/" "dockerfiles/$file"
done

echo "Update version $NEW_VERSION for dockerfiles"


sed -i "" "s/\(__version__\) = \(.*\)/\1 = \"$NEW_VERSION\"/" "luke/__init__.py"
echo "Updated version $NEW_VERSION for luke/__init__.py"

0 comments on commit b567ed8

Please sign in to comment.