Menu

#44 distutils not removed from setup.py?

open
nobody
None
5
2024-04-28
2024-04-14
No

Hi!

I see that https://sourceforge.net/p/cxx/code/451/ removed distutils from setup_makefile.py but setup.py seems to still use distutils, which is a problem with Python >=3.12. Could it be migrated to Setuptools? Thanks in advance!

Best, Sebastian

Discussion

  • Barry Alan Scott

    This is a contributed script, that I do not use.
    Do you have a patch to it that I can use to migrate to setuptools?
    Or can you use setup_makefile.py? Maybe I should delete setup.py?

     
    • Sebastian Pipping

      Hi Barry,

      I believe the Gentoo package dev-python/pycxx that brought me here uses setup.py and not setup_makefile.py. After a quick look at the Makefile that command python3 setup_makefile.py linux Makefile produced, my impression is:
      - that it does not have an install target
      - that the produced files obj/simple.so obj/example.so obj/pycxx_iter.so are not essential (but you tell me)
      - that g++ would need to be a variable, e.g. $(CXX)
      - that -g should come from $(CFLAGS) and $(LDFLAGS) to respect custom user compile flags

      I may not understand the full picture yet, but so far it seems to me that setup.py is central to packaging and installation while setup_makefile.py is not. What is your understanding, how do you use setup_makefile.py and how do you install the package?

      Best, Sebastian

       
  • Barry Alan Scott

    I read how pycxx is packaged for fedora and its using setup.py - but distutils can be imported.
    I'm not sure why that is working like that. Why is distutil available on Fedora?
    I will investigate and update.

    Note since all the setup.py does is install files there is no need to define the compiler.
    PyCXX is a template library with nothing to be compiled. That happens in the projects that use PyCXX.

     
    • Sebastian Pipping

      I read how pycxx is packaged for fedora and its using setup.py - but distutils can be imported.
      I'm not sure why that is working like that. Why is distutil available on Fedora?

      distutils may be importable with 3.12 in some places but upstream https://docs.python.org/3.11/library/distutils.html are clear in "deprecated with removal planned for Python 3.12" and the official docs no longer contain a page for that package for 3.12; it's officially removed with regard to CPython upstream.

      I will investigate and update.

      Thank you!

      Note since all the setup.py does is install files there is no need to define the compiler.
      PyCXX is a template library with nothing to be compiled. That happens in the projects that use PyCXX.

      Understood, yes. I was referring to setup_makefile.py there and for that file, it applies.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.