Skip to content

Unable to build xmlsec version 1.3.15 #347

Description

@Shiva106

We are trying to build xmlsec using this command python3 setup.py install bdist --format=tar
we are getting following error

  File "/root/xml_1.3.15/python-xmlsec-1.3.15/setup.py", line 597, in <module>
    setup(
  File "/usr/local/lib/python3.11/dist-packages/setuptools/__init__.py", line 117, in setup
    return distutils.core.setup(**attrs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/setuptools/_distutils/core.py", line 148, in setup
    _setup_distribution = dist = klass(attrs)
                                 ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/setuptools/dist.py", line 323, in __init__
    _Distribution.__init__(self, dist_attrs)
  File "/usr/local/lib/python3.11/dist-packages/setuptools/_distutils/dist.py", line 309, in __init__
    self.finalize_options()
  File "/usr/local/lib/python3.11/dist-packages/setuptools/dist.py", line 786, in finalize_options
    ep(self)
  File "/usr/local/lib/python3.11/dist-packages/setuptools/dist.py", line 806, in _finalize_setup_keywords
    ep.load()(self, ep.name, value)
  File "/usr/local/lib/python3.11/dist-packages/setuptools_scm/_integration/setuptools.py", line 103, in version_keyword
    _assign_version(dist, config)
  File "/usr/local/lib/python3.11/dist-packages/setuptools_scm/_integration/setuptools.py", line 58, in _assign_version
    _version_missing(config)
  File "/usr/local/lib/python3.11/dist-packages/setuptools_scm/_get_version_impl.py", line 117, in _version_missing
    raise LookupError(
LookupError: setuptools-scm was unable to detect version for /root/xml_1.3.15/python-xmlsec-1.3.15.

Following are the steps we used to build the xmlsec

  1. wget https://github.com/xmlsec/python-xmlsec/archive/refs/tags/1.3.15.tar.gz
  2. tar -xvf 1.3.15.tar.gz
  3. cd python-xmlsec-1.3.15/
  4. python3 setup.py install bdist --format=tar

Following are the output which we got

!!

        ********************************************************************************
        Requirements should be satisfied by a PEP 517 installer.
        If you are using pip, you can try `pip install --use-pep517`.
        ********************************************************************************

!!
  dist.fetch_build_eggs(dist.setup_requires)
[04/04/25 06:02:46] WARNING  toml section missing 'pyproject.toml does not contain a                   pyproject_reading.py:42
                             tool.setuptools_scm section'
                             Traceback (most recent call last):
                               File
                             "/usr/local/lib/python3.11/dist-packages/setuptools_scm/_integration/pypr
                             oject_reading.py", line 36, in read_pyproject
                                 section = defn.get("tool", {})[tool_name]
                                           ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
                             KeyError: 'setuptools_scm'
Traceback (most recent call last):
  File "/root/xml_1.3.15/python-xmlsec-1.3.15/setup.py", line 597, in <module>
    setup(
  File "/usr/local/lib/python3.11/dist-packages/setuptools/__init__.py", line 117, in setup
    return distutils.core.setup(**attrs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/setuptools/_distutils/core.py", line 148, in setup
    _setup_distribution = dist = klass(attrs)
                                 ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/setuptools/dist.py", line 323, in __init__
    _Distribution.__init__(self, dist_attrs)
  File "/usr/local/lib/python3.11/dist-packages/setuptools/_distutils/dist.py", line 309, in __init__
    self.finalize_options()
  File "/usr/local/lib/python3.11/dist-packages/setuptools/dist.py", line 786, in finalize_options
    ep(self)
  File "/usr/local/lib/python3.11/dist-packages/setuptools/dist.py", line 806, in _finalize_setup_keywords
    ep.load()(self, ep.name, value)
  File "/usr/local/lib/python3.11/dist-packages/setuptools_scm/_integration/setuptools.py", line 103, in version_keyword
    _assign_version(dist, config)
  File "/usr/local/lib/python3.11/dist-packages/setuptools_scm/_integration/setuptools.py", line 58, in _assign_version
    _version_missing(config)
  File "/usr/local/lib/python3.11/dist-packages/setuptools_scm/_get_version_impl.py", line 117, in _version_missing
    raise LookupError(
LookupError: setuptools-scm was unable to detect version for /root/xml_1.3.15/python-xmlsec-1.3.15.

Make sure you're either building from a fully intact git repository or PyPI tarballs. Most other sources (such as GitHub's tarballs, a git checkout without the .git folder) don't contain the necessary metadata and will not work.

For example, if you're using pip, instead of https://github.com/user/proj/archive/master.zip use git+https://github.com/user/proj.git#egg=proj

Alternatively, set the version with the environment variable SETUPTOOLS_SCM_PRETEND_VERSION_FOR_${NORMALIZED_DIST_NAME} as described in https://setuptools-scm.readthedocs.io/en/latest/config.

NOTE : Above steps were working fine with Master branch when we clone the repo.

Build Machine Details :
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

When can we expect fixed version in 1.3.15 or when will the 1.3.16 tar will be released ?

Activity

  1. TomiBelan commented on Jul 7, 2025

    @TomiBelan
    Contributor

    Instead of downloading the tarball from archive/refs/tags/, a) use another tool (pip, uv, ...) to install xmlsec==1.3.15 and let it handle the whole build process, or b) clone this repo with git and checkout the tag you want, or c) download the sdist (tar.gz file) from https://pypi.org/project/xmlsec/, or d) wait for #353.

  2. mxamin commented on Jul 10, 2025

    @mxamin
    Collaborator

    The new release is out which include wheels for common platforms. I guess that should solve this issue for you. Remember that the new version 1.3.16 is only compatible with lxml 6.0.0.

  3. nijel commented on Aug 6, 2025

    @nijel

    The similar error now happened now when installing from pip:

       × Failed to build `xmlsec==1.3.16`
      ├─▶ The build backend returned an error
      ╰─▶ Call to `setuptools.build_meta:__legacy__.build_wheel` failed (exit
          status: 1)
    
          [stderr]
          toml section missing 'pyproject.toml does not contain a
          tool.setuptools_scm section'
          Traceback (most recent call last):
            File
          "/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmp8KXbpA/lib/python3.13/site-packages/setuptools_scm/_integration/pyproject_reading.py",
          line 71, in read_pyproject
              section = defn.get("tool", {})[tool_name]
                        ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
          KeyError: 'setuptools_scm'
          Traceback (most recent call last):
            File "<string>", line 11, in <module>
              wheel_filename =
          backend.build_wheel("/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmpMTGrp1",
          {}, None)
            File
          "/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmp8KXbpA/lib/python3.13/site-packages/setuptools/build_meta.py",
          line 432, in build_wheel
              return _build(['bdist_wheel'])
            File
          "/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmp8KXbpA/lib/python3.13/site-packages/setuptools/build_meta.py",
          line 423, in _build
              return self._build_with_temp_dir(
                     ~~~~~~~~~~~~~~~~~~~~~~~~~^
                  cmd,
                  ^^^^
              ...<3 lines>...
                  self._arbitrary_args(config_settings),
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
              )
              ^
            File
          "/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmp8KXbpA/lib/python3.13/site-packages/setuptools/build_meta.py",
          line 404, in _build_with_temp_dir
              self.run_setup()
              ~~~~~~~~~~~~~~^^
            File
          "/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmp8KXbpA/lib/python3.13/site-packages/setuptools/build_meta.py",
          line 512, in run_setup
              super().run_setup(setup_script=setup_script)
              ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File
          "/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmp8KXbpA/lib/python3.13/site-packages/setuptools/build_meta.py",
          line 317, in run_setup
              exec(code, locals())
              ~~~~^^^^^^^^^^^^^^^^
            File "<string>", line 591, in <module>
            File
          "/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmp8KXbpA/lib/python3.13/site-packages/setuptools/__init__.py",
          line 115, in setup
              return distutils.core.setup(**attrs)
                     ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
            File
          "/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmp8KXbpA/lib/python3.13/site-packages/setuptools/_distutils/core.py",
          line 148, in setup
              _setup_distribution = dist = klass(attrs)
                                           ~~~~~^^^^^^^
            File
          "/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmp8KXbpA/lib/python3.13/site-packages/setuptools/dist.py",
          line 321, in __init__
              _Distribution.__init__(self, dist_attrs)
              ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
            File
          "/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmp8KXbpA/lib/python3.13/site-packages/setuptools/_distutils/dist.py",
          line 309, in __init__
              self.finalize_options()
              ~~~~~~~~~~~~~~~~~~~~~^^
            File
          "/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmp8KXbpA/lib/python3.13/site-packages/setuptools/dist.py",
          line 784, in finalize_options
              ep(self)
              ~~^^^^^^
            File
          "/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmp8KXbpA/lib/python3.13/site-packages/setuptools/dist.py",
          line 804, in _finalize_setup_keywords
              ep.load()(self, ep.name, value)
              ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
            File
          "/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmp8KXbpA/lib/python3.13/site-packages/setuptools_scm/_integration/setuptools.py",
          line 131, in version_keyword
              config = _config.Configuration.from_file(
                  dist_name=dist_name,
              ...<2 lines>...
                  **overrides,
              )
            File
          "/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmp8KXbpA/lib/python3.13/site-packages/setuptools_scm/_config.py",
          line 296, in from_file
              pyproject_data = _read_pyproject(
                  Path(name), missing_section_ok=missing_section_ok
              )
            File
          "/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmp8KXbpA/lib/python3.13/site-packages/setuptools_scm/_integration/pyproject_reading.py",
          line 95, in read_pyproject
              pyproject_data.verify_dynamic_version_when_required()
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
            File
          "/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmp8KXbpA/lib/python3.13/site-packages/setuptools_scm/_integration/pyproject_reading.py",
          line 38, in verify_dynamic_version_when_required
              raise ValueError(
              ...<3 lines>...
              )
          ValueError: pyproject.toml: setuptools-scm is present in
          [build-system].requires but dynamic=['version'] is not set in
          [project]. Either add dynamic=['version'] to [project] or add a
          [tool.setuptools_scm] section.
    
          hint: This usually indicates a problem with the package or the build
          environment.
    

    It works now because setuptools-scm 9.x releases were yanked (see pypa/setuptools-scm#1191), but posting here so that you are aware of this as well.

  4. mxamin commented on Aug 6, 2025

    @mxamin
    Collaborator

    Thanks for the info, I'm aware of that and following the story to see if we need to comply or not. See #366

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions