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

Installing A+ dependencies fails on the latest pip and setuptools versions #976

Closed
markkuriekkinen opened this issue Feb 14, 2022 · 4 comments
Assignees
Labels
area: admin Issues related to server administration and service upkeep effort: days Estimated to take less than one week, from the creation of a new branch to the merging experience: moderate required knowledge estimate requester: external The issue is raised by users outside Aalto type: bug This is a bug
Milestone

Comments

@markkuriekkinen
Copy link
Contributor

Installing A+ fails (pip install -r requirements.txt) if the system uses the latest pip and setuptools version.


From Aplusguru tickets:
https://rt.cs.aalto.fi/Ticket/Display.html?id=20345

when trying to install new RC v1.12.0rc3 I run into situation where requirements.txt won't install with latest version of python pkg setuptools.

In the attached Docker config the pkg coming with the debian python 3.9 is version 52.0.0 and it works.

But if I run update on pip and setuptools before install, the version is 60.0.3 and then there's an error in
https://github.com/apluslms/js-jquery-toggle.git to commit d9c5219a74e0e0536fd40df2c7ba8ea842313d19:
File "/tmp/pip-install-wah_ndnm/js-jquery-toggle-django_316200f9e1904fd1bf29c2a9b3cc150f/django/setup.py", line 19, in
scheme['data'] = scheme['purelib']
KeyError: 'purelib'

Dockerfile to show the error:

FROM debian:11.2-slim
RUN apt-get update &&
export DEBIAN_FRONTEND="noninteractive" &&
apt-get install -y --no-install-recommends
locales
bash git python3.9 python3-pip gettext

RUN python3 -m pip install --upgrade pip setuptools

RUN python3 -c "import setuptools; print('VERSION', setuptools.version)"

WORKDIR /srv/aplus

ENV BRANCH=v1.12.0rc3

RUN git clone --single-branch --branch $BRANCH https://github.com/apluslms/a-plus.git
&& cd a-plus
&& git describe

WORKDIR /srv/aplus/a-plus

RUN pip3 --no-cache-dir install -r requirements.txt


Python setuptools v60 was released Dec 20th 2021 and it seems to produce problems with aplus installation.

When trying out aplus v1.11.4 I run into situation where install goes fine but at runtime will generate an error:
Django Version: 3.2.10
Exception Type: ModuleNotFoundError
Exception Value:

No module named 'rest_framework_extensions'

Exception Location: ./api/urls_v2.py, line 5, in

I don't have exact details but changing my pip and setuptools upgrade to:
python3 -m pip install --upgrade pip "setuptools<60"
(e.g. don't use setuptools 60) the problem goes away.

@markkuriekkinen markkuriekkinen added type: bug This is a bug area: admin Issues related to server administration and service upkeep effort: hours Estimated to take less than one day, from the creation of a new branch to the merging experience: moderate required knowledge estimate requester: external The issue is raised by users outside Aalto status: scheduled labels Feb 14, 2022
@PasiSa PasiSa added this to the v1.14 milestone Feb 17, 2022
@markkuriekkinen
Copy link
Contributor Author

Celery is at least one cause. Its dependency click-didyoumean does not support setuptools >= 59.7:

plus_1        | Requirement already satisfied: click-didyoumean>=0.0.3 in /usr/local/lib/python3.9/dist-packages (from celery<6,>=5.2.1->-r /srv/aplus/requirements.txt (line 31)) (0.3.0)
plus_1        | Collecting setuptools<59.7.0,>=59.1.1
plus_1        |   Downloading setuptools-59.6.0-py3-none-any.whl (952 kB)

The most recent update in click-didyoumean was made in Sep 2021.

I'm not sure if these are related to this (kombu is part of celery):

@annirytkonen
Copy link

the schedule depends on Tampere, and I've asked for it. I add a preliminary milestone now to proceed with overview planning and let's return to the case when we know more.

@markkuriekkinen
Copy link
Contributor Author

I took a quick look at this again. This is not related to Tampere, but the changes in the pip package manager and setuptools. Many frameworks and libraries were (at least in the beginning) incompatible with the latest pip version. A+ depends on Celery and Celery was having issues with pip/setuptools. However, a new patch has been released in Celery and that seems to fix it: https://github.com/celery/celery/releases/tag/v5.2.6

After quick testing, it looks like that rest_framework_extensions are still causing issues and thus do not work with the latest pip or setuptools. A+ uses our customized fork of rest_framework_extensions, thus we can not simply increase the version of the library. We need to port our changes in the library to the latest release of the library. Though, the rest_framework_extensions haven't been changed much since since there is no active development going on.

Rest_framework_extensions depend on the Django REST framework, which we should update too assuming that rest_framework_extensions are still compatible with the latest Django REST framework.

Related issues in the official library rest_framework_extensions:

@markkuriekkinen markkuriekkinen added effort: days Estimated to take less than one week, from the creation of a new branch to the merging and removed effort: hours Estimated to take less than one day, from the creation of a new branch to the merging labels Apr 8, 2022
@markkuriekkinen
Copy link
Contributor Author

I think this issue was resolved in the commit df64e84

Repository owner moved this from Planned for April release to Done in A+ Backlog (Sprint 7/22 onward) Jun 30, 2022
Repository owner moved this from Todo to Done in A+ sprint 4/22 (14.2. - 25.2.) Jun 30, 2022
@markkuriekkinen markkuriekkinen self-assigned this Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: admin Issues related to server administration and service upkeep effort: days Estimated to take less than one week, from the creation of a new branch to the merging experience: moderate required knowledge estimate requester: external The issue is raised by users outside Aalto type: bug This is a bug
Projects
Status: Done
Development

No branches or pull requests

3 participants