Compare commits
5
Commits
0.10.2
...
2e64224840
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2e64224840 | ||
|
|
f35d3f8cb8 | ||
|
|
b0187506fd | ||
|
|
beafed8faf | ||
|
|
52315cc8bd |
@@ -0,0 +1,32 @@
|
||||
name: "Setup"
|
||||
description: "Setup project"
|
||||
inputs:
|
||||
python-version:
|
||||
default: "3.14"
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- id: setup-python
|
||||
uses: actions/setup-python@v7
|
||||
with:
|
||||
python-version: ${{ inputs.python-version }}
|
||||
cache: "pip"
|
||||
|
||||
- run: |
|
||||
pip install project-manager \
|
||||
--index-url https://git.shmyga.ru/api/packages/InfernalGames/pypi/simple/ \
|
||||
--extra-index-url https://pypi.org/simple
|
||||
|
||||
- run: pm setup:config -vv
|
||||
|
||||
# setup python venv
|
||||
- run: pip install poetry
|
||||
|
||||
- id: cache-venv
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: .venv
|
||||
key: venv-${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
|
||||
|
||||
- if: steps.cache-venv.outputs.cache-hit != 'true'
|
||||
run: pm setup:python -vv
|
||||
@@ -1,42 +0,0 @@
|
||||
name: build
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ["*"]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# repo
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v7
|
||||
# python
|
||||
- name: Set up python
|
||||
id: setup-python
|
||||
uses: actions/setup-python@v7
|
||||
with:
|
||||
python-version: "3.14"
|
||||
cache: "pip"
|
||||
# project-manager
|
||||
- name: Install Project Manager
|
||||
run: |
|
||||
pip install project-manager \
|
||||
--index-url https://git.shmyga.ru/api/packages/InfernalGames/pypi/simple/ \
|
||||
--extra-index-url https://pypi.org/simple
|
||||
# setup
|
||||
- name: Setup config
|
||||
run: pm setup:config -vv
|
||||
# build
|
||||
- name: Build docker
|
||||
run: pm build:docker -vv
|
||||
# login docker
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
registry: git.shmyga.ru
|
||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
# pubish
|
||||
- name: Publish docker
|
||||
run: pm publish:docker -vv
|
||||
@@ -0,0 +1,21 @@
|
||||
name: release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ["*"]
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: ./.gitea/actions/setup
|
||||
- run: pm lint -vv
|
||||
- run: pm test -vv
|
||||
- run: pm build:docker -vv
|
||||
- uses: docker/login-action@v4
|
||||
with:
|
||||
registry: git.shmyga.ru
|
||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- run: pm publish:docker -vv
|
||||
@@ -6,45 +6,7 @@ jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# repo
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v7
|
||||
# python
|
||||
- name: Set up python
|
||||
id: setup-python
|
||||
uses: actions/setup-python@v7
|
||||
with:
|
||||
python-version: "3.14"
|
||||
# poetry
|
||||
- name: Load cached Poetry installation
|
||||
id: cached-poetry
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ~/.local
|
||||
key: poetry-1 # increment to reset cache
|
||||
- name: Install Poetry
|
||||
if: steps.cached-poetry.outputs.cache-hit != 'true'
|
||||
uses: snok/install-poetry@v1
|
||||
with:
|
||||
virtualenvs-create: true
|
||||
virtualenvs-in-project: true
|
||||
virtualenvs-path: .venv
|
||||
installer-parallel: true
|
||||
# venv
|
||||
- name: Load cached venv
|
||||
id: cached-poetry-dependencies
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: .venv
|
||||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
|
||||
- name: Install dependencies
|
||||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
|
||||
run: ~/.local/bin/poetry install --no-interaction --no-root
|
||||
- name: Install project
|
||||
run: ~/.local/bin/poetry install --no-interaction
|
||||
# test
|
||||
- name: Run tests
|
||||
run: |
|
||||
source .venv/bin/activate
|
||||
coverage run -m pytest tests/
|
||||
coverage report
|
||||
- uses: actions/checkout@v7
|
||||
- uses: ./.gitea/actions/setup
|
||||
- run: pm lint -vv
|
||||
- run: pm test -vv
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ FROM python:3.14-slim
|
||||
ENV PLAYWRIGHT_BROWSERS_PATH="/opt/playwright-browsers"
|
||||
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
||||
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
||||
pip install playwright && \
|
||||
pip install playwright==1.62 && \
|
||||
playwright install --with-deps chromium
|
||||
|
||||
ENV PATH="/app/.venv/bin:$PATH"
|
||||
|
||||
@@ -3,6 +3,7 @@ from typing import Literal
|
||||
|
||||
from fastapi import APIRouter
|
||||
from fastapi.responses import HTMLResponse, RedirectResponse
|
||||
from starlette.datastructures import URL
|
||||
|
||||
from gallery.easel.core import AppRequest
|
||||
from gallery.easel.depends.api import api_resolver
|
||||
@@ -70,8 +71,9 @@ async def get_weather_days(request: AppRequest, weather_api: WeatherApiDepends,
|
||||
|
||||
# TODO: tag mode route deprecated, used in tizen app
|
||||
@router.get("/{provider}/{location}/tag/days-{days}", response_class=RedirectResponse)
|
||||
async def get_tag_days(days: int):
|
||||
return RedirectResponse(f"../days/{days}")
|
||||
async def get_tag_days(request: AppRequest, days: int):
|
||||
url = URL(path=f"../days/{days}", query=request.url.query)
|
||||
return RedirectResponse(url)
|
||||
|
||||
|
||||
# TODO: tag mode route deprecated, used in tizen app
|
||||
|
||||
+9
-9
@@ -1,16 +1,16 @@
|
||||
[project]
|
||||
name = "gallery"
|
||||
description = ""
|
||||
version = "0.10.2"
|
||||
version = "0.10.4"
|
||||
readme = "README.md"
|
||||
authors = [{ name = "shmyga", email = "shmyga.z@gmail.com" }]
|
||||
requires-python = '>=3.14,<4.0'
|
||||
requires-python = ">=3.14,<4.0"
|
||||
dependencies = [
|
||||
'aiohttp (>=3.14,<4.0)',
|
||||
'beautifulsoup4 (>=4.15,<5.0)',
|
||||
'dateparser (>=1.4,<2.0)',
|
||||
'pydantic (>=2.13,<3.0)',
|
||||
'aiocache[redis] (>=0.12,<0.13)',
|
||||
"aiohttp (>=3.14,<4.0)",
|
||||
"beautifulsoup4 (>=4.15,<5.0)",
|
||||
"dateparser (>=1.4,<2.0)",
|
||||
"pydantic (>=2.13,<3.0)",
|
||||
"aiocache[redis] (>=0.12,<0.13)",
|
||||
"playwright (>=1.62.0,<2.0.0)",
|
||||
]
|
||||
|
||||
@@ -30,10 +30,10 @@ gallery = "gallery.main:run"
|
||||
|
||||
[tool.poetry]
|
||||
packages = [{ include = "gallery" }]
|
||||
requires-poetry = '>=2.0.0,<3.0.0'
|
||||
requires-poetry = ">=2.0.0,<3.0.0"
|
||||
|
||||
[build-system]
|
||||
requires = ['poetry-core (>=2.0.0,<3.0.0)']
|
||||
requires = ["poetry-core (>=2.0.0,<3.0.0)"]
|
||||
build-backend = "poetry.core.masonry.api"
|
||||
|
||||
[tool.black]
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "gallery",
|
||||
"version": "0.10.2",
|
||||
"version": "0.10.4",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "gallery",
|
||||
"version": "0.10.2",
|
||||
"version": "0.10.4",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@popperjs/core": "^2.11.8",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gallery",
|
||||
"version": "0.10.2",
|
||||
"version": "0.10.4",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "webpack --mode production",
|
||||
|
||||
Reference in New Issue
Block a user