Skip to content

Commit

Permalink
remove wheel-server-url arg
Browse files Browse the repository at this point in the history
Signed-off-by: Shubh Bapna <[email protected]>
  • Loading branch information
Shubh Bapna committed Nov 13, 2024
1 parent 848e309 commit 55f6303
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 23 deletions.
6 changes: 2 additions & 4 deletions e2e/test_build_steps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ build_wheel() {
--work-dir "$OUTDIR/work-dir" \
--sdists-repo "$OUTDIR/sdists-repo" \
--wheels-repo "$OUTDIR/wheels-repo" \
--wheel-server-url "${WHEEL_SERVER_URL}" \
step prepare-build "$dist" "$version"
step prepare-build --wheel-server-url "${WHEEL_SERVER_URL}" "$dist" "$version"

# Build an updated sdist
fromager \
Expand All @@ -71,8 +70,7 @@ build_wheel() {
--work-dir "$OUTDIR/work-dir" \
--sdists-repo "$OUTDIR/sdists-repo" \
--wheels-repo "$OUTDIR/wheels-repo" \
--wheel-server-url "${WHEEL_SERVER_URL}" \
step build-wheel "$dist" "$version"
step build-wheel --wheel-server-url "${WHEEL_SERVER_URL}" "$dist" "$version"

# Move the built wheel into place
mv "$OUTDIR"/wheels-repo/build/*.whl "$OUTDIR/wheels-repo/downloads/"
Expand Down
3 changes: 1 addition & 2 deletions e2e/test_pep517_build_sdist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ fromager \
--work-dir "$OUTDIR/work-dir" \
--sdists-repo "$OUTDIR/sdists-repo" \
--wheels-repo "$OUTDIR/wheels-repo" \
--wheel-server-url "https://pypi.org/simple/" \
step prepare-build "$DIST" "$VERSION"
step prepare-build --wheel-server-url "https://pypi.org/simple/" "$DIST" "$VERSION"

# Build an updated sdist
rm -rf "$OUTDIR/sdists-repo/builds"
Expand Down
3 changes: 1 addition & 2 deletions e2e/test_report_missing_dependency.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ fromager \
--work-dir "$OUTDIR/work-dir" \
--sdists-repo "$OUTDIR/sdists-repo" \
--wheels-repo "$OUTDIR/wheels-repo" \
--wheel-server-url "${WHEEL_SERVER_URL}" \
step prepare-build "$DIST" "$VERSION" \
step prepare-build --wheel-server-url "${WHEEL_SERVER_URL}" "$DIST" "$VERSION" \
|| echo "Got expected build error"

if grep -q "MissingDependency" "$build_log"; then
Expand Down
9 changes: 0 additions & 9 deletions src/fromager/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,6 @@
type=clickext.ClickPath(),
help="location of the constraints file",
)
@click.option(
"--wheel-server-url",
default="",
type=str,
help="URL for the wheel server for builds",
)
@click.option(
"--cleanup/--no-cleanup",
default=True,
Expand Down Expand Up @@ -149,7 +143,6 @@ def main(
settings_file: pathlib.Path,
settings_dir: pathlib.Path,
constraints_file: pathlib.Path,
wheel_server_url: str,
cleanup: bool,
variant: str,
jobs: int | None,
Expand Down Expand Up @@ -203,7 +196,6 @@ def main(
logger.info(f"patches dir: {patches_dir}")
logger.info(f"maximum concurrent jobs: {jobs}")
logger.info(f"constraints file: {constraints_file}")
logger.info(f"wheel server url: {wheel_server_url}")
logger.info(f"network isolation: {network_isolation}")
overrides.log_overrides()

Expand All @@ -223,7 +215,6 @@ def main(
sdists_repo=sdists_repo,
wheels_repo=wheels_repo,
work_dir=work_dir,
wheel_server_url=wheel_server_url,
cleanup=cleanup,
variant=variant,
network_isolation=network_isolation,
Expand Down
8 changes: 8 additions & 0 deletions src/fromager/commands/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,19 @@ def __lt__(self, other):


@click.command()
@click.option(
"--wheel-server-url",
default="",
type=str,
help="URL for the wheel server for builds",
)
@click.argument("dist_name")
@click.argument("dist_version", type=clickext.PackageVersion())
@click.argument("sdist_server_url")
@click.pass_obj
def build(
wkctx: context.WorkContext,
wheel_server_url: str,
dist_name: str,
dist_version: Version,
sdist_server_url: str,
Expand All @@ -81,6 +88,7 @@ def build(
separately.
"""
wkctx.wheel_server_url = wheel_server_url
server.start_wheel_server(wkctx)
req = Requirement(f"{dist_name}=={dist_version}")
source_url, version = sources.resolve_source(
Expand Down
17 changes: 17 additions & 0 deletions src/fromager/commands/step.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,18 @@ def _find_source_root_dir(


@step.command()
@click.option(
"--wheel-server-url",
default="",
type=str,
help="URL for the wheel server for builds",
)
@click.argument("dist_name")
@click.argument("dist_version", type=clickext.PackageVersion())
@click.pass_obj
def prepare_build(
wkctx: context.WorkContext,
wheel_server_url: str,
dist_name: str,
dist_version: Version,
) -> None:
Expand All @@ -157,6 +164,7 @@ def prepare_build(
DIST_VERSION is the version to process
"""
wkctx.wheel_server_url = wheel_server_url
server.start_wheel_server(wkctx)
req = Requirement(f"{dist_name}=={dist_version}")
source_root_dir = _find_source_root_dir(wkctx, wkctx.work_dir, req, dist_version)
Expand All @@ -166,11 +174,18 @@ def prepare_build(


@step.command()
@click.option(
"--wheel-server-url",
default="",
type=str,
help="URL for the wheel server for builds",
)
@click.argument("dist_name")
@click.argument("dist_version", type=clickext.PackageVersion())
@click.pass_obj
def build_wheel(
wkctx: context.WorkContext,
wheel_server_url: str,
dist_name: str,
dist_version: Version,
) -> None:
Expand All @@ -181,8 +196,10 @@ def build_wheel(
DIST_VERSION is the version to process
"""
wkctx.wheel_server_url = wheel_server_url
req = Requirement(f"{dist_name}=={dist_version}")
source_root_dir = _find_source_root_dir(wkctx, wkctx.work_dir, req, dist_version)
server.start_wheel_server(wkctx)
build_env = build_environment.BuildEnvironment(wkctx, source_root_dir.parent, None)
wheel_filename = wheels.build_wheel(
ctx=wkctx,
Expand Down
3 changes: 1 addition & 2 deletions src/fromager/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ def __init__(
sdists_repo: pathlib.Path,
wheels_repo: pathlib.Path,
work_dir: pathlib.Path,
wheel_server_url: str,
cleanup: bool = True,
variant: str = "cpu",
network_isolation: bool = False,
Expand Down Expand Up @@ -61,7 +60,7 @@ def __init__(
self.wheels_prebuilt = self.wheels_repo / "prebuilt"
self.wheel_server_dir = self.wheels_repo / "simple"
self.work_dir = pathlib.Path(work_dir).absolute()
self.wheel_server_url = wheel_server_url
self.wheel_server_url = ""
self.logs_dir = self.work_dir / "logs"
self.cleanup = cleanup
self.variant = variant
Expand Down
2 changes: 0 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def tmp_context(tmp_path: pathlib.Path) -> context.WorkContext:
sdists_repo=tmp_path / "sdists-repo",
wheels_repo=tmp_path / "wheels-repo",
work_dir=tmp_path / "work-dir",
wheel_server_url="",
variant=variant,
)
ctx.setup()
Expand All @@ -52,7 +51,6 @@ def testdata_context(
sdists_repo=tmp_path / "sdists-repo",
wheels_repo=tmp_path / "wheels-repo",
work_dir=tmp_path / "work-dir",
wheel_server_url="",
)
ctx.setup()
return ctx
Expand Down
2 changes: 0 additions & 2 deletions tests/test_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ def test_pip_constraints_args(tmp_path):
sdists_repo=tmp_path / "sdists-repo",
wheels_repo=tmp_path / "wheels-repo",
work_dir=tmp_path / "work-dir",
wheel_server_url="",
)
ctx.setup()
assert ["--constraint", os.fspath(constraints_file)] == ctx.pip_constraint_args
Expand All @@ -25,7 +24,6 @@ def test_pip_constraints_args(tmp_path):
sdists_repo=tmp_path / "sdists-repo",
wheels_repo=tmp_path / "wheels-repo",
work_dir=tmp_path / "work-dir",
wheel_server_url="",
)
ctx.setup()
assert [] == ctx.pip_constraint_args

0 comments on commit 55f6303

Please sign in to comment.