Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI workflow and ./m quickinstall failing to write _version.py #1515

Closed
UlrichB22 opened this issue Sep 20, 2023 · 6 comments · Fixed by #1518
Closed

CI workflow and ./m quickinstall failing to write _version.py #1515

UlrichB22 opened this issue Sep 20, 2023 · 6 comments · Fixed by #1518

Comments

@UlrichB22
Copy link
Collaborator

Getting following error with ./m quickinstall

py39: packaging backend failed (code=1), with AssertionError: write_to=PosixPath('/home/moint03/test/moin/src/moin/_version.py')
/home/moint03/test/moin/.tox/.pkg/lib/python3.9/site-packages/setuptools/_distutils/dist.py:265: UserWarning: Unknown distribution option: 'message_extractors'
  warnings.warn(msg)
Traceback (most recent call last):
  File "/home/moint03/test/moin-venv-python3/lib/python3.9/site-packages/pyproject_api/_backend.py", line 90, in run
    outcome = backend_proxy(parsed_message["cmd"], **parsed_message["kwargs"])
  File "/home/moint03/test/moin-venv-python3/lib/python3.9/site-packages/pyproject_api/_backend.py", line 32, in __call__
    return getattr(on_object, name)(*args, **kwargs)
  File "/home/moint03/test/moin/.tox/.pkg/lib/python3.9/site-packages/setuptools/build_meta.py", line 396, in prepare_metadata_for_build_wheel
    self.run_setup()
[...]
  File "/home/moint03/test/moin/.tox/.pkg/lib/python3.9/site-packages/setuptools_scm/_integration/setuptools.py", line 102, in version_keyword
    _assign_version(dist, config)
  File "/home/moint03/test/moin/.tox/.pkg/lib/python3.9/site-packages/setuptools_scm/_integration/setuptools.py", line 54, in _assign_version
    maybe_version = _get_version(config, force_write_version_files=True)
  File "/home/moint03/test/moin/.tox/.pkg/lib/python3.9/site-packages/setuptools_scm/_get_version_impl.py", line 94, in _get_version
    write_version_files(config, version=version_string, scm_version=parsed_version)
  File "/home/moint03/test/moin/.tox/.pkg/lib/python3.9/site-packages/setuptools_scm/_get_version_impl.py", line 63, in write_version_files
    dump_version(
  File "/home/moint03/test/moin/.tox/.pkg/lib/python3.9/site-packages/setuptools_scm/_integration/dump_version.py", line 36, in dump_version
    assert not write_to.is_absolute(), f"{write_to=}"
AssertionError: write_to=PosixPath('/home/moint03/test/moin/src/moin/_version.py')

@ThomasWaldmann
Copy link
Member

Can you try a not absolute path for that, like:

write_to = "src/moin/_version.py"

@wagner-intevation
Copy link
Contributor

Isn't that the case already?

moin/setup.py

Line 10 in a1147ae

basedir = os.path.abspath(os.path.dirname(__file__))

moin/setup.py

Lines 67 to 69 in a1147ae

use_scm_version={
'write_to': os.path.join(basedir, 'src', 'moin', '_version.py'),
},

@ThomasWaldmann
Copy link
Member

No, basedir is an absolute path.

@UlrichB22
Copy link
Collaborator Author

setuptools_scm has been raised to 8.0.0 and 8.0.1 today.
The workaround switches back to the latest successful setup.
Lets wait some time before reverting.

@ThomasWaldmann
Copy link
Member

ThomasWaldmann commented Sep 21, 2023

https://github.com/pypa/setuptools_scm/blob/main/src/setuptools_scm/_integration/dump_version.py#L38

It specifically does not allow an absolute path there, because of the joinpath in the next line.

I just tried the latest setuptools_scm in borgbackup master branch (we also use write_to there, but with a relative path) and it worked.

@UlrichB22
Copy link
Collaborator Author

setuptools_scm 8.0.3 now accepts absolut path again but issues a deprecated warning, see
pypa/setuptools-scm#925

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants