borg icon indicating copy to clipboard operation
borg copied to clipboard

pip: has inconsistent version: expected '1.2.3', but metadata has '0.0.0'

Open sophie-h opened this issue 2 years ago • 10 comments

I have been hitting this problem for a while. The way borg is installed is generated via flatpak-builder-tools

The message is

borgbackup-1.2.3.tar.gz has inconsistent version: expected '1.2.3', but metadata has '0.0.0'

And I ran into it today again

https://buildbot.flathub.org/#/builders/37/builds/2462

The workaround is to use --use-deprecated=legacy-resolver but that doesn't sound quite right.

The build command is

pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"borgbackup\" --no-build-isolation

sophie-h avatar Jan 29 '23 18:01 sophie-h

that .tar.gz is the download from pypi.org?

did you try older/newer pip in case they have a bug in their resolver?

ThomasWaldmann avatar Jan 29 '23 19:01 ThomasWaldmann

  /usr/lib/python3.10/site-packages/setuptools/_distutils/dist.py:265: UserWarning: Unknown distribution option: 'use_scm_version'

Hmm, the pyproject.toml says borg requires setuptools_scm, but here it complains about the config dict for that.

ThomasWaldmann avatar Jan 29 '23 19:01 ThomasWaldmann

It is https://files.pythonhosted.org/packages/e6/a5/69a9ddce8ae769e1bf4d1f1e93459238f473bad770d4dddba108db91971c/borgbackup-1.2.3.tar.gz

I don't think it's a bug in the resolver if the metadata contains '0.0.0'. The expected '1.2.3' comes from the filename afaik

Edit: The manifest is here https://github.com/flathub/org.gnome.World.PikaBackup/blob/beta/python3-borgbackup.json

sophie-h avatar Jan 29 '23 19:01 sophie-h

Something unrelated i noticed: it says "using bundled xxhash". So you do not have libxxhash-dev installed there?

ThomasWaldmann avatar Jan 29 '23 19:01 ThomasWaldmann

Something unrelated i noticed: it says "using bundled xxhash". So you do not have libxxhash-dev installed there?

You can't really install packages in Flatpak, instead you usually build things. Is the bundled version bad?

sophie-h avatar Jan 29 '23 20:01 sophie-h

xxhash: No, I just noticed it discovered all from libs via pkg-config, just not that.

ThomasWaldmann avatar Jan 29 '23 20:01 ThomasWaldmann

I had a look into the .tar.gz: PKG-INFO says 1.2.3 and also borg/_version.py says 1.2.3.

Maybe pip or setuptools_scm malfunctioning somehow?

ThomasWaldmann avatar Jan 29 '23 20:01 ThomasWaldmann

Unfortunately python packaging is just weird magic to me

sophie-h avatar Jan 29 '23 20:01 sophie-h

@sophie-h I think this is happening because you use this option --no-build-isolation, in which case you have to install all build dependencies manually. In this case, you are missing setuptools-scm which is used for borg versioning. Try pip install setuptools-scm

asiunov avatar Jul 24 '23 20:07 asiunov

https://github.com/borgbackup/borg/issues/7302#issuecomment-1407755293 I also have seen this while tweaking setup in borg 1.4-maint branch, but then resolved it after I moved most stuff to pyproject.tom and using only pip install and python -m build.

Guess it is worth retrying this with 1.4-maint (or some 1.4 alpha/beta release soon).

ThomasWaldmann avatar Dec 26 '23 14:12 ThomasWaldmann

Someone explained to me that I manually need to installl setuptools-scm because whatever is provided in the Flatpak Sdk is not enough to resolve the version properly. Sorry for the fuzz. For people working with python that's probably obvious.

sophie-h avatar Feb 23 '24 21:02 sophie-h

In this case, you are missing setuptools-scm which is used for borg versioning. Try pip install setuptools-scm

Ah, also here, thanks!

sophie-h avatar Feb 23 '24 21:02 sophie-h