Skip to content

Commit

Permalink
bump minimum version to break forward compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Panaetius committed Jul 21, 2022
1 parent d4f9a04 commit 06de6b6
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ jobs:
POETRY_VIRTUALENVS_CREATE: false
LANG: en_US.UTF-8
LC_ALL: en_US.UTF-8
RENKU_SKIP_MIN_VERSION_CHECK: '1'
run: pytest -v -m "not integration and not publish and not serial" -n auto tests/api
- name: Coveralls
env:
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,9 @@ markers = [
"service: mark a test as service test.",
"shelled: mark a test as a shelled test.",
]
env = [
"RENKU_SKIP_MIN_VERSION_CHECK = '1'"
]

[tool.mypy]
python_version = "3.8"
Expand Down
5 changes: 5 additions & 0 deletions renku/command/command_builder/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@


import json
import os
from typing import TYPE_CHECKING, Optional, cast

from packaging.version import Version
Expand Down Expand Up @@ -77,6 +78,10 @@ def _injection_pre_hook(self, builder: Command, context: dict, *args, **kwargs)
context["constructor_bindings"][IDatasetGateway] = lambda: DatasetGateway()
context["constructor_bindings"][IProjectGateway] = lambda: ProjectGateway()

if int(os.environ.get("RENKU_SKIP_MIN_VERSION_CHECK", "0")) == 1:
# NOTE: Used for unit tests
return

try:
self.project = cast("Project", self.dispatcher.current_database["project"])
minimum_renku_version = Version(self.project.minimum_renku_version)
Expand Down
4 changes: 2 additions & 2 deletions renku/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
except ImportError:
from importlib_metadata import distribution # type: ignore

__version__ = "1.5.0"
__version__ = "1.6.0"
__template_version__ = "0.3.1"
__minimum_project_version__ = "1.2.0"
__minimum_project_version__ = "1.6.0"


def is_release():
Expand Down
3 changes: 2 additions & 1 deletion tests/core/commands/test_renku.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ def test_version():
assert __version__


def test_minimum_version(mocker, tmpdir):
def test_minimum_version(mocker, tmpdir, monkeypatch):
"""Test minimum version required."""
monkeypatch.setenv("RENKU_SKIP_MIN_VERSION_CHECK", "0")

def _mock_database_project(project):
def mocked_getter(self, key):
Expand Down
4 changes: 3 additions & 1 deletion tests/service/views/test_cache_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1085,8 +1085,10 @@ def test_check_migrations_remote_anonymous(svc_client, it_remote_public_repo_url

@pytest.mark.service
@pytest.mark.integration
def test_check_migrations_local_minimum_version(svc_client_setup, mocker):
def test_check_migrations_local_minimum_version(svc_client_setup, mocker, monkeypatch):
"""Check if migrations are required for a local project."""
monkeypatch.setenv("RENKU_SKIP_MIN_VERSION_CHECK", "0")

svc_client, headers, project_id, _, _ = svc_client_setup

def _mock_database_project(project):
Expand Down

0 comments on commit 06de6b6

Please sign in to comment.