LudovicRousseau / pyscard

pyscard smartcard library for python
http://pyscard.sourceforge.net/
GNU Lesser General Public License v2.1
377 stars 108 forks source link

Windows EXE and MSI missing for Python 3.10 in collected artifacts #149

Closed bittner closed 1 year ago

bittner commented 1 year ago

Your GitHub Actions workflow for Windows builds Python eggs, wheels and Windows EXE and MSI files for all targeted Python versions. The artifacts can be downloaded from the bottom of the few recent Windows Build jobs ("Artifacts" box).

However, it looks like that for Python 3.10 no EXE and MSI installers are built and uploaded. This is a screenshot of the content of an archive downloaded from the current recent Windows Build job.

image

It looks like the setuptools commands bdist_wininst and bdist_msi don't exist anymore. They might have been removed in the version that runs on Python 3.10:

usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: invalid command 'bdist_wininst'
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: invalid command 'bdist_msi'

Other than that, I can see from the Python 3.10 build job there are a lot of ValueErrors related to logging, which are not present in the build job for Python 3.9, though this is likely not related.

--- Logging error ---
Traceback (most recent call last):
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\logging\__init__.py", line 1103, in emit
    stream.write(msg + self.terminator)
ValueError: underlying buffer has been detached
Call stack:
  File "D:\a\pyscard\pyscard\setup.py", line 152, in <module>
    setup(**kw)
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\setuptools\__init__.py", line 87, in setup
    return distutils.core.setup(**attrs)
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
    return run_commands(dist)
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
    dist.run_commands()
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\setuptools\_distutils\dist.py", line 968, in run_commands
    self.run_command(cmd)
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\setuptools\dist.py", line 1217, in run_command
    super().run_command(command)
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command
    cmd_obj.run()
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\wheel\bdist_wheel.py", line 387, in run
    wf.write_files(archive_root)
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\wheel\wheelfile.py", line 137, in write_files
    self.write(path, arcname)
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\wheel\wheelfile.py", line 153, in write
    self.writestr(zinfo, data, compress_type)
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\wheel\wheelfile.py", line 165, in writestr
    log.info(f"adding '{fname}'")
Message: "adding 'smartcard/wx/SimpleSCardAppEventObserver.py'"
Arguments: ()
bittner commented 1 year ago

Related: https://github.com/pypa/build/issues/582

bittner commented 1 year ago

The feature was removed with setuptools 65.0.0, hence forcing to install setuptools<65.0.0 in the GHA build might remediate the issue for some time.

LudovicRousseau commented 1 year ago

As indicated in https://github.com/pypa/build/issues/582: "The suggestion is to not build those. Use wheels."