Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.3 #530

Merged
merged 7 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.2.11
current_version = 0.3.0
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)
serialize =
{major}.{minor}.{patch}
Expand Down
2 changes: 1 addition & 1 deletion docker/syftbox.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM cgr.dev/chainguard/wolfi-base

ARG PYTHON_VERSION="3.12"
ARG UV_VERSION="0.4.20-r0"
ARG SYFT_VERSION="0.2.11"
ARG SYFT_VERSION="0.3.0"

RUN apk update && apk upgrade && \
apk add --no-cache python-$PYTHON_VERSION uv=$UV_VERSION
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "syftbox"
version = "0.2.11"
version = "0.3.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.9"
Expand Down
2 changes: 1 addition & 1 deletion syftbox/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# |____/ \__, |_| \__|____/ \___/_/\_\
# |___/

__version__ = "0.2.11"
__version__ = "0.3.0"
32 changes: 16 additions & 16 deletions syftbox/server/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,24 @@ async def dispatch(self, request: Request, call_next: Callable) -> Response:

class VersionCheckMiddleware(BaseHTTPMiddleware):
async def dispatch(self, request: Request, call_next: Callable) -> Response:
logger.info(request.headers)
client_version = request.headers.get(HEADER_SYFTBOX_VERSION)
if not client_version:
return Response(
status_code=status.HTTP_400_BAD_REQUEST,
content="Client version not provided. Please include the 'Version' header.",
)
user_agent = request.headers.get("User-Agent")
if user_agent.startswith("SyftBox"):
client_version = request.headers.get(HEADER_SYFTBOX_VERSION)

version_range = get_range_for_version(client_version)
lower_bound_version = version_range[0]
# upper_bound_version = version_range[1]
print(client_version, lower_bound_version)
if not client_version:
return Response(
status_code=status.HTTP_400_BAD_REQUEST,
content="Client version not provided. Please include the 'Version' header.",
)

if version.parse(client_version) < version.parse(lower_bound_version):
return Response(
status_code=status.HTTP_426_UPGRADE_REQUIRED,
content=f"Client version is too old. Minimum version required is {lower_bound_version}",
)
version_range = get_range_for_version(client_version)
lower_bound_version = version_range[0]

if version.parse(client_version) < version.parse(lower_bound_version):
return Response(
status_code=status.HTTP_426_UPGRADE_REQUIRED,
content=f"Client version is too old. Minimum version required is {lower_bound_version}",
)

response = await call_next(request)
response.headers[HEADER_SYFTBOX_VERSION] = __version__
Expand Down
3 changes: 2 additions & 1 deletion syftbox/server/migrations.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import yaml
from loguru import logger
from packaging import version

from syftbox import __version__
from syftbox.lib.constants import PERM_FILE
Expand All @@ -20,7 +21,7 @@ def run_migrations(settings: ServerSettings) -> None:

def init_db(settings: ServerSettings) -> None:
# remove this after the upcoming release
if __version__ in ["0.2.11", "0.2.12"]:
if version.parse(__version__) > version.parse("0.2.10"):
# Delete existing DB to avoid conflicts
db_path = settings.file_db_path.absolute()
if db_path.exists():
Expand Down
25 changes: 13 additions & 12 deletions syftbox/server2client_version.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,17 @@
"0.1.22": ["0.1.0", "0.2.0"],
"0.1.23": ["0.1.0", "0.2.0"],
"0.1.24": ["0.1.0", "0.2.0"],
"0.2.0": ["0.2.0", ""],
"0.2.1": ["0.2.0", ""],
"0.2.2": ["0.2.0", ""],
"0.2.3": ["0.2.0", ""],
"0.2.4": ["0.2.0", ""],
"0.2.5": ["0.2.0", ""],
"0.2.6": ["0.2.0", ""],
"0.2.7": ["0.2.0", ""],
"0.2.8": ["0.2.0", ""],
"0.2.9": ["0.2.0", ""],
"0.2.10": ["0.2.0", ""],
"0.2.11": ["0.2.0", ""]
"0.2.0": ["0.2.0", "0.3.0"],
"0.2.1": ["0.2.0", "0.3.0"],
"0.2.2": ["0.2.0", "0.3.0"],
"0.2.3": ["0.2.0", "0.3.0"],
"0.2.4": ["0.2.0", "0.3.0"],
"0.2.5": ["0.2.0", "0.3.0"],
"0.2.6": ["0.2.0", "0.3.0"],
"0.2.7": ["0.2.0", "0.3.0"],
"0.2.8": ["0.2.0", "0.3.0"],
"0.2.9": ["0.2.0", "0.3.0"],
"0.2.10": ["0.2.0", "0.3.0"],
"0.2.11": ["0.2.0", "0.3.0"],
"0.3.0": ["0.3.0", ""]
}
8 changes: 4 additions & 4 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.