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

RFE: move from distutils to setuptools (& setup.py build_sphinx) #13014

Closed
kloczek opened this issue Jun 7, 2021 · 10 comments
Closed

RFE: move from distutils to setuptools (& setup.py build_sphinx) #13014

kloczek opened this issue Jun 7, 2021 · 10 comments

Comments

@kloczek
Copy link
Contributor

kloczek commented Jun 7, 2021

[tkloczko@barrel ipython-7.24.1]$ grep distutils setup.py
# BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
from distutils.core import setup
# custom distutils commands
from distutils.command.sdist import sdist

Looks like ipython is still using distutils and by this it does not support setup.py build_sphinx:

+ /usr/bin/python3 setup.py build_sphinx -b man --build-dir build/sphinx
/usr/lib64/python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option: 'project_urls'
  warnings.warn(msg)
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: invalid command 'build_sphinx'

It would be good to move to setuptools.

@Carreau
Copy link
Member

Carreau commented Jun 11, 2021

Thanks, we are aware, and we also likely want to move to declarative setup in a pyproject.toml for example, as well as get rid of our dependency on nose.

@tirkarthi
Copy link
Contributor

distutils is also deprecated from Python 3.10 : https://www.python.org/dev/peps/pep-0632/

@kloczek
Copy link
Contributor Author

kloczek commented Aug 30, 2021

distutils is also deprecated from Python 3.10 : https://www.python.org/dev/peps/pep-0632/

Good point. I just added note in my ticket against flit to not generate settup.py with import distutils becasue oof that PEP.

@pradyunsg
Copy link

My two cents: it would be a good idea to move to flit, since IPython is a pure-Python project and doesn't need most of the additional capabilities afforded by setuptools.

@bollwyvl
Copy link
Contributor

The one exception being the man pages, delivered via data_files. This is the one case flit has considered supporting but it SURE WOULD BE NICE if it just supported the actual feature, with whatever caveats, that still made it work for the rest of the jupyter stack...

@Carreau
Copy link
Member

Carreau commented Aug 31, 2021

Yes, +1 to have purely declarative setup. I ❤️ flit as well.

@kloczek
Copy link
Contributor Author

kloczek commented Aug 31, 2021

flit at the moment is nothing more than just archiver which can generate .whl file with necessary checksums inside.
pypa/flit#429

flit cannot handle actual build of the module when it is necessary to build DSO or cannot handle building documentation like setuptools<>sphinx integration does https://www.sphinx-doc.org/en/master/usage/advanced/setuptools.html
Only from that point of view I would recommend to stick with pure pep515 (settup.cfg/project.toml + stub setrtup.py consisting from 'from setuptools import setup; setup()') but with setuptools backend.
flit additionally autogenerates setup.py with imported distutils which is already on the road to be deprecated https://www.python.org/dev/peps/pep-0632/

@MrMino
Copy link
Member

MrMino commented Mar 27, 2022

AFAICT distutils is no longer used. That said, integration with sphinx is still not there, so I'm leaving this issue open for that.

@MrMino MrMino changed the title RFE: move from distutils to setuptools RFE: move from distutils to setuptools (& setup.py build_sphinx) Mar 27, 2022
@kloczek
Copy link
Contributor Author

kloczek commented May 1, 2022

I no longer see that distutils is used in latest 8.3.0 .
I think that this ticket can be closed.

Thx.

@Carreau Carreau closed this as completed May 1, 2022
@Carreau
Copy link
Member

Carreau commented May 1, 2022

thanks.

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

No branches or pull requests

6 participants