forked from username/flaskpaste
bump version to 1.1.0, centralize VERSION constant
This commit is contained in:
@@ -7,7 +7,7 @@ import uuid
|
|||||||
|
|
||||||
from flask import Flask, Response, g, request
|
from flask import Flask, Response, g, request
|
||||||
|
|
||||||
from app.config import config
|
from app.config import VERSION, config
|
||||||
|
|
||||||
|
|
||||||
def setup_logging(app: Flask) -> None:
|
def setup_logging(app: Flask) -> None:
|
||||||
@@ -176,7 +176,7 @@ def setup_metrics(app: Flask) -> None:
|
|||||||
metrics = PrometheusMetrics(app)
|
metrics = PrometheusMetrics(app)
|
||||||
|
|
||||||
# Add app info
|
# Add app info
|
||||||
metrics.info("flaskpaste_info", "FlaskPaste application info", version="1.0.0")
|
metrics.info("flaskpaste_info", "FlaskPaste application info", version=VERSION)
|
||||||
|
|
||||||
app.extensions["metrics"] = metrics
|
app.extensions["metrics"] = metrics
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import time
|
|||||||
from flask import Response, current_app, request
|
from flask import Response, current_app, request
|
||||||
|
|
||||||
from app.api import bp
|
from app.api import bp
|
||||||
|
from app.config import VERSION
|
||||||
from app.database import check_content_hash, get_db
|
from app.database import check_content_hash, get_db
|
||||||
|
|
||||||
# Valid paste ID pattern (hexadecimal only)
|
# Valid paste ID pattern (hexadecimal only)
|
||||||
@@ -275,7 +276,7 @@ def index():
|
|||||||
return _json_response(
|
return _json_response(
|
||||||
{
|
{
|
||||||
"name": "FlaskPaste",
|
"name": "FlaskPaste",
|
||||||
"version": "1.0.0",
|
"version": VERSION,
|
||||||
"endpoints": {
|
"endpoints": {
|
||||||
"GET /": "API information",
|
"GET /": "API information",
|
||||||
"GET /health": "Health check",
|
"GET /health": "Health check",
|
||||||
|
|||||||
@@ -3,6 +3,9 @@
|
|||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
# Application version
|
||||||
|
VERSION = "1.1.0"
|
||||||
|
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
"""Base configuration."""
|
"""Base configuration."""
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ Host: localhost:5000
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"name": "FlaskPaste",
|
"name": "FlaskPaste",
|
||||||
"version": "1.0.0",
|
"version": "1.1.0",
|
||||||
"endpoints": {
|
"endpoints": {
|
||||||
"GET /": "API information",
|
"GET /": "API information",
|
||||||
"GET /health": "Health check",
|
"GET /health": "Health check",
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
from app.config import VERSION
|
||||||
|
|
||||||
|
|
||||||
class TestIndex:
|
class TestIndex:
|
||||||
"""Tests for GET / endpoint."""
|
"""Tests for GET / endpoint."""
|
||||||
@@ -12,7 +14,7 @@ class TestIndex:
|
|||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
data = json.loads(response.data)
|
data = json.loads(response.data)
|
||||||
assert data["name"] == "FlaskPaste"
|
assert data["name"] == "FlaskPaste"
|
||||||
assert data["version"] == "1.0.0"
|
assert data["version"] == VERSION
|
||||||
assert "endpoints" in data
|
assert "endpoints" in data
|
||||||
assert "usage" in data
|
assert "usage" in data
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user