Skip to content

Commit bd65487

Browse files
committed
Get rid of noxfile & setup try using helper script instead
1 parent c396b55 commit bd65487

File tree

4 files changed

+38
-68
lines changed

4 files changed

+38
-68
lines changed

.github/workflows/build_package.yml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff 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: |

noxfile.py

Lines changed: 0 additions & 27 deletions
This file was deleted.

scripts/build_helper.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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)

setup.py

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)