Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/+built-sdist-import-check.infrastructure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add a build-time smoke test that installs the freshly built source distribution and imports the public API shims.
9 changes: 9 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ def cover(session):
@nox.session(python=PYTHON_DEFAULT_VERSION)
def build(session):
"""Build the distribution."""
session.run('rm', '-rf', 'build', 'dist', external=True)
session.run('uv', 'build', external=True)

# Set outputs for GitHub Actions
Expand All @@ -190,6 +191,14 @@ def build(session):
version = os.environ['GITHUB_REF'].replace('refs/tags/v', '')
print(f'version={version}', file=github_output)

sdists = sorted(pathlib.Path('dist').glob('b2sdk-*.tar.gz'))
if len(sdists) != 1:
session.error(f'Expected exactly one source distribution, found {len(sdists)}: {sdists!r}')

session.install(str(sdists[0]))
session.cd('dist') # avoid importing from the checkout instead of the built package
session.run('python', '-c', 'from b2sdk import v0, v1, v2, v3')
Comment thread
ppolewicz marked this conversation as resolved.
Outdated


@nox.session(python=PYTHON_DEFAULT_VERSION)
def doc(session):
Expand Down
Loading