Coverage for src/python/ensembl/vep/config/sections/catalogue/write.py: 100%

11 statements  

« prev     ^ index     » next       coverage.py v7.17.2, created at 2026-11-18 14:41 +0000

1# See the NOTICE file distributed with this work for additional information 

2# regarding copyright ownership. 

3# 

4# Licensed under the Apache License, Version 2.0 (the "License"); 

5# you may not use this file except in compliance with the License. 

6# You may obtain a copy of the License at 

7# http://www.apache.org/licenses/LICENSE-2.0 

8# 

9# Unless required by applicable law or agreed to in writing, software 

10# distributed under the License is distributed on an "AS IS" BASIS, 

11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 

12# See the License for the specific language governing permissions and 

13# limitations under the License. 

14"""Permission to change the catalogue on disk.""" 

15 

16from __future__ import annotations 

17 

18from typing import ClassVar 

19 

20from attrs import define, field 

21 

22from ensembl.vep.config.option_spec import option 

23from ensembl.vep.config.sections.base import ConfigSection 

24 

25__all__ = ["CatalogueWriteConfig"] 

26 

27 

28@define(frozen=True, kw_only=True, auto_attribs=True) 

29class CatalogueWriteConfig(ConfigSection): 

30 """Read only by the verbs that change the catalogue, so the listing verbs never offer it. 

31 

32 Attributes: 

33 catalogue_overwrite (bool): Permit writing the packaged catalogue in place. Without this, 

34 or an explicit path, a write is refused: an installed ``vep`` must not silently rewrite 

35 its own wheel. 

36 dry_run (bool): Report the change and its validation without writing. 

37 """ 

38 

39 section_name: ClassVar[str] = "catalogue_write" 

40 

41 catalogue_overwrite: bool = field(default=False, metadata=option("write the packaged catalogue in place")) 

42 dry_run: bool = field(default=False, metadata=option("report the change without writing it"))