-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from dhellmann/e2e-flit-core-override
e2e: extend end-to-end testing
- Loading branch information
Showing
12 changed files
with
219 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
e2e/flit_core_override/build/lib/package_plugins/flit_core.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import logging | ||
|
||
from fromager import external_commands | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def build_wheel(ctx, build_env, extra_environ, req, sdist_root_dir): | ||
# flit_core is a basic build system dependency for several | ||
# packages. It is capable of building its own wheels, so we use the | ||
# bootstrapping instructions to do that and put the wheel in the | ||
# local server directory for reuse when building other packages via | ||
# 'pip wheel'. | ||
# | ||
# https://flit.pypa.io/en/stable/bootstrap.html | ||
logger.info('using override to build flit_core wheel in %s', sdist_root_dir) | ||
external_commands.run( | ||
[build_env.python, '-m', 'flit_core.wheel', | ||
'--outdir', ctx.wheels_build], | ||
cwd=sdist_root_dir, | ||
extra_environ=extra_environ, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
[build-system] | ||
requires = ["setuptools"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "flit-core-overrides" | ||
authors = [ | ||
{name = "Doug Hellmann", email="[email protected]"}, | ||
] | ||
description = "test package" | ||
dynamic = ["version"] | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Environment :: Console", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: BSD License", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Programming Language :: Python :: Implementation :: CPython", | ||
"Topic :: Utilities", | ||
] | ||
|
||
requires-python = ">=3.11" | ||
|
||
dependencies = [] | ||
|
||
[project.entry-points."fromager.project_overrides"] | ||
flit_core = "package_plugins.flit_core" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import logging | ||
|
||
from fromager import external_commands | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def build_wheel(ctx, build_env, extra_environ, req, sdist_root_dir): | ||
# flit_core is a basic build system dependency for several | ||
# packages. It is capable of building its own wheels, so we use the | ||
# bootstrapping instructions to do that and put the wheel in the | ||
# local server directory for reuse when building other packages via | ||
# 'pip wheel'. | ||
# | ||
# https://flit.pypa.io/en/stable/bootstrap.html | ||
logger.info('using override to build flit_core wheel in %s', sdist_root_dir) | ||
external_commands.run( | ||
[build_env.python, '-m', 'flit_core.wheel', | ||
'--outdir', ctx.wheels_build], | ||
cwd=sdist_root_dir, | ||
extra_environ=extra_environ, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/bin/bash | ||
# -*- indent-tabs-mode: nil; tab-width: 2; sh-indentation: 2; -*- | ||
|
||
# Tests full bootstrap and installation of a complex package, without | ||
# worrying about isolating the tools from upstream sources or | ||
# restricting network access during the build. This allows us to test | ||
# the overall logic of the build tools separately from the isolated | ||
# build pipelines. | ||
|
||
set -x | ||
set -e | ||
set -o pipefail | ||
|
||
OUTDIR="$(dirname "$SCRIPTDIR")/e2e-output" | ||
|
||
rm -rf "$OUTDIR" | ||
mkdir "$OUTDIR" | ||
|
||
tox -e e2e -n -r | ||
source .tox/e2e/bin/activate | ||
pip install e2e/flit_core_override | ||
|
||
fromager \ | ||
--log-file="$OUTDIR/bootstrap.log" \ | ||
--sdists-repo="$OUTDIR/sdists-repo" \ | ||
--wheels-repo="$OUTDIR/wheels-repo" \ | ||
--work-dir="$OUTDIR/work-dir" \ | ||
bootstrap 'flit_core==3.9.0' | ||
|
||
find "$OUTDIR/wheels-repo/simple/" -name '*.whl' | ||
|
||
# Default to passing | ||
pass=true | ||
|
||
# Check for log message | ||
if ! grep -q "using override to build flit_core wheel" "$OUTDIR/bootstrap.log"; then | ||
echo "FAIL: Did not find log message from override in $OUTDIR/bootstrap.log" 1>&2 | ||
pass=false | ||
fi | ||
|
||
# Check for output files | ||
EXPECTED_FILES=" | ||
wheels-repo/downloads/flit_core-3.9.0-py3-none-any.whl | ||
sdists-repo/downloads/flit_core-3.9.0.tar.gz | ||
" | ||
|
||
for f in $EXPECTED_FILES; do | ||
if [ ! -f "$OUTDIR/$f" ]; then | ||
echo "FAIL: Did not find $f" 1>&2 | ||
pass=false | ||
fi | ||
done | ||
$pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,9 @@ deps = . | |
commands = | ||
fromager {posargs} | ||
|
||
[testenv:e2e] | ||
deps = . | ||
|
||
[testenv:pkglint] | ||
deps= | ||
.[build] | ||
|