Skip to content

Commit

Permalink
Merge pull request #55 from dhellmann/convert-to-click
Browse files Browse the repository at this point in the history
convert cli processing to use click
  • Loading branch information
mergify[bot] authored Jun 6, 2024
2 parents 7af6002 + fdfe54f commit 83028da
Show file tree
Hide file tree
Showing 12 changed files with 580 additions and 550 deletions.
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,23 @@ Production builds use separate commands for the steps described as
part of bootstrapping, and accept arguments to control the servers
that are used for downloading source or built wheels.

The `download-source-archive` command finds the source distribution
for a specific version of a dependency on the specified package index
and downloads it. It will be common to run this step with `pypi.org`,
but for truly isolated and reproducible builds a private index server
is more robust.

The `prepare-source` command unpacks the source archive downloaded
from the previous step and applies any patches (refer to
The `step download-source-archive` command finds the source
distribution for a specific version of a dependency on the specified
package index and downloads it. It will be common to run this step
with `pypi.org`, but for truly isolated and reproducible builds a
private index server is more robust.

The `step prepare-source` command unpacks the source archive
downloaded from the previous step and applies any patches (refer to
[customization](docs/customization.md) for details about patching).

The `prepare-build` command creates a virtualenv with the build
The `step prepare-build` command creates a virtualenv with the build
dependencies for building the wheel. It expects a `--wheel-server-url`
as argument to control where built wheels can be downloaded.

The `build` command prepares a wheel, compiling any extensions using
the appropriate override environment settings (refer to
The `step build-wheel` command creates a wheel using the build
environment and prepared source, compiling any extensions using the
appropriate override environment settings (refer to
[customization](docs/customization.md) for details about overrides).

## Additional docs
Expand Down
8 changes: 4 additions & 4 deletions e2e/test_build_with_build_order.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ build_wheel() {
--work-dir "$OUTDIR/work-dir" \
--sdists-repo "$OUTDIR/sdists-repo" \
--wheels-repo "$OUTDIR/wheels-repo" \
download-source-archive "$dist" "$version" "https://pypi.org/simple"
step download-source-archive "$dist" "$version" "https://pypi.org/simple"

# Prepare the source dir for building
fromager \
--log-file "$OUTDIR/build-logs/${dist}-prepare-source.log" \
--work-dir "$OUTDIR/work-dir" \
--sdists-repo "$OUTDIR/sdists-repo" \
--wheels-repo "$OUTDIR/wheels-repo" \
prepare-source "$dist" "$version"
step prepare-source "$dist" "$version"

# Prepare the build environment
fromager \
Expand All @@ -80,7 +80,7 @@ build_wheel() {
--sdists-repo "$OUTDIR/sdists-repo" \
--wheels-repo "$OUTDIR/wheels-repo" \
--wheel-server-url "${WHEEL_SERVER_URL}" \
prepare-build "$dist" "$version"
step prepare-build "$dist" "$version"

# Build the wheel
fromager \
Expand All @@ -89,7 +89,7 @@ build_wheel() {
--sdists-repo "$OUTDIR/sdists-repo" \
--wheels-repo "$OUTDIR/wheels-repo" \
--wheel-server-url "${WHEEL_SERVER_URL}" \
build "$dist" "$version"
step build-wheel "$dist" "$version"

# Move the built wheel into place
mv "$OUTDIR"/wheels-repo/build/*.whl "$OUTDIR/wheels-repo/downloads/"
Expand Down
6 changes: 3 additions & 3 deletions e2e/test_report_missing_dependency.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ fromager \
--work-dir "$OUTDIR/work-dir" \
--sdists-repo "$OUTDIR/sdists-repo" \
--wheels-repo "$OUTDIR/wheels-repo" \
download-source-archive "$DIST" "$VERSION" "https://pypi.org/simple"
step download-source-archive "$DIST" "$VERSION" "https://pypi.org/simple"

# Prepare the source dir for building
fromager \
--log-file "$OUTDIR/build-logs/prepare-source.log" \
--work-dir "$OUTDIR/work-dir" \
--sdists-repo "$OUTDIR/sdists-repo" \
--wheels-repo "$OUTDIR/wheels-repo" \
prepare-source "$DIST" "$VERSION"
step prepare-source "$DIST" "$VERSION"

# Prepare the build environment
fromager \
Expand All @@ -84,7 +84,7 @@ fromager \
--sdists-repo "$OUTDIR/sdists-repo" \
--wheels-repo "$OUTDIR/wheels-repo" \
--wheel-server-url "${WHEEL_SERVER_URL}" \
prepare-build "$DIST" "$VERSION" \
step prepare-build "$DIST" "$VERSION" \
|| echo "Got expected build error"

if grep -q "MissingDependency" "$OUTDIR/build-logs/prepare-build.log"; then
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ classifiers = [
requires-python = ">=3.10"

dependencies = [
"click>=8.1.7",
"html5lib",
"packaging",
"pkginfo",
Expand Down Expand Up @@ -59,7 +60,7 @@ build = [
Repository = "https://github.com/python-wheel-build/fromager"

[project.scripts]
fromager = "fromager.__main__:main"
fromager = "fromager.__main__:invoke_main"

[project.entry-points."fromager.project_overrides"]
# This test plugin should stay in the package.
Expand Down
Loading

0 comments on commit 83028da

Please sign in to comment.