Skip to content

Commit

Permalink
BLD Drop pyodide_build entrypoint (pyodide#4368)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanking13 authored Jan 23, 2024
1 parent a14d34f commit 53f9faa
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 205 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ src/js/generated/pyproxy.ts : src/core/pyproxy.* src/core/*.h

pyodide_build: ./pyodide-build/pyodide_build/**
$(HOSTPYTHON) -m pip install -e ./pyodide-build
which pyodide-build >/dev/null
which pyodide >/dev/null

dist/python_stdlib.zip: pyodide_build $(CPYTHONLIB)
Expand Down
3 changes: 3 additions & 0 deletions docs/project/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ myst:
- {{ Enhancement }} ABI Break: Updated Emscripten to version 3.1.52
{pr}`4399`

- {{ Breaking }} `pyodide-build` entrypoint is removed in favor of `pyodide`.
This entrypoint was deprecated since 0.22.0.

- {{ Enhancement }} Added apis to discard extra arguments when calling Python
functions.
{pr}`4392`
Expand Down
50 changes: 0 additions & 50 deletions pyodide-build/pyodide_build/__main__.py

This file was deleted.

11 changes: 6 additions & 5 deletions pyodide-build/pyodide_build/buildall.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ def tests_path(self) -> Path | None:
def build(self, build_args: BuildArgs) -> None:
p = subprocess.run(
[
sys.executable,
"-m",
"pyodide_build",
"buildpkg",
str(self.pkgdir / "meta.yaml"),
"pyodide",
"build-recipes",
self.name,
"--recipe-dir",
str(self.pkgdir.parent),
f"--cflags={build_args.cflags}",
f"--cxxflags={build_args.cxxflags}",
f"--ldflags={build_args.ldflags}",
Expand All @@ -152,6 +152,7 @@ def build(self, build_args: BuildArgs) -> None:
# been updated and should be rebuilt even though its own
# files haven't been updated.
"--force-rebuild",
"--no-deps",
],
check=False,
stdout=subprocess.DEVNULL,
Expand Down
90 changes: 0 additions & 90 deletions pyodide-build/pyodide_build/buildpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
Builds a Pyodide package.
"""

import argparse
import cgi
import fnmatch
import json
Expand All @@ -18,7 +17,6 @@
from contextlib import contextmanager
from datetime import datetime
from pathlib import Path
from textwrap import dedent
from types import TracebackType
from typing import Any, TextIO, cast
from urllib import request
Expand Down Expand Up @@ -875,91 +873,3 @@ def build_package(
logger.success(msg)
else:
logger.error(msg)


def make_parser(parser: argparse.ArgumentParser) -> argparse.ArgumentParser:
parser.description = (
"Build a pyodide package.\n\n"
"Note: this is a private endpoint that should not be used "
"outside of the Pyodide Makefile."
)
parser.add_argument(
"package", type=str, nargs=1, help="Path to meta.yaml package description"
)
parser.add_argument(
"--cflags",
type=str,
nargs="?",
default=get_build_flag("SIDE_MODULE_CFLAGS"),
help="Extra compiling flags",
)
parser.add_argument(
"--cxxflags",
type=str,
nargs="?",
default=get_build_flag("SIDE_MODULE_CXXFLAGS"),
help="Extra C++ specific compiling flags",
)
parser.add_argument(
"--ldflags",
type=str,
nargs="?",
default=get_build_flag("SIDE_MODULE_LDFLAGS"),
help="Extra linking flags",
)
parser.add_argument(
"--target-install-dir",
type=str,
nargs="?",
default=get_build_flag("TARGETINSTALLDIR"),
help="The path to the target Python installation",
)
parser.add_argument(
"--host-install-dir",
type=str,
nargs="?",
default=get_build_flag("HOSTINSTALLDIR"),
help=(
"Directory for installing built host packages. Defaults to setup.py "
"default. Set to 'skip' to skip installation. Installation is "
"needed if you want to build other packages that depend on this one."
),
)
parser.add_argument(
"--force-rebuild",
action="store_true",
help=(
"Force rebuild of package regardless of whether it appears to have been updated"
),
)
parser.add_argument(
"--continue",
dest="continue_",
action="store_true",
help=(
dedent(
"""
Continue a build from the middle. For debugging. Implies "--force-rebuild".
"""
).strip()
),
)
return parser


def main(args: argparse.Namespace) -> None:
build_args = BuildArgs(
pkgname="",
cflags=args.cflags,
cxxflags=args.cxxflags,
ldflags=args.ldflags,
target_install_dir=args.target_install_dir,
host_install_dir=args.host_install_dir,
)
build_package(args.package[0], build_args, args.force_rebuild, args.continue_)


if __name__ == "__main__":
parser = make_parser(argparse.ArgumentParser())
args = parser.parse_args()
main(args)
56 changes: 0 additions & 56 deletions pyodide-build/pyodide_build/serve.py

This file was deleted.

3 changes: 0 additions & 3 deletions pyodide-build/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ deploy = [
"moto",
]

[project.scripts]
pyodide-build = "pyodide_build.__main__:main"

[tool.setuptools]
package-dir = {"" = "."}
license-files = ["LICENSE"]
Expand Down

0 comments on commit 53f9faa

Please sign in to comment.