ietf-tools / xml2rfc

Generate RFCs and IETF drafts from document source in XML according to the IETF xml2rfc v2 and v3 vocabularies
https://ietf-tools.github.io/xml2rfc/
BSD 3-Clause "New" or "Revised" License
69 stars 38 forks source link

Github workflow installation fails #991

Closed markusa closed 1 year ago

markusa commented 1 year ago

Describe the issue

I use github workflow to install xml2rfcand convert Markdown to RFC style. Since xml2rfcversion 13.17.1 this process fails with the following errors:

Run sudo pip install xml2rfc

Collecting xml2rfc
  Downloading xml2rfc-3.17.1.tar.gz (2.6 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.6/2.6 MB 39.7 MB/s eta 0:00:00
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'error'
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [51 lines of output]
      Traceback (most recent call last):
        File "/usr/lib/python3/dist-packages/pkg_resources/_vendor/packaging/requirements.py", line 102, in __init__
          req = REQUIREMENT.parseString(requirement_string)
        File "/usr/lib/python3/dist-packages/pkg_resources/_vendor/pyparsing.py", line 1654, in parseString
          raise exc
        File "/usr/lib/python3/dist-packages/pkg_resources/_vendor/pyparsing.py", line 1644, in parseString
          loc, tokens = self._parse( instring, 0 )
        File "/usr/lib/python3/dist-packages/pkg_resources/_vendor/pyparsing.py", line 1402, in _parseNoCache
          loc,tokens = self.parseImpl( instring, preloc, doActions )
        File "/usr/lib/python3/dist-packages/pkg_resources/_vendor/pyparsing.py", line 3417, in parseImpl
          loc, exprtokens = e._parse( instring, loc, doActions )
        File "/usr/lib/python3/dist-packages/pkg_resources/_vendor/pyparsing.py", line 1406, in _parseNoCache
          loc,tokens = self.parseImpl( instring, preloc, doActions )
        File "/usr/lib/python3/dist-packages/pkg_resources/_vendor/pyparsing.py", line 3205, in parseImpl
          raise ParseException(instring, loc, self.errmsg, self)
      pkg_resources._vendor.pyparsing.ParseException: Expected stringEnd (at char 4), (line:1, col:5)

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 162, in get_requires_for_build_wheel
          return self._get_build_requires(
        File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 143, in _get_build_requires
          self.run_setup()
        File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 158, in run_setup
          exec(compile(code, __file__, 'exec'), locals())
        File "setup.py", line 3, in <module>
          setup(
        File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 152, in setup
          _install_setup_requires(attrs)
        File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 145, in _install_setup_requires
          dist.parse_config_files(ignore_option_errors=True)
        File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 807, in parse_config_files
          self._finalize_requires()
        File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 534, in _finalize_requires
          self._move_install_requirements_markers()
        File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 573, in _move_install_requirements_markers
          inst_reqs = list(pkg_resources.parse_requirements(spec_inst_reqs))
        File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3099, in parse_requirements
          yield Requirement(line)
        File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3109, in __init__
          super(Requirement, self).__init__(requirement_string)
        File "/usr/lib/python3/dist-packages/pkg_resources/_vendor/packaging/requirements.py", line 104, in __init__
          raise InvalidRequirement(
      pkg_resources.extern.packaging.requirements.InvalidRequirement: Parse error at "': requir'": Expected stringEnd
      [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.
Error: Process completed with exit code 1.

A minimal github workflow YAML example to provoke this behavior is as follows:

name: markdown-to-rfc
on: [push]
jobs:
  make-rfc:
    runs-on: ubuntu-latest
    steps:
      - name: "Checkout"
        uses: actions/checkout@v3

      - name: "Setup Python"
        uses: actions/setup-python@v4
        with:
          python-version: '3.11'

      - run: sudo pip install xml2rfc

As soon as I force the workflow process to use xml2rfc version 13.17.0, the installation is successful again: sudo pip install xml2rfc==3.17.0

Any ideas?

Code of Conduct

markusa commented 1 year ago

Might also be related to #982

kesara commented 1 year ago

@markusa Can you provide the pip version?

pip install --upgrade pip

might help.

markusa commented 1 year ago

I also tried this and specified in addition the newer python version 3.11, see below:

name: markdown-to-rfc
on: [push]
jobs:
  make-rfc:
    runs-on: ubuntu-latest
    steps:
      - name: "Setup Python"
        uses: actions/setup-python@v4
        with:
          python-version: '3.11'

      - name: Install dependencies
        run: python -m pip install --upgrade pip setuptools wheel twine build

      - run: sudo pip install xml2rfc

This workflow YAML downloads pip-23.1.2-py3-none-any.whl but finaly does not change the error pattern as shown in the first post.

kesara commented 1 year ago

@markusa, looks like using sudo pip is the issue here. I think sudo pip uses a pip version provided by the OS. While python -m pip install --upgrade pip setuptools wheel twine build upgrades/install a different module.

python -m pip install xml2rfc

Seems to be working. Ref:

markusa commented 1 year ago

Thank you, that solved the problem. Without sudo it also doesn't need python -m pip install --upgrade pip setuptools wheel twine build. I cannot remember why I decided to add sudo when I created the
YAML :roll_eyes:.

Full working example:

name: markdown-to-rfc
on: [push]
jobs:
  make-rfc:
    runs-on: ubuntu-latest
    steps:
      - name: "Checkout"
        uses: actions/checkout@v3

      - name: "Setup Python"
        uses: actions/setup-python@v4
        with:
          python-version: '3.11'

      - run: pip install xml2rfc