yauto: Add extra python dependencies as DepObjects instead of string (#4919)

**Summary**

Add a method for including additional dependencies in `yauto` and use it
for the `pyproject.toml` dependencies instead of writing them as a
string.

Part of https://github.com/getsolus/packages/issues/4914

**Test Plan**
`
go-task new -- rapidyaml
https://github.com/biojppm/rapidyaml/archive/refs/tags/v0.7.2.tar.gz`
succeeds

**Checklist**

- [x] Package was built and tested against unstable
- [ ] This change could gainfully be listed in the weekly sync notes
once merged <!-- Write an appropriate message in the Summary section,
then add the "Topic: Sync Notes" label -->
This commit is contained in:
Joey Riches 2025-02-01 18:13:29 +00:00 committed by GitHub
commit 5b872b96a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -164,10 +164,9 @@ class AutoPackage:
)
# Handle python modules respecting PEP517.
if "pyproject.toml" in file or "setup.cfg" in file:
self.build_deps = (
"- python-build\n - python-installer\n - python-packaging\n - "
"python-wheel"
)
self.build_deps.extend(self.extra_build_deps(["python-build", "python-installer",
"python-packaging", "python-wheel"]))
if "Makefile.PL" in file or "Build.PL" in file:
# This is a perl module
known_types.append(PERL_MODULES)
@ -274,6 +273,15 @@ class AutoPackage:
return deps
@staticmethod
def extra_build_deps(deps):
extra_deps = list()
for entry in deps:
dep = DepObject()
dep.name = entry
extra_deps.append(dep)
return extra_deps
def create_yaml(self):
"""Attempt creation of a package.yml..."""
with open("package.yml", "w") as yml: