Skip to content

Commit

Permalink
issue-64: update python
Browse files Browse the repository at this point in the history
  • Loading branch information
lowitea committed Aug 12, 2022
1 parent c062093 commit 005a477
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 24 deletions.
26 changes: 25 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ celerybeat.pid

# Environments
.env
.gen.env
.venv
env/
venv/
Expand Down Expand Up @@ -118,4 +119,27 @@ dmypy.json
.pytype/

# Cython debug symbols
cython_debug/
cython_debug/

# Git
.git
.gitignore

# GitHub
.github

# Other
docs
.coveragerc
.darglint
.editorconfig
.flake8
.isort.cfg
CHANGELOG.md
**/tests
conftest.py
CONTRIBUTING.md
Makefile
pytest.ini
README.md
.dockerignore
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [push, pull_request]
jobs:
autotests:
runs-on: ubuntu-latest
container: python:3.8
container: python:3.10

services:
postgres:
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:

lint-check:
runs-on: ubuntu-latest
container: python:3.8
container: python:3.10

steps:
- uses: actions/checkout@v2
Expand Down
12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ lint: ## Start project's lint on docker
-f deploy/docker-compose.yml \
${OVERRIDE} \
--project-directory . \
run --rm kesha \
flake8 --count
run \
--rm \
--volume "$$(pwd):/app/src:z" \
kesha flake8 --count

build: ## Build docker image
build: envfile ## Build docker image
docker-compose \
-f deploy/docker-compose.yml \
${OVERRIDE} \
Expand All @@ -63,7 +65,7 @@ envfile: ## Generate env file with variables with prefix KESHA_
$(shell env | egrep '^KESHA_' > .gen.env && echo '.gen.env has been generated' || touch .gen.env)
$(shell test -f .env && cat .env > .gen.env)

runserver: envfile ## Local startup the app on docker with required services
runserver: envfile ## Local startup the app on docker with required services
docker-compose \
-f deploy/docker-compose.yml \
-f deploy/docker-compose.db.yml \
Expand All @@ -72,7 +74,7 @@ runserver: envfile ## Local startup the app on docker with required services
--project-directory . \
up

runserver-uvicorn: envfile ## Local startup the app on docker with uvicorn
runserver-uvicorn: envfile ## Local startup the app on docker with uvicorn
docker-compose \
-f deploy/docker-compose.yml \
-f deploy/docker-compose.db.yml \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ _Web-service for testing http requests and webhooks._

Project info:
[![Docker Image Version (tag latest semver)](https://img.shields.io/docker/v/nextuptechnologies/kesha/latest)](https://registry.hub.docker.com/r/nextuptechnologies/kesha)
![Python Version](https://img.shields.io/static/v1?label=python&message=3.8&color=blue)
![Python Version](https://img.shields.io/static/v1?label=python&message=3.10&color=blue)
![License](https://img.shields.io/static/v1?label=license&message=Apache+2&color=blue)

Build:
Expand Down
2 changes: 1 addition & 1 deletion deploy/app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8
FROM python:3.10

# Disables the buffer for instant output of messages to stdout from processes.
ENV PYTHONUNBUFFERED=1
Expand Down
7 changes: 6 additions & 1 deletion deploy/docker-compose.autotests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ services:
kesha-tests:
image: nextuptechnologies/kesha:latest
volumes:
- ".:/app/src"
- ".:/app/src:z"
environment:
- KESHA_DB_HOST=kesha-database
command: bash /app/start-autotests.sh
depends_on:
- "kesha-database"
networks:
app:
celery:
2 changes: 1 addition & 1 deletion deploy/docker-compose.db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ services:
ports:
- "5432"
volumes:
- "${KESHA_DB_VOLUME:-db-volume}:/var/lib/postgresql/data"
- "${KESHA_DB_VOLUME:-db-volume}:/var/lib/postgresql/data:z"
networks:
app:
celery:
Expand Down
2 changes: 1 addition & 1 deletion deploy/docker-compose.develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ services:
environment:
- DEBUG=1
volumes:
- ".:/app/src"
- ".:/app/src:z"
2 changes: 1 addition & 1 deletion docs/src/usage/request-scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
![](../images/request_script.jpg)

## About scripts
Request scripts support a secure subset of Python version 3.8.
Request scripts support a secure subset of Python version 3.10.
Additionally, [json](https://docs.python.org/3/library/json.html) and [requests](https://requests.readthedocs.io/en/master/) modules are available to the script.
As well as a special variable that stores the request body `request_body`.

Expand Down
2 changes: 1 addition & 1 deletion http_stubs/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class AbstractHTTPStub(models.Model):
)
request_script = models.TextField(
verbose_name='Request script',
help_text='Language: python 3.8. The script will run on each request.',
help_text='Language: python 3.10. The script will run on each request',
blank=True,
)
enable_logging = models.BooleanField(
Expand Down
18 changes: 9 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ readme = "README.md"
keywords = ["testing", "webhook", "postbin", "http", "requests"]

classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Django",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.8",
"Topic :: Software Development :: Testing"
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Django",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.10",
"Topic :: Software Development :: Testing"
]

[tool.mypy]
Expand All @@ -26,15 +26,15 @@ plugins = ["mypy_django_plugin.main"]
django_settings_module = "kesha.settings"

[tool.poetry.dependencies]
python = "~3.8"
python = "~3.10"
django = "~3.1"
django-simpleui = "~2022.7"
uvicorn = "~0.18.2"
psycopg2-binary = "~2.9.3"
django-environ = "^0.9.0"
django-extensions = "^3.1.5"
django-debug-toolbar = "^3.2.4"
celery = {extras = ["redis"], version = "^5.2.7"}
celery = { extras = ["redis"], version = "^5.2.7" }
RestrictedPython = "~5.2"
requests = "^2.28.1"

Expand Down

0 comments on commit 005a477

Please sign in to comment.