• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

SwissDataScienceCenter / renku-python / 4182445342

pending completion
4182445342

Pull #3320

github-actions

GitHub
Merge f135d5076 into 0e5906373
Pull Request #3320: chore: fix coveralls comments

12864 of 23835 relevant lines covered (53.97%)

1.18 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/renku/command/command_builder/lock.py
1
# -*- coding: utf-8 -*-
2
#
3
# Copyright 2018-2022 - Swiss Data Science Center (SDSC)
4
# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
5
# Eidgenössische Technische Hochschule Zürich (ETHZ).
6
#
7
# Licensed under the Apache License, Version 2.0 (the "License");
8
# you may not use this file except in compliance with the License.
9
# You may obtain a copy of the License at
10
#
11
#     http://www.apache.org/licenses/LICENSE-2.0
12
#
13
# Unless required by applicable law or agreed to in writing, software
14
# distributed under the License is distributed on an "AS IS" BASIS,
15
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
# See the License for the specific language governing permissions and
17
# limitations under the License.
18
"""Command builder for locking."""
×
19

20
from renku.command.command_builder.command import Command, check_finalized
×
21
from renku.domain_model.project_context import project_context
×
22

23

24
class ProjectLock(Command):
×
25
    """Builder to get a project wide lock."""
26

27
    HOOK_ORDER = 5
×
28

29
    def __init__(self, builder: Command) -> None:
×
30
        """__init__ of ProjectLock."""
31
        self._builder = builder
×
32

33
    def _pre_hook(self, builder: Command, context: dict, *args, **kwargs) -> None:
×
34
        """Lock the project."""
35
        if "stack" not in context:
×
36
            raise ValueError(f"{self.__class__.__name__} builder needs a stack to be set.")
×
37

38
        context["stack"].enter_context(project_context.lock)
×
39

40
    @check_finalized
×
41
    def build(self) -> Command:
×
42
        """Build the command."""
43
        self._builder.add_pre_hook(self.HOOK_ORDER, self._pre_hook)
×
44

45
        return self._builder.build()
×
46

47

48
class DatasetLock(ProjectLock):
×
49
    """Builder to lock on a dataset."""
50

51
    pass
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc