mirror of https://github.com/pypa/pip
🎨 Copy and log built dists explicitly
This commit is contained in:
parent
6f1a43e4b2
commit
9d592b394a
18
noxfile.py
18
noxfile.py
|
@ -210,15 +210,18 @@ def build_release(session):
|
||||||
f"temporary Git checkout at {build_dir!s}",
|
f"temporary Git checkout at {build_dir!s}",
|
||||||
)
|
)
|
||||||
with release.workdir(session, build_dir):
|
with release.workdir(session, build_dir):
|
||||||
build_dists(session)
|
tmp_dists = build_dists(session)
|
||||||
|
|
||||||
tmp_dist_dir = build_dir / 'dist'
|
tmp_dist_paths = (build_dir / p for p in tmp_dists)
|
||||||
session.log(f"# Copying dists from {tmp_dist_dir}")
|
session.log(f"# Copying dists from {build_dir}")
|
||||||
shutil.rmtree('dist', ignore_errors=True) # remove empty `dist/`
|
shutil.rmtree('dist', ignore_errors=True) # remove empty `dist/`
|
||||||
shutil.copytree(tmp_dist_dir, 'dist')
|
for dist in tmp_dist_paths:
|
||||||
|
session.log(f"# Copying {dist}")
|
||||||
|
shutil.copy(dist, 'dist')
|
||||||
|
|
||||||
|
|
||||||
def build_dists(session):
|
def build_dists(session):
|
||||||
|
"""Return dists with valid metadata."""
|
||||||
session.log(
|
session.log(
|
||||||
"# Check if there's any Git-untracked files before building the wheel",
|
"# Check if there's any Git-untracked files before building the wheel",
|
||||||
)
|
)
|
||||||
|
@ -251,9 +254,12 @@ def build_dists(session):
|
||||||
|
|
||||||
session.log("# Build distributions")
|
session.log("# Build distributions")
|
||||||
session.run("python", "setup.py", "sdist", "bdist_wheel", silent=True)
|
session.run("python", "setup.py", "sdist", "bdist_wheel", silent=True)
|
||||||
|
produced_dists = glob.glob("dist/*")
|
||||||
|
|
||||||
session.log("# Verify distributions")
|
session.log(f"# Verify distributions: {', '.join(produced_dists)}")
|
||||||
session.run("twine", "check", *glob.glob("dist/*"), silent=True)
|
session.run("twine", "check", *produced_dists, silent=True)
|
||||||
|
|
||||||
|
return produced_dists
|
||||||
|
|
||||||
|
|
||||||
@nox.session(name="upload-release")
|
@nox.session(name="upload-release")
|
||||||
|
|
Loading…
Reference in New Issue