I didn’t know if it was best to leave this as a GitHub issue in musicbrainz-docker or a ticket in Jira. I’m building the server using Docker Compose on an Ubuntu VPS, and there’s an error during the build process that is coming from the backports.functools_lru_cache package. That package is importing a newer version of setuptools_scm (6.0.1)which is not compatible with Python 2.7, and the fix is to downgrade it to 5.0.2. Until the maintainer of that package pulls in my PR and fixes this, the indexer will fail to build.
I have a workaround in the meantime. In the SIR Dockerfile, I added a sed command which replaces the backports.functools_lru_cache package with one that I forked, in which I updated the setuptools_scm dependency. Depending on how long it takes the maintainer of that package to fix the problem, it may be worthwhile for musicbrainz-docker to do something like this as well.
In addition, if you’d like to leave a thumbs up on my PR to backports.functools_lru_cache, that might encourage them to resolve this issue more quickly.
That’s odd. sir should pull in backports.functools_lru_cache version 1.0.1 - that version doesn’t have a dependency on setuptools_scm according to its setup.py. Running pip install -r requirements.txt in a python2 virtualenv works just fine and pip list afterwards doesn’t list setuptools_scm as being installed. Running docker build . in the sir repository also works. Do you have more in-depth steps to reproduce the problem?
I was just able to replicate it by doing a clean install of musicbrainz-docker on a separate machine
(WSL Ubuntu) and doing docker-compose build indexer.
#6 3.958 File "/tmp/easy_install-JMOagm/hgtools-8.2.1/temp/easy_install-0ELRCu/setuptools_scm-6.0.1/setup.py", line 29, in scm_config
#6 3.958 "Programming Language :: Python :: 2.7",
#6 3.958 File "/tmp/easy_install-JMOagm/hgtools-8.2.1/temp/easy_install-0ELRCu/setuptools_scm-6.0.1/src/setuptools_scm/__init__.py", line 8, in <module>
#6 3.958 File "/tmp/easy_install-JMOagm/hgtools-8.2.1/temp/easy_install-0ELRCu/setuptools_scm-6.0.1/src/setuptools_scm/config.py", line 6, in <module>
#6 3.958 File "/tmp/easy_install-JMOagm/hgtools-8.2.1/temp/easy_install-0ELRCu/setuptools_scm-6.0.1/src/setuptools_scm/utils.py", line 41
#6 3.958 print(*k)
#6 3.958 ^
#6 3.958 SyntaxError: invalid syntax
#6 3.958
#6 3.958 ----------------------------------------
#6 3.963 Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-0aUGA6/backports.functools-lru-cache/
#6 4.108 You are using pip version 19.0.1, however version 20.3.4 is available.
#6 4.108 You should consider upgrading via the 'pip install --upgrade pip' command.
------
ERROR: Service 'indexer' failed to build
Interestingly enough, I can’t replicate it anymore on my local python installation. Maybe it has something to do with the cache? I used this installation to test installing the forked package I made, so maybe it’s somehow using that now.
It also just installed fine on Python 2 running on my Manjaro machine So right now I’m only able to reproduce it in Docker (although yesterday I was getting the error in Python on Ubuntu, but not anymore).
No, it has nothing to do with any cache. The images in musicbrainz-docker use setuptools 40. Only in setuptools 42 did setuptools learn about the python_requires. hgtools 8 specifies python_requires correctly (https://github.com/jaraco/hgtools/blob/fa05f06b89ae9751662a7b0183820d96813fbd20/setup.cfg#L22), but setuptools ignores that and incorrectly tries to install an hgtools version that can’t work. The following patch to the Dockerfile fixes that: