| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5c8b7c1 commit 42639f3
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -255,11 +255,6 @@ a branch or tag:: | |||
| 255 | 255 | ||
| 256 | 256 | project.artifacts.download(ref_name='main', job='build') | |
| 257 | 257 | ||
| 258 | - .. attention:: | ||
| 259 | - | ||
| 260 | - An older method ``project.artifacts()`` is deprecated and will be | ||
| 261 | - removed in a future version. | ||
| 262 | - | ||
| 263 | 258 | .. warning:: | |
| 264 | 259 | ||
| 265 | 260 | Artifacts are entirely stored in memory in this example. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,30 +25,6 @@ class ProjectArtifactManager(RESTManager): | |||
| 25 | 25 | _path = "/projects/{project_id}/jobs/artifacts" | |
| 26 | 26 | _from_parent_attrs = {"project_id": "id"} | |
| 27 | 27 | ||
| 28 | - @cli.register_custom_action( | ||
| 29 | - "Project", ("ref_name", "job"), ("job_token",), custom_action="artifacts" | ||
| 30 | - ) | ||
| 31 | - def __call__( | ||
| 32 | - self, | ||
| 33 | - *args: Any, | ||
| 34 | - **kwargs: Any, | ||
| 35 | - ) -> Optional[bytes]: | ||
| 36 | - utils.warn( | ||
| 37 | - message=( | ||
| 38 | - "The project.artifacts() method is deprecated and will be removed in a " | ||
| 39 | - "future version. Use project.artifacts.download() instead.\n" | ||
| 40 | - ), | ||
| 41 | - category=DeprecationWarning, | ||
| 42 | - ) | ||
| 43 | - data = self.download( | ||
| 44 | - *args, | ||
| 45 | - **kwargs, | ||
| 46 | - ) | ||
| 47 | - if TYPE_CHECKING: | ||
| 48 | - assert data is not None | ||
| 49 | - assert isinstance(data, bytes) | ||
| 50 | - return data | ||
| 51 | - | ||
| 52 | 28 | @exc.on_http_error(exc.GitlabDeleteError) | |
| 53 | 29 | def delete(self, **kwargs: Any) -> None: | |
| 54 | 30 | """Delete the project's artifacts on the server. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -77,29 +77,6 @@ def test_cli_project_artifact_download(gitlab_config, job_with_artifacts): | |||
| 77 | 77 | assert is_zipfile(artifacts_zip) | |
| 78 | 78 | ||
| 79 | 79 | ||
| 80 | - def test_cli_project_artifacts_warns_deprecated(gitlab_config, job_with_artifacts): | ||
| 81 | - cmd = [ | ||
| 82 | - "gitlab", | ||
| 83 | - "--config-file", | ||
| 84 | - gitlab_config, | ||
| 85 | - "project", | ||
| 86 | - "artifacts", | ||
| 87 | - "--id", | ||
| 88 | - str(job_with_artifacts.pipeline["project_id"]), | ||
| 89 | - "--ref-name", | ||
| 90 | - job_with_artifacts.ref, | ||
| 91 | - "--job", | ||
| 92 | - job_with_artifacts.name, | ||
| 93 | - ] | ||
| 94 | - | ||
| 95 | - artifacts = subprocess.run(cmd, capture_output=True, check=True) | ||
| 96 | - assert isinstance(artifacts.stdout, bytes) | ||
| 97 | - assert b"DeprecationWarning" in artifacts.stderr | ||
| 98 | - | ||
| 99 | - artifacts_zip = BytesIO(artifacts.stdout) | ||
| 100 | - assert is_zipfile(artifacts_zip) | ||
| 101 | - | ||
| 102 | - | ||
| 103 | 80 | def test_cli_project_artifact_raw(gitlab_config, job_with_artifacts): | |
| 104 | 81 | cmd = [ | |
| 105 | 82 | "gitlab", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -46,12 +46,3 @@ def test_project_artifacts_download_by_ref_name( | |||
| 46 | 46 | project = gl.projects.get(1, lazy=True) | |
| 47 | 47 | artifacts = project.artifacts.download(ref_name=ref_name, job=job) | |
| 48 | 48 | assert artifacts == binary_content | |
| 49 | - | ||
| 50 | - | ||
| 51 | - def test_project_artifacts_by_ref_name_warns( | ||
| 52 | - gl, binary_content, resp_artifacts_by_ref_name | ||
| 53 | - ): | ||
| 54 | - project = gl.projects.get(1, lazy=True) | ||
| 55 | - with pytest.warns(DeprecationWarning): | ||
| 56 | - artifacts = project.artifacts(ref_name=ref_name, job=job) | ||
| 57 | - assert artifacts == binary_content | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments