cycode 3.14.1.dev3__py3-none-any.whl → 3.15.1.dev1__py3-none-any.whl

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.
cycode/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = '3.14.1.dev3' # DON'T TOUCH. Placeholder. Will be filled automatically on poetry build from Git Tag
1
+ __version__ = '3.15.1.dev1' # DON'T TOUCH. Placeholder. Will be filled automatically on poetry build from Git Tag
cycode/cli/consts.py CHANGED
@@ -91,6 +91,7 @@ SCA_CONFIGURATION_SCAN_SUPPORTED_FILES = ( # keep in lowercase
91
91
  'build.scala',
92
92
  'build.sbt.lock',
93
93
  'pyproject.toml',
94
+ 'uv.lock',
94
95
  'poetry.lock',
95
96
  'pipfile',
96
97
  'pipfile.lock',
@@ -124,6 +125,7 @@ SCA_EXCLUDED_FOLDER_IN_PATH = (
124
125
  '.build',
125
126
  '.dart_tool',
126
127
  '.pub',
128
+ '.uv',
127
129
  )
128
130
 
129
131
  PROJECT_FILES_BY_ECOSYSTEM_MAP = {
@@ -145,6 +147,7 @@ PROJECT_FILES_BY_ECOSYSTEM_MAP = {
145
147
  'nuget': ['packages.config', 'project.assets.json', 'packages.lock.json', 'nuget.config'],
146
148
  'ruby_gems': ['Gemfile', 'Gemfile.lock'],
147
149
  'sbt': ['build.sbt', 'build.scala', 'build.sbt.lock'],
150
+ 'pypi_uv': ['pyproject.toml', 'uv.lock'],
148
151
  'pypi_poetry': ['pyproject.toml', 'poetry.lock'],
149
152
  'pypi_pipenv': ['Pipfile', 'Pipfile.lock'],
150
153
  'pypi_requirements': ['requirements.txt'],
@@ -0,0 +1,59 @@
1
+ from pathlib import Path
2
+ from typing import Optional
3
+
4
+ import typer
5
+
6
+ from cycode.cli.files_collector.sca.base_restore_dependencies import BaseRestoreDependencies, build_dep_tree_path
7
+ from cycode.cli.models import Document
8
+ from cycode.cli.utils.path_utils import get_file_content
9
+ from cycode.logger import get_logger
10
+
11
+ logger = get_logger('UV Restore Dependencies')
12
+
13
+ UV_MANIFEST_FILE_NAME = 'pyproject.toml'
14
+ UV_LOCK_FILE_NAME = 'uv.lock'
15
+
16
+ _UV_TOOL_SECTION = '[tool.uv]'
17
+
18
+
19
+ def _indicates_uv(pyproject_content: Optional[str]) -> bool:
20
+ """Return True if pyproject.toml content signals that this project uses UV."""
21
+ if not pyproject_content:
22
+ return False
23
+ return _UV_TOOL_SECTION in pyproject_content
24
+
25
+
26
+ class RestoreUvDependencies(BaseRestoreDependencies):
27
+ def __init__(self, ctx: typer.Context, is_git_diff: bool, command_timeout: int) -> None:
28
+ super().__init__(ctx, is_git_diff, command_timeout)
29
+
30
+ def is_project(self, document: Document) -> bool:
31
+ if Path(document.path).name != UV_MANIFEST_FILE_NAME:
32
+ return False
33
+
34
+ manifest_dir = self.get_manifest_dir(document)
35
+ if manifest_dir and (Path(manifest_dir) / UV_LOCK_FILE_NAME).is_file():
36
+ return True
37
+
38
+ return _indicates_uv(document.content)
39
+
40
+ def try_restore_dependencies(self, document: Document) -> Optional[Document]:
41
+ manifest_dir = self.get_manifest_dir(document)
42
+ lockfile_path = Path(manifest_dir) / UV_LOCK_FILE_NAME if manifest_dir else None
43
+
44
+ if lockfile_path and lockfile_path.is_file():
45
+ content = get_file_content(str(lockfile_path))
46
+ relative_path = build_dep_tree_path(document.path, UV_LOCK_FILE_NAME)
47
+ logger.debug('Using existing uv.lock, %s', {'path': str(lockfile_path)})
48
+ return Document(relative_path, content, self.is_git_diff)
49
+
50
+ return super().try_restore_dependencies(document)
51
+
52
+ def get_commands(self, manifest_file_path: str) -> list[list[str]]:
53
+ return [['uv', 'lock']]
54
+
55
+ def get_lock_file_name(self) -> str:
56
+ return UV_LOCK_FILE_NAME
57
+
58
+ def get_lock_file_names(self) -> list[str]:
59
+ return [UV_LOCK_FILE_NAME]
@@ -18,6 +18,7 @@ from cycode.cli.files_collector.sca.nuget.restore_nuget_dependencies import Rest
18
18
  from cycode.cli.files_collector.sca.php.restore_composer_dependencies import RestoreComposerDependencies
19
19
  from cycode.cli.files_collector.sca.python.restore_pipenv_dependencies import RestorePipenvDependencies
20
20
  from cycode.cli.files_collector.sca.python.restore_poetry_dependencies import RestorePoetryDependencies
21
+ from cycode.cli.files_collector.sca.python.restore_uv_dependencies import RestoreUvDependencies
21
22
  from cycode.cli.files_collector.sca.ruby.restore_ruby_dependencies import RestoreRubyDependencies
22
23
  from cycode.cli.files_collector.sca.sbt.restore_sbt_dependencies import RestoreSbtDependencies
23
24
  from cycode.cli.models import Document
@@ -159,6 +160,7 @@ def _get_restore_handlers(ctx: typer.Context, is_git_diff: bool) -> list[BaseRes
159
160
  RestoreDenoDependencies(ctx, is_git_diff, build_dep_tree_timeout),
160
161
  RestoreNpmDependencies(ctx, is_git_diff, build_dep_tree_timeout), # Must be after Yarn & Pnpm for fallback
161
162
  RestoreRubyDependencies(ctx, is_git_diff, build_dep_tree_timeout),
163
+ RestoreUvDependencies(ctx, is_git_diff, build_dep_tree_timeout), # Must be before Poetry for pyproject.toml
162
164
  RestorePoetryDependencies(ctx, is_git_diff, build_dep_tree_timeout),
163
165
  RestorePipenvDependencies(ctx, is_git_diff, build_dep_tree_timeout),
164
166
  RestoreComposerDependencies(ctx, is_git_diff, build_dep_tree_timeout),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cycode
3
- Version: 3.14.1.dev3
3
+ Version: 3.15.1.dev1
4
4
  Summary: Boost security in your dev lifecycle via SAST, SCA, Secrets & IaC scanning.
5
5
  License-Expression: MIT
6
6
  License-File: LICENCE
@@ -1,4 +1,4 @@
1
- cycode/__init__.py,sha256=BhPbI_uKPewKObHFToO2SKHeeEKp3MxpYkLPEG9btR4,115
1
+ cycode/__init__.py,sha256=nXbLpLkPIVyMbOnNnc_S4y-kfUY5TeaETaj3V2QXWc8,115
2
2
  cycode/__main__.py,sha256=Z3bD5yrA7yPvAChcADQrqCaZd0ChGI1gdiwALwbWJ6U,104
3
3
  cycode/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  cycode/cli/app.py,sha256=7ReEcVkRX9IaQ2I7jAj7Sl9smbtvxiuK8-9bitMEQik,7491
@@ -91,7 +91,7 @@ cycode/cli/apps/status/version_command.py,sha256=c6Iko_rmZo9T_kQSd3HUloBi40Qv7cj
91
91
  cycode/cli/cli_types.py,sha256=QbFWJLtlsEnHGdqdHbLolJqT57RfhocvsPAhlcNcCRE,3354
92
92
  cycode/cli/config.py,sha256=Op-lX_neanJtvPvoOEx4ByBdveh5ygElIga1FdSHhOI,299
93
93
  cycode/cli/console.py,sha256=vp-DHwlkwpwdsPyfwGdjsPF-6-Bi3f8W7G-W_YXCMH8,1914
94
- cycode/cli/consts.py,sha256=Se63JlWLCdDgntNYiPMIi2qbiqt9HUYYwHGXgTrrcfc,8957
94
+ cycode/cli/consts.py,sha256=YjP_aIOayJkGEc87hTCMZBmRAFtXgM-dspVF51nVSCs,9029
95
95
  cycode/cli/exceptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
96
96
  cycode/cli/exceptions/custom_exceptions.py,sha256=mTPLPI6V5JrEM6IQ8f7An9P207oYWEgJr-l9UpieSWk,4232
97
97
  cycode/cli/exceptions/handle_ai_remediation_errors.py,sha256=mA70upSYXK3rL_fmanzKYeUzLENhpXdkW8k3aIHrKzU,785
@@ -128,11 +128,12 @@ cycode/cli/files_collector/sca/php/restore_composer_dependencies.py,sha256=RgDL6
128
128
  cycode/cli/files_collector/sca/python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
129
129
  cycode/cli/files_collector/sca/python/restore_pipenv_dependencies.py,sha256=1APGwJWInAITKKXw2wJDxTxpHZBOjX0wGOcBHPsyTes,1832
130
130
  cycode/cli/files_collector/sca/python/restore_poetry_dependencies.py,sha256=VYw_2qbsLtzkBuMGxRXTaOwDt2hPcG3f094mPLmiVLM,2486
131
+ cycode/cli/files_collector/sca/python/restore_uv_dependencies.py,sha256=VhlJ3K5yL8WH-HSD5GkdJ7_NupqMk1_hrL5HVs3F1cQ,2173
131
132
  cycode/cli/files_collector/sca/ruby/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
132
133
  cycode/cli/files_collector/sca/ruby/restore_ruby_dependencies.py,sha256=Vqswcxte9YjGnvIm9oZ8r91jNyhuiYDf1mouaTaLg3U,694
133
134
  cycode/cli/files_collector/sca/sbt/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
134
135
  cycode/cli/files_collector/sca/sbt/restore_sbt_dependencies.py,sha256=cfBUR4iQcfplX_O2QPjYh2wSyBteze8wZcT_dG9d1d4,709
135
- cycode/cli/files_collector/sca/sca_file_collector.py,sha256=bl4tWP6osApci8nQ2Fd8iCLyn84O67II3CvvU8OCwC8,9712
136
+ cycode/cli/files_collector/sca/sca_file_collector.py,sha256=YnO1SYvzDM-9YjKLjfPJJ-El7MrvqCdV8PyjOeY3THk,9925
136
137
  cycode/cli/files_collector/walk_ignore.py,sha256=nvOM6oDmT2SxSI4pU-bLlc9LwTgkfTd2egse69ixf3g,2464
137
138
  cycode/cli/files_collector/zip_documents.py,sha256=FMzbA2Vog7Zl_ntizNQJK8AFqoGu0QlPIMIBpgmBiVI,1852
138
139
  cycode/cli/logger.py,sha256=mlaYEQGYd582fTCc3SC3cFMj0PKTB6EsaI12Q4VL1z8,65
@@ -203,8 +204,8 @@ cycode/cyclient/report_client.py,sha256=Scq30NeJPzgXv0hPLO1U05AdE9i_2iu6cIrSKpEJ
203
204
  cycode/cyclient/scan_client.py,sha256=6TK5FQkfrvV7PHqRnUzEn1PBNd2oPYVamvIixcUfe3c,16755
204
205
  cycode/cyclient/scan_config_base.py,sha256=mXsPZGYCtp85rv5GIige40yQZXuRcEKUW-VQJ0vgFzk,1201
205
206
  cycode/logger.py,sha256=EfZGRK6VC5rE_LAjIcRrHFiQCueylCDXoG6bvGkrIME,2111
206
- cycode-3.14.1.dev3.dist-info/METADATA,sha256=Uzs9kSOHgPF1YN6jimeDoG40x_HAe0Ngfb788e_JMsc,87415
207
- cycode-3.14.1.dev3.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
208
- cycode-3.14.1.dev3.dist-info/entry_points.txt,sha256=iDcVJM8ByLElVgvBgtYxDjw1kT7O8Mo0LcWZIT5L3Ig,45
209
- cycode-3.14.1.dev3.dist-info/licenses/LICENCE,sha256=2Wx4N6mD_4xB7-E3hPkZ3MPhpJy__k_I8MaCSO-PDRo,1068
210
- cycode-3.14.1.dev3.dist-info/RECORD,,
207
+ cycode-3.15.1.dev1.dist-info/METADATA,sha256=X_8NG0KTTWBdWFAF-jxWhUcexkFYzOKyEWce_Fs9I1Q,87415
208
+ cycode-3.15.1.dev1.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
209
+ cycode-3.15.1.dev1.dist-info/entry_points.txt,sha256=iDcVJM8ByLElVgvBgtYxDjw1kT7O8Mo0LcWZIT5L3Ig,45
210
+ cycode-3.15.1.dev1.dist-info/licenses/LICENCE,sha256=2Wx4N6mD_4xB7-E3hPkZ3MPhpJy__k_I8MaCSO-PDRo,1068
211
+ cycode-3.15.1.dev1.dist-info/RECORD,,