Skip to content

Commit 8b99748

Browse files
committed
Build an publish pyproject-based metapackage
1 parent 6120bfb commit 8b99748

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/oca_github_bot/build_wheels.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -136,19 +136,21 @@ def build_and_publish_metapackage_wheel(
136136
dry_run: bool,
137137
):
138138
setup_dir = Path(addons_dir) / "setup" / "_metapackage"
139-
setup_file = setup_dir / "setup.py"
140-
if not setup_file.is_file():
139+
setup_py_file = setup_dir / "setup.py"
140+
pyproject_toml_file = setup_dir / "pyproject.toml"
141+
if not pyproject_toml_file.is_file() and not setup_py_file.is_file():
141142
return
142143
with tempfile.TemporaryDirectory() as dist_dir:
143-
# Workaround for recent setuptools not generating long_description
144-
# anymore (before it was generating UNKNOWN), and a long_description
145-
# is required by twine check. We could fix setuptools-odoo-makedefault
146-
# but that would not backfill the legacy. So here we are...
147-
if "long_description" not in setup_file.read_text():
144+
if (
145+
setup_py_file.is_file()
146+
and "long_description" not in setup_py_file.read_text()
147+
):
148+
# Workaround for recent setuptools not generating long_description
149+
# anymore (before it was generating UNKNOWN), and a long_description
150+
# is required by twine check. We could fix setuptools-odoo-makedefault
151+
# but that would not backfill the legacy. So here we are...
148152
setup_dir.joinpath("setup.cfg").write_text(
149153
"[metadata]\nlong_description = UNKNOWN\n"
150154
)
151-
if Builder.get().build_wheel_legacy(
152-
setup_dir, dist_dir, python_tag="py2" if series < (11, 0) else "py3"
153-
):
155+
if Builder.get().build_wheel(setup_dir, dist_dir):
154156
dist_publisher.publish(dist_dir, dry_run)

0 commit comments

Comments
 (0)