quality-graph-cli 0.2.0__tar.gz → 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quality-graph-cli
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Provider-driven Quality Graph command-line application
5
5
  Project-URL: Homepage, https://quality-graph.xyz/
6
6
  Project-URL: Documentation, https://quality-graph.xyz/
7
7
  License-Expression: MIT
8
8
  Requires-Python: >=3.12
9
- Requires-Dist: quality-graph-core==0.2.0
9
+ Requires-Dist: quality-graph-core==0.2.1
10
10
  Description-Content-Type: text/markdown
11
11
 
12
12
  # qg
@@ -4,12 +4,12 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "quality-graph-cli"
7
- version = "0.2.0"
7
+ version = "0.2.1"
8
8
  description = "Provider-driven Quality Graph command-line application"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"
11
11
  license = "MIT"
12
- dependencies = ["quality-graph-core==0.2.0"]
12
+ dependencies = ["quality-graph-core==0.2.1"]
13
13
 
14
14
  [project.urls]
15
15
  Homepage = "https://quality-graph.xyz/"
@@ -9,7 +9,7 @@ from typing import TYPE_CHECKING, Literal, Self
9
9
 
10
10
  from qg_cli.providers import load_provider
11
11
  from quality_graph_core.graph import Graph
12
- from quality_graph_core.provider import ProviderInitializer
12
+ from quality_graph_core.provider import GeneratedFile, ProviderInitializer
13
13
 
14
14
  if TYPE_CHECKING:
15
15
  from quality_graph_core.provider import GeneratedProject, Provider
@@ -84,8 +84,8 @@ class Project:
84
84
 
85
85
  def _validate_output_paths(self, generated: GeneratedProject) -> None:
86
86
  root = self.root.resolve()
87
- for relative in (*[item.path for item in generated.files], PRETTIER_IGNORE_PATH):
88
- path = self.root / relative
87
+ for item in (*generated.files, GeneratedFile(PurePosixPath(PRETTIER_IGNORE_PATH), "")):
88
+ path = self.root / item.path
89
89
  if root not in path.resolve().parents:
90
90
  message = f"Generated file is outside the project root: {path}"
91
91
  raise ValueError(message)
@@ -93,17 +93,11 @@ class Project:
93
93
  message = f"Refusing to overwrite a generated-file symbolic link: {path}"
94
94
  raise ValueError(message)
95
95
  if (
96
- self.graph.provider.name == "gitlab"
97
- and relative.suffix in {".yml", ".yaml"}
96
+ item.overwrite_marker is not None
98
97
  and path.is_file()
99
- and not path.read_text().startswith(
100
- "# Generated by Quality Graph. DO NOT EDIT MANUALLY."
101
- )
98
+ and not path.read_text().startswith(item.overwrite_marker)
102
99
  ):
103
- message = (
104
- f"Refusing to overwrite unmanaged GitLab CI: {path}; "
105
- "use ci-path: .qg/gitlab-ci.yml and include it"
106
- )
100
+ message = f"Refusing to overwrite unmanaged generated file: {path}"
107
101
  raise FileExistsError(message)
108
102
 
109
103
  def _retired_paths(self, generated: GeneratedProject) -> tuple[Path, ...]: