File tree Expand file tree Collapse file tree 4 files changed +38
-68
lines changed
Expand file tree Collapse file tree 4 files changed +38
-68
lines changed Original file line number Diff line number Diff line change @@ -24,24 +24,19 @@ jobs:
2424 with :
2525 python-version : " 3.10"
2626
27- - name : Install pipx
28- run : python -m pip install --user pipx
29-
30- - name : Install build using pipx
31- run : pipx install build
32-
33- - name : Set BUILD_RAGNA_BASE environment variable
27+ - name : Install build dependencies
3428 run : |
35- if [ "${{ matrix.package }}" == "ragna-base" ]; then
36- echo "BUILD_RAGNA_BASE=1" >> $GITHUB_ENV
37- else
38- echo "BUILD_RAGNA_BASE=" >> $GITHUB_ENV
39- fi
29+ python -m pip install --upgrade pip
30+ python -m pip install build toml
31+
32+ - name : Modify pyproject.toml
33+ run : python scripts/build_helper.py ${{ matrix.package }}
4034
4135 - name : Build distribution
4236 run : |
4337 echo "Building package: ${{ matrix.package }}"
44- pipx run build
38+ python -m build
39+ echo "Build complete for ${{ matrix.package }}"
4540
4641 - name : Verify package
4742 run : |
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ import toml
2+
3+
4+ def modify_pyproject (package_name ):
5+ with open ("pyproject.toml" , "r" ) as f :
6+ pyproject_data = toml .load (f )
7+
8+ pyproject_data ["project" ]["name" ] = package_name
9+
10+ if package_name == "ragna-base" :
11+ pyproject_data ["tool" ]["setuptools" ]["dynamic" ]["dependencies" ] = {
12+ "file" : ["requirements-base.txt" ]
13+ }
14+ else :
15+ pyproject_data ["tool" ]["setuptools" ]["dynamic" ]["dependencies" ] = {
16+ "file" : ["requirements.txt" ]
17+ }
18+
19+ with open ("pyproject.toml" , "w" ) as f :
20+ toml .dump (pyproject_data , f )
21+
22+
23+ if __name__ == "__main__" :
24+ import sys
25+
26+ package_name = sys .argv [1 ]
27+ if package_name not in ["ragna" , "ragna-base" ]:
28+ print ("Invalid package name. Must be 'ragna' or 'ragna-base'." )
29+ sys .exit (1 )
30+ modify_pyproject (package_name )
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments