Skip to content

Bug Fix/Bump PyYAML to 6.0.1

What does this MR do and why?

Bump required version of PyYAML to 6.0.1. Resolved error reported on ticket when trying to install PyYAML to a new Venv.

Below error reported and replicated on Ubuntu 22.04. Also tested on Debian 12 with same error. Not tested on other distros.

Collecting PyYAML==5.4 (from -r requirements.txt (line 15))
  Downloading PyYAML-5.4.tar.gz (174 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 174.8/174.8 kB 93.5 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
exit code: 1
  ╰─> [62 lines of output]
      /tmp/pip-build-env-0pr1e1lk/overlay/lib/python3.10/site-packages/setuptools/config/setupcfg.py:293: _DeprecatedConfig: Deprecated config in `setup.cfg`
      !!

              ********************************************************************************
              The license_file parameter is deprecated, use license_files instead.

              By 2023-Oct-30, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.

              See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
              ********************************************************************************

      !!
        parsed = self.parsers.get(option_name, lambda x: x)(value)
      running egg_info
      writing lib3/PyYAML.egg-info/PKG-INFO
      writing dependency_links to lib3/PyYAML.egg-info/dependency_links.txt
      writing top-level names to lib3/PyYAML.egg-info/top_level.txt
      Traceback (most recent call last):
        File "/var/opt/minecraft/crafty/venv/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/var/opt/minecraft/crafty/venv/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/var/opt/minecraft/crafty/venv/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/tmp/pip-build-env-0pr1e1lk/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "/tmp/pip-build-env-0pr1e1lk/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-0pr1e1lk/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line 271, in <module>
        File "/tmp/pip-build-env-0pr1e1lk/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 107, in setup
          return distutils.core.setup(**attrs)
        File "/tmp/pip-build-env-0pr1e1lk/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
        File "/tmp/pip-build-env-0pr1e1lk/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/tmp/pip-build-env-0pr1e1lk/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/tmp/pip-build-env-0pr1e1lk/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-0pr1e1lk/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-0pr1e1lk/overlay/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 314, in run
          self.find_sources()
        File "/tmp/pip-build-env-0pr1e1lk/overlay/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 322, in find_sources
          mm.run()
        File "/tmp/pip-build-env-0pr1e1lk/overlay/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 551, in run
          self.add_defaults()
        File "/tmp/pip-build-env-0pr1e1lk/overlay/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 589, in add_defaults
          sdist.add_defaults(self)
        File "/tmp/pip-build-env-0pr1e1lk/overlay/lib/python3.10/site-packages/setuptools/command/sdist.py", line 104, in add_defaults
          super().add_defaults()
        File "/tmp/pip-build-env-0pr1e1lk/overlay/lib/python3.10/site-packages/setuptools/_distutils/command/sdist.py", line 251, in add_defaults
          self._add_defaults_ext()
        File "/tmp/pip-build-env-0pr1e1lk/overlay/lib/python3.10/site-packages/setuptools/_distutils/command/sdist.py", line 336, in _add_defaults_ext
          self.filelist.extend(build_ext.get_source_files())
        File "<string>", line 201, in get_source_files
        File "/tmp/pip-build-env-0pr1e1lk/overlay/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 107, in __getattr__
          raise AttributeError(attr)
      AttributeError: cython_sources
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Screenshots or screen recordings

Log of install working with PyYAML 6.0.1 on Debian 11 (EC2 IP redacted): Also tested on an Ubuntu 22.04 instance.

(.venv) crafty@ip-***-***-***-***:/var/opt/minecraft/crafty/crafty-4$ pip3 install --no-cache-dir -r requirements.txt
Collecting apscheduler==3.8.1
  Downloading APScheduler-3.8.1-py2.py3-none-any.whl (59 kB)
     |████████████████████████████████| 59 kB 6.1 MB/s
Collecting argon2-cffi==21.3
  Downloading argon2_cffi-21.3.0-py3-none-any.whl (14 kB)
Collecting bleach==4.1
  Downloading bleach-4.1.0-py2.py3-none-any.whl (157 kB)
     |████████████████████████████████| 157 kB 5.7 MB/s
Collecting cached_property==1.5.2
  Downloading cached_property-1.5.2-py2.py3-none-any.whl (7.6 kB)
Collecting colorama==0.4
  Downloading colorama-0.4.0-py2.py3-none-any.whl (21 kB)
Collecting croniter==1.3.5
  Downloading croniter-1.3.5-py2.py3-none-any.whl (17 kB)
Collecting cryptography==41.0.1
  Downloading cryptography-41.0.1-cp37-abi3-manylinux_2_28_x86_64.whl (4.3 MB)
     |████████████████████████████████| 4.3 MB 43.9 MB/s
Collecting libgravatar==1.0.0
  Downloading libgravatar-1.0.0-py2.py3-none-any.whl (17 kB)
Collecting peewee==3.13
  Downloading peewee-3.13.0.tar.gz (2.3 MB)
     |████████████████████████████████| 2.3 MB 28.4 MB/s
Collecting pexpect==4.8
  Downloading pexpect-4.8.0-py2.py3-none-any.whl (59 kB)
     |████████████████████████████████| 59 kB 34.5 MB/s
Collecting psutil==5.9
  Downloading psutil-5.9.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (280 kB)
     |████████████████████████████████| 280 kB 38.7 MB/s
Collecting pyOpenSSL==23.2.0
  Downloading pyOpenSSL-23.2.0-py3-none-any.whl (59 kB)
     |████████████████████████████████| 59 kB 36.3 MB/s
Collecting pyjwt==2.4.0
  Downloading PyJWT-2.4.0-py3-none-any.whl (18 kB)
Collecting PyYAML==6.0.1
  Downloading PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (738 kB)
     |████████████████████████████████| 738 kB 28.7 MB/s
Collecting requests==2.31
  Downloading requests-2.31.0-py3-none-any.whl (62 kB)
     |████████████████████████████████| 62 kB 20.0 MB/s
Collecting termcolor==1.1
  Downloading termcolor-1.1.0.tar.gz (3.9 kB)
Collecting tornado==6.3.2
  Downloading tornado-6.3.2-cp38-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (426 kB)
     |████████████████████████████████| 426 kB 37.6 MB/s
Collecting tzlocal==4.0
  Downloading tzlocal-4.0-py3-none-any.whl (19 kB)
Collecting jsonschema==4.5.1
  Downloading jsonschema-4.5.1-py3-none-any.whl (72 kB)
     |████████████████████████████████| 72 kB 21.2 MB/s
Collecting orjson==3.8.12
  Downloading orjson-3.8.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (137 kB)
     |████████████████████████████████| 137 kB 41.5 MB/s
Requirement already satisfied: setuptools>=0.7 in /var/opt/minecraft/crafty/.venv/lib/python3.9/site-packages (from apscheduler==3.8.1->-r requirements.txt (line 2)) (44.1.1)
Collecting pytz
  Downloading pytz-2023.3-py2.py3-none-any.whl (502 kB)
     |████████████████████████████████| 502 kB 40.2 MB/s
Collecting six>=1.4.0
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting argon2-cffi-bindings
  Downloading argon2_cffi_bindings-21.2.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (86 kB)
     |████████████████████████████████| 86 kB 34.1 MB/s
Collecting webencodings
  Downloading webencodings-0.5.1-py2.py3-none-any.whl (11 kB)
Collecting packaging
  Downloading packaging-23.1-py3-none-any.whl (48 kB)
     |████████████████████████████████| 48 kB 35.3 MB/s
Collecting python-dateutil
  Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
     |████████████████████████████████| 247 kB 40.4 MB/s
Collecting cffi>=1.12
  Downloading cffi-1.15.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (441 kB)
     |████████████████████████████████| 441 kB 40.5 MB/s
Collecting pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0
  Downloading pyrsistent-0.19.3-py3-none-any.whl (57 kB)
     |████████████████████████████████| 57 kB 34.2 MB/s
Collecting attrs>=17.4.0
  Downloading attrs-23.1.0-py3-none-any.whl (61 kB)
     |████████████████████████████████| 61 kB 38.2 MB/s
Collecting ptyprocess>=0.5
  Downloading ptyprocess-0.7.0-py2.py3-none-any.whl (13 kB)
Collecting charset-normalizer<4,>=2
  Downloading charset_normalizer-3.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (202 kB)
     |████████████████████████████████| 202 kB 44.5 MB/s
Collecting idna<4,>=2.5
  Downloading idna-3.4-py3-none-any.whl (61 kB)
     |████████████████████████████████| 61 kB 2.9 MB/s
Collecting urllib3<3,>=1.21.1
  Downloading urllib3-2.0.3-py3-none-any.whl (123 kB)
     |████████████████████████████████| 123 kB 39.4 MB/s
Collecting certifi>=2017.4.17
  Downloading certifi-2023.5.7-py3-none-any.whl (156 kB)
     |████████████████████████████████| 156 kB 40.8 MB/s
Collecting pytz-deprecation-shim
  Downloading pytz_deprecation_shim-0.1.0.post0-py2.py3-none-any.whl (15 kB)
Collecting pycparser
  Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB)
     |████████████████████████████████| 118 kB 40.6 MB/s
Collecting tzdata
  Downloading tzdata-2023.3-py2.py3-none-any.whl (341 kB)
     |████████████████████████████████| 341 kB 40.3 MB/s
Using legacy 'setup.py install' for peewee, since package 'wheel' is not installed.
Using legacy 'setup.py install' for termcolor, since package 'wheel' is not installed.
Installing collected packages: tzdata, pycparser, six, pytz-deprecation-shim, cffi, webencodings, urllib3, tzlocal, pytz, python-dateutil, pyrsistent, ptyprocess, packaging, idna, cryptography, charset-normalizer, certifi, attrs, argon2-cffi-bindings, tornado, termcolor, requests, PyYAML, pyOpenSSL, pyjwt, psutil, pexpect, peewee, orjson, libgravatar, jsonschema, croniter, colorama, cached-property, bleach, argon2-cffi, apscheduler
    Running setup.py install for termcolor ... done
    Running setup.py install for peewee ... done
Successfully installed PyYAML-6.0.1 apscheduler-3.8.1 argon2-cffi-21.3.0 argon2-cffi-bindings-21.2.0 attrs-23.1.0 bleach-4.1.0 cached-property-1.5.2 certifi-2023.5.7 cffi-1.15.1 charset-normalizer-3.2.0 colorama-0.4.0 croniter-1.3.5 cryptography-41.0.1 idna-3.4 jsonschema-4.5.1 libgravatar-1.0.0 orjson-3.8.12 packaging-23.1 peewee-3.13.0 pexpect-4.8.0 psutil-5.9.0 ptyprocess-0.7.0 pyOpenSSL-23.2.0 pycparser-2.21 pyjwt-2.4.0 pyrsistent-0.19.3 python-dateutil-2.8.2 pytz-2023.3 pytz-deprecation-shim-0.1.0.post0 requests-2.31.0 six-1.16.0 termcolor-1.1.0 tornado-6.3.2 tzdata-2023.3 tzlocal-4.0 urllib3-2.0.3 webencodings-0.5.1
(.venv) crafty@ip-***-***-***-***:/var/opt/minecraft/crafty/crafty-4$ python3 main.py
Logging set to: 0

    ///////////////////////////////////////////////////////////////////////////
    #                  Welcome to Crafty Controller - v.4.1.2                 #
    ///////////////////////////////////////////////////////////////////////////
    #          Server Manager / Web Portal for your Minecraft server          #
    #                     Homepage: www.craftycontrol.com                     #
    ///////////////////////////////////////////////////////////////////////////

[+] Crafty: 07/18/23 00:57:21 - INFO:   Starting migrations
0
[+] Crafty: 07/18/23 00:57:21 - WARNING:        We have detected a fresh install. Please be sure to forward Crafty's port, 8443, through your router/firewall if you would like to be able to access Crafty remotely.
[+] Crafty: 07/18/23 00:57:21 - INFO:   Fresh Install Detected - Creating Default Settings
[+] Crafty: 07/18/23 00:57:22 - INFO:   Checking for reset secret flag
[+] Crafty: 07/18/23 00:57:22 - INFO:   No flag found. Secrets are staying
[+] Crafty: 07/18/23 00:57:22 - INFO:   Checking for remote changes to config.json
[+] Crafty: 07/18/23 00:57:22 - INFO:   Remote change complete.
[+] Crafty: 07/18/23 00:57:22 - INFO:   Initializing all servers defined
[+] Crafty: 07/18/23 00:57:22 - INFO:   Generating a self signed SSL
[+] Crafty: 07/18/23 00:57:22 - INFO:   Generating a key pair. This might take a moment.

[+] Crafty: 07/18/23 00:57:22 - INFO:   Setting up Crafty's internal components...
[+] Crafty: 07/18/23 00:57:22 - INFO:   Stats collection frequency set to 30 seconds

[+] Crafty: 07/18/23 00:57:22 - INFO:   Checking Internet. This may take a minute.
[+] Crafty: 07/18/23 00:57:23 - INFO:   Launching Scheduler Thread...
[+] Crafty: 07/18/23 00:57:23 - INFO:   Launching command thread...
[+] Crafty: 07/18/23 00:57:23 - INFO:   Launching log watcher...
[+] Crafty: 07/18/23 00:57:23 - INFO:   Launching realtime thread...
[+] Crafty: 07/18/23 00:57:23 - INFO:   https://***.***.***.***:8443 is up and ready for connections.
[+] Crafty: 07/18/23 00:57:23 - INFO:   Server Init Complete: Listening For Connections!
[+] Crafty: 07/18/23 00:57:35 - INFO:   Crafty has fully started and is now ready for use!
Crafty Controller v4.1.2 >

How to set up and validate locally

Attempt a new install with master you will see the above listed error. Bumping PyYAML should resolve the issue.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

  • Have you checked this doesn't interfere/conflict/duplicate someone elses work?
  • Have you fully tested your changes?
  • Have you resolved any lint issues?
  • Have you assigned a reviewer?
  • Have you applied correct labels?
Edited by Iain Powrie

Merge request reports

Loading