File tree Expand file tree Collapse file tree 4 files changed +55
-8
lines changed Expand file tree Collapse file tree 4 files changed +55
-8
lines changed Original file line number Diff line number Diff line change 1+ name : Check requirements file consistency
2+
3+ on : [push]
4+
5+ jobs :
6+ requirements-check :
7+ runs-on : ubuntu-latest
8+ steps :
9+ - uses : actions/checkout@v2
10+ - name : Install uv
11+ uses : astral-sh/setup-uv@v6
12+ with :
13+ version : " 0.7.x"
14+ - name : Install dependencies
15+ run : uv sync --frozen
16+ - run : uv run ./requirements/update_requirements.py
17+ - run : git diff --exit-code
Original file line number Diff line number Diff line change 1+ # generated with update_requirements.py, do not edit manually
12cryptography>=3.3.1
2- GitPython
3+ gitpython
4+ legacycrypt
35packaging>=20.7
4- pytest>=8.0.0
56pluggy>=1.1.0
6- requests
7- legacycrypt
7+ pytest>=8.0.0
88pytest-dependency
9+ requests
Original file line number Diff line number Diff line change 1- # All requirements + those only used in development
1+ # generated with update_requirements.py, do not edit manually
22ansible>=5.0.1
33bs4>=0.0.1
4- flake8
5- PyYAML>=6.0
64mypy
7- typing_extensions
5+ flake8
6+ pydocstyle
87pyright
8+ pyyaml>=6.0
99types-requests
10+ typing-extensions
1011-r base.txt
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+
3+ import argparse
4+ import tomllib
5+ from pathlib import Path
6+
7+ parser = argparse .ArgumentParser (description = "Convert the dependencies from pyproject.toml in requirements.txt files" )
8+ args = parser .parse_args ()
9+
10+ PROJECT_DIR = Path (__file__ ).parent .parent
11+ HEADER = "# generated with update_requirements.py, do not edit manually"
12+
13+ with open (f'{ PROJECT_DIR } /pyproject.toml' , 'rb' ) as f :
14+ pyproject = tomllib .load (f )
15+
16+
17+ main_deps = pyproject ['project' ]['dependencies' ]
18+ with open (f'{ PROJECT_DIR } /requirements/base.txt' , 'w' ) as f :
19+ print (HEADER , file = f )
20+ for dep in main_deps :
21+ print (dep , file = f )
22+
23+ dev_deps = pyproject ['dependency-groups' ]['dev' ]
24+ with open (f'{ PROJECT_DIR } /requirements/dev.txt' , 'w' ) as f :
25+ print (HEADER , file = f )
26+ for dep in dev_deps :
27+ print (dep , file = f )
28+ print ('-r base.txt' , file = f )
You can’t perform that action at this time.
0 commit comments