You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I was wondering if it's possible to include the size of the wheels or the sdists built by build in bytes/kilobytes, say, in the message that build displays after a successful invocation of the build command.
Motivation
It's usually difficult to ascertain what files I have been putting into the wheel with include_package_data or into the sdist with MANIFEST.in – perhaps I'm copying the wrong files or not putting compiled binaries into the wheel, in error
The other alternative to a build frontend that is currently available, i.e., pip wheel, does this and returns both the size and also the SHA-256 hash of the wheel
A workaround for now
To get through this and for further features (i.e, returning a recursive tree of the contents) – I am using https://github.com/hynek/build-and-inspect-python-package/ which uses the wheel unpack and the tar commands under the hood, but even that doesn't return the size of the sdist or the wheel, I need to compute that manually or through the file system implementation of the OS
Possible methods for implementation
The tarfile and the zipfile modules from the standard library are fairly usable and can provide an API for determining the size of a tarball or a .whl file. They can be imported in __main__.py and further used on artifact_list, which I suspect from an overview of the code, is a string containing the name of the files. It can be parsed to construct a Path for them, which zipfile and tarfile can use (unless there is a better way).
Footnotes
I am happy to do this and write a PR shall this end up being a valid suggestion; would appreciate some pointers if it does, thanks!
The text was updated successfully, but these errors were encountered:
Hi! I was wondering if it's possible to include the size of the wheels or the sdists built by
build
in bytes/kilobytes, say, in the message thatbuild
displays after a successful invocation of the build command.Motivation
include_package_data
or into the sdist withMANIFEST.in
– perhaps I'm copying the wrong files or not putting compiled binaries into the wheel, in errorpip wheel
, does this and returns both the size and also the SHA-256 hash of the wheelA workaround for now
To get through this and for further features (i.e, returning a recursive tree of the contents) – I am using https://github.com/hynek/build-and-inspect-python-package/ which uses the
wheel unpack
and thetar
commands under the hood, but even that doesn't return the size of the sdist or the wheel, I need to compute that manually or through the file system implementation of the OSPossible methods for implementation
The
tarfile
and thezipfile
modules from the standard library are fairly usable and can provide an API for determining the size of a tarball or a.whl
file. They can be imported in__main__.py
and further used onartifact_list
, which I suspect from an overview of the code, is a string containing the name of the files. It can be parsed to construct aPath
for them, whichzipfile
andtarfile
can use (unless there is a better way).Footnotes
I am happy to do this and write a PR shall this end up being a valid suggestion; would appreciate some pointers if it does, thanks!
The text was updated successfully, but these errors were encountered: