Skip to content

Commit

Permalink
Copy dependencies to requirements.txt in pre commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-astus committed Mar 12, 2024
1 parent dd2358f commit 8699c54
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,7 @@ 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
19 changes: 19 additions & 0 deletions .snyk/dependency-sync.py
Original file line number Diff line number Diff line change
@@ -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/requirements.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()
20 changes: 20 additions & 0 deletions .snyk/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Auto generated
coverage==7.4.3
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
pre-commit>=3.5.0
pytest==8.0.2
pytest-randomly==3.15.0
syrupy==4.6.1
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ classifiers = [

[project.optional-dependencies]
development = [
"coverage==7.4.3",
"pre-commit>=3.5.0",
"pytest==8.1.1",
"pytest-randomly==3.15.0",
Expand Down

0 comments on commit 8699c54

Please sign in to comment.