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

Building: Migrate away from distutils #1228

Closed
1 task done
hosiet opened this issue Jan 22, 2024 · 13 comments
Closed
1 task done

Building: Migrate away from distutils #1228

hosiet opened this issue Jan 22, 2024 · 13 comments
Labels
cat.Packaging Issue relates to building/packaging info.v2.0.1 type.CodeQuality Issue relates to code quality
Milestone

Comments

@hosiet
Copy link

hosiet commented Jan 22, 2024

Description of bug

Python 3.12+ has officially purged distutils from the std library. All distutils functionality can be provided by setuptools. Please consider completely remove distutils usage from the repo (most importantly in setup.py).

Steps to reproduce

Build the package with python 3.12

Backtraces or error messages

File "/<<PKGBUILDDIR>>/setup.py", line 17, in <module>
     from distutils.command.build import build
ModuleNotFoundError: No module named 'distutils'
E: pybuild pybuild:391: clean: plugin distutils failed with: exit
code=1: python3.12 setup.py clean

MyPaint version

git HEAD

Operating System(s)

N/A

Desktop Environment (Linux)

N/A

Code of Conduct

  • I acknowledge that my conduct contributes to shaping the community.
@hosiet hosiet added info.Triage Need to triage this type.Bug Something isn't working as intended labels Jan 22, 2024
@AesaraB AesaraB added cat.Packaging Issue relates to building/packaging type.CodeQuality Issue relates to code quality and removed type.Bug Something isn't working as intended info.Triage Need to triage this labels Jan 22, 2024
@AesaraB AesaraB added this to the v3.0.0 milestone Jan 22, 2024
@hosiet
Copy link
Author

hosiet commented Jan 22, 2024

Looking at code search from https://github.com/search?q=repo%3Amypaint%2Fmypaint%20distutils&type=code , there are usages in setup.py

mypaint/setup.py

Lines 28 to 29 in f95972f

from distutils.command.build import build
from distutils.command.clean import clean
and tests/unported/performance.py
import distutils.spawn
if distutils.spawn.find_executable("gprof2dot.py") \

@AesaraB
Copy link
Contributor

AesaraB commented Jan 22, 2024

Realistically this will be something I get to in one or two weeks as I'm currently working on refactoring the documentation

@AesaraB AesaraB changed the title Please migrate away from distutils Building: Migrate away from distutils Jan 22, 2024
@eeickmeyer
Copy link

eeickmeyer commented Jan 30, 2024

@AesaraB First of all, thank you so much for this work! I know quite a few people that love mypaint and use it with their Wacom tablets on Ubuntu Studio!

Unfortunately, mypaint has officially been removed from Ubuntu Noble Numbat (future 24.04 LTS) in order to accommodate the Python 3.12 transition. I do hate to rush this, but the sooner a fix can be provided, the better. I went to update the seeds and metapackages for Ubuntu Studio just now and, much to my surprise (and alarm!), I found it had been removed.

@AesaraB
Copy link
Contributor

AesaraB commented Jan 30, 2024

As a temporary holdover, see if the AppImage works

@eeickmeyer
Copy link

Unfortunately we can't upload the AppImage to the archive for Debian or Ubuntu; that's just not possible. It must be built from source, so while the AppImage would work for our users, this issue doesn't affect them yet as 24.04 isn't released. We're trying to prevent this from becoming an issue.

@AesaraB
Copy link
Contributor

AesaraB commented Jan 30, 2024

OH! I apologise, I hadn't realised you were a packager. There are a number of issues to contend with before the next minor release (there have been hundreds of commits since then, plus this project has more or less been abandoned for two years, so some spring cleaning too). I could, for your purposes, create patch files that you can apply to relevant files for the current release.

@eeickmeyer
Copy link

eeickmeyer commented Jan 30, 2024

Yes! Myself and @hosiet are both packagers, me for Ubuntu, himself for Debian. :) All we need are patches and we're good to go! 😄

@AesaraB
Copy link
Contributor

AesaraB commented Jan 31, 2024

PEP 632 – Deprecate distutils module

While Python 3.12 will not include the distutils library, setuptools will.

This patch modifies two files as the bare minimum I need to get MyPaint built. It:

  1. Makes appropriate fixes for the problems listed above.
  2. Fixes a depreciated (and removed) call in gettext_setup.py.
  3. Does not yet make changes to the unit tests, I'm hoping they'll just throw a warning at you, rather than stop you from building anything.

Patch file below. Apply it to tag v2.0.1, tell me if it works.
distutils.patch.txt

@AesaraB
Copy link
Contributor

AesaraB commented Jan 31, 2024

FYI, I haven't tested this on Python 3.12 as my development environment doesn't package it in the default repos. I'll set things up properly if setup.py is still broken.

@AesaraB AesaraB modified the milestones: v3.0.0, v2.1.0 Feb 1, 2024
@hosiet
Copy link
Author

hosiet commented Feb 2, 2024

Thanks for the patch.

@eeickmeyer please note, I cannot make any influence on the Ubuntu side. You may need more communication with Ubuntu internals so that package mypaint won't miss Ubuntu 24.04 release deadline.

@eeickmeyer
Copy link

@hosiet As long as the patch is implemented in unstable before the end of this month, it'll automatically sync to Ubuntu. After that, I can manually sync it. Looks like, as far as I can tell, that was already done, so we're just waiting for some Python 3.12 transition items to untangle before it hits the release pocket.

@AesaraB
Copy link
Contributor

AesaraB commented Feb 4, 2024

Hi, this issue is a subset of #1229, and no longer needs to be open. Can you confirm/deny the patch as working?

@hosiet
Copy link
Author

hosiet commented Feb 5, 2024

Ignoring the test scripts, I believe the patch works for package building. I think we can close the issue and focus more on #1229 for the next release. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat.Packaging Issue relates to building/packaging info.v2.0.1 type.CodeQuality Issue relates to code quality
Development

No branches or pull requests

3 participants