diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3032f566a8..121f5fe805 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -55,3 +55,8 @@ repos: pass_filenames: true files: ^src/.*\.py$ exclude: ^src/snowflake/cli/app/telemetry.py$ + - id: dependencies-sync + name: "Copy dependencies from pyproject.toml to requirements.txt" + language: system + entry: python .snyk/dependency-sync.py + files: ^pyproject.toml$ diff --git a/.snyk/dependency-sync.py b/.snyk/dependency-sync.py new file mode 100644 index 0000000000..670975dd9f --- /dev/null +++ b/.snyk/dependency-sync.py @@ -0,0 +1,19 @@ +from pathlib import Path + +import tomllib + + +def sync(): + pyproject = tomllib.loads(Path("pyproject.toml").read_text()) + dependencies = pyproject["project"]["dependencies"] + dev_dependencies = pyproject["project"]["optional-dependencies"]["development"] + with open(".snyk/req-auto-generated.txt", "w") as req: + req.write("# Auto generated\n") + for dep in dependencies: + req.write(f"{dep}\n") + for dep in dev_dependencies: + req.write(f"{dep}\n") + + +if __name__ == "__main__": + sync() diff --git a/.snyk/req-auto-generated.txt b/.snyk/req-auto-generated.txt new file mode 100644 index 0000000000..5e8953bb24 --- /dev/null +++ b/.snyk/req-auto-generated.txt @@ -0,0 +1,20 @@ +# Auto generated +jinja2==3.1.3 +pluggy==1.4.0 +PyYAML==6.0.1 +rich==13.7.1 +requests==2.31.0 +requirements-parser==0.5.0 +setuptools==69.1.1 +snowflake-connector-python[secure-local-storage]==3.7.1 +strictyaml==1.7.3 +tomlkit==0.12.3 +typer==0.9.0 +urllib3>=1.21.1,<2.3 +GitPython==3.1.42 +pydantic==2.6.3 +coverage==7.4.3 +pre-commit>=3.5.0 +pytest==8.1.1 +pytest-randomly==3.15.0 +syrupy==4.6.1 diff --git a/pyproject.toml b/pyproject.toml index 337ee507b5..0716704b4a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,6 @@ requires-python = ">=3.8" description = "Snowflake CLI" readme = "README.md" dependencies = [ - "coverage==7.4.3", "jinja2==3.1.3", "pluggy==1.4.0", "PyYAML==6.0.1",