-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Copy dependencies to requirements.txt in pre commit #890
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these all dependencies including dev deps or we have some development packages listed as dependencies? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, I forgot about them There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added |
||
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() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add
files
to run this only on pyproject.toml change, WDYT?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, added