That is consistent with my understanding of the setuptools API. It is normal to call ensure_finalized.
On Tue, Mar 5, 2019, 11:40 <epeter...@interactivebrokers.com> wrote: > Hi all, > > I have a use case where I would like to be able to discover the name that > a wheel will be given without actually building the wheel first. So if I > had a source directory like this: > > src/ > my_package/ > setup.py > > Here my_package is the Python package that I will be putting in my wheel > and setup.py describes how to do that and the metadata associated with it. > > What we have discovered so far is that this recipe seems to do the trick: > > import distutils.core > from wheel import bdist_wheel > > dist = distutils.core.run_setup('setup.py') > bw = bdist_wheel.bdisdt_wheel(dist) > bw.ensure_finalized() > bw.get_archive_basename() > > > The output of that last command is something like > 'my_package-0.1-py2.py3-none-any', which is what I need (along with the > ".whl" extension, of course). > > My concern is that it feels like we're using some private APIs here, e.g., > having to call ensure_finalized(). Is this the right way to be doing this? > > Thanks, > Eric >