Skip to content

Fix building from archived source code without .git #50

@C0rn3j

Description

@C0rn3j

@git-developer Integrating setuptools-scm in #30 broke this.

We could disable the Assets generating the source builds and make everyone clone from git, but:

We could simply also hardcode a "unknown version from tarball" string or otherwise hardcode some version, but that might make supporting it a nightmare, it would break the daemon vs sc-controller version mismatch detection and possibly confuse the users too.

What we could do that'd possibly be a good solution is have the CI commit the calculated git version to the repo automatically?
But I am unsure how to do it in a way which would actually be up to date and not current version - 1.

I am blanking out on any other good solutions.

[0] % ./run.sh       
* Creating isolated environment: venv+pip...
* Installing packages in isolated environment:
  - setuptools-scm>=8.0
  - setuptools>=60
  - wheel
* Getting build dependencies for wheel...
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 373, in <module>
    main()
  File "/usr/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 357, in main
    json_out["return_val"] = hook(**hook_input["kwargs"])
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 134, in get_requires_for_build_wheel
    return hook(config_settings)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/build-env-58yivh01/lib/python3.12/site-packages/setuptools/build_meta.py", line 332, in get_requires_for_build_wheel
    return self._get_build_requires(config_settings, requirements=[])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/build-env-58yivh01/lib/python3.12/site-packages/setuptools/build_meta.py", line 302, in _get_build_requires
    self.run_setup()
  File "/tmp/build-env-58yivh01/lib/python3.12/site-packages/setuptools/build_meta.py", line 318, in run_setup
    exec(code, locals())
  File "<string>", line 45, in <module>
  File "/tmp/build-env-58yivh01/lib/python3.12/site-packages/setuptools/__init__.py", line 117, in setup
    return distutils.core.setup(**attrs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/build-env-58yivh01/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 145, in setup
    _setup_distribution = dist = klass(attrs)
                                 ^^^^^^^^^^^^
  File "/tmp/build-env-58yivh01/lib/python3.12/site-packages/setuptools/dist.py", line 283, in __init__
    _Distribution.__init__(self, dist_attrs)
  File "/tmp/build-env-58yivh01/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 279, in __init__
    self.finalize_options()
  File "/tmp/build-env-58yivh01/lib/python3.12/site-packages/setuptools/dist.py", line 635, in finalize_options
    ep(self)
  File "/tmp/build-env-58yivh01/lib/python3.12/site-packages/setuptools_scm/_integration/setuptools.py", line 123, in infer_version
    _assign_version(dist, config)
  File "/tmp/build-env-58yivh01/lib/python3.12/site-packages/setuptools_scm/_integration/setuptools.py", line 58, in _assign_version
    _version_missing(config)
  File "/tmp/build-env-58yivh01/lib/python3.12/site-packages/setuptools_scm/_get_version_impl.py", line 117, in _version_missing
    raise LookupError(
LookupError: setuptools-scm was unable to detect version for /home/c0rn3j/Downloads/sc-controller-0.4.9.5.

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

ERROR Backend subprocess exited when trying to invoke get_requires_for_build_wheel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions