-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mraba/snyk-support-requirements: add requirements.txt file for snyk s…
…canning (#491) * mraba/snyk-support-requirements: add requirements.txt file for snyk scanning * mraba/snyk-support-requirements: add script for generating requirements and filename fix * mraba/snyk-support-requirements: finish last line with new line * mraba/snyk-support-requirements: add pre-commit hook for auto generating requirements.txt
- Loading branch information
1 parent
d2b3334
commit 8f06fd4
Showing
4 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
SQLAlchemy>=1.4.19,<2.0.0 | ||
snowflake-connector-python<4.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from pathlib import Path | ||
|
||
import tomlkit | ||
|
||
|
||
def sync(): | ||
pyproject = tomlkit.loads(Path("pyproject.toml").read_text()) | ||
snyk_reqiurements = Path("snyk/requirements.txt") | ||
dependencies = pyproject.get("project", {}).get("dependencies", []) | ||
|
||
with snyk_reqiurements.open("w") as fh: | ||
fh.write("\n".join(dependencies)) | ||
fh.write("\n") | ||
|
||
|
||
if __name__ == "__main__": | ||
sync() |