[HN Gopher] What the Heck Is Pyproject.toml?
       ___________________________________________________________________
        
       What the Heck Is Pyproject.toml?
        
       Author : BerislavLopac
       Score  : 19 points
       Date   : 2020-04-01 08:24 UTC (14 hours ago)
        
 (HTM) web link (snarky.ca)
 (TXT) w3m dump (snarky.ca)
        
       | hprotagonist wrote:
       | The thing i have yet to reliably figure out is this (i live in
       | the science part of python):
       | 
       | without a setup.py, how do I:                 from Cython.Build
       | import cythonize        import numpy as np       import
       | versioneer       setup(...,
       | version=versioneer.get_version(),
       | cmdclass=versioneer.get_cmdclass(),
       | ext_modules=cythonize(extensions),
       | include_dirs=[np.get_include()],            ...)
       | 
       | I'm 100% on board with not having executable configuration files,
       | except that we've been happily abusing them for years now and
       | there are a lot of edge cases that i rely on now.
        
         | pdonis wrote:
         | All of those setup options are now setup.cfg options:
         | 
         | https://docs.python.org/3/distutils/configfile.html
         | 
         | At least, that's supposed to be the case; I am not 100% certain
         | that it always is. However, even so, AFAIK setup.cfg does not
         | directly support using third-party libraries to compute the
         | setup options, as your setup.py does. The only workaround I'm
         | aware of for that if you want to get rid of setup.py is to have
         | a separate script that generates setup.cfg using whatever
         | libraries you need. However, I don't think that's the vision of
         | the Python developers.
        
       | [deleted]
        
       | fermienrico wrote:
       | Python desperately needs a better packaging solution than pip
       | from Python Software Foundation. Stop all new features until this
       | - the biggest pain point for Python across all expertise levels
       | from newbies to experienced Python programmers - is _officially_
       | solved. No pipenv, no poetry, no conda, etc from third party devs
       | who sometimes get tired of the pressure [1]. It is immense.
       | Combine all this virtualenv stuff with great dependency
       | management into one tool. In the spirit of Python, there should
       | be only one way to package, manage dependencies and virtual
       | environments. It should be super clean (see Go).
       | 
       | Python needs a BDFL to enforce the hive mind. It is a fucking
       | mess and it's unacceptable. Python is otherwise the most
       | incredible language of our times. It is so far ahead of anything
       | out there for general purpose use.
       | 
       | Relevant xkcd: https://xkcd.com/1987/
       | 
       | [1] https://github.com/pypa/pipenv/issues/4058
        
         | dralley wrote:
         | None of that is "necessary". Rust doesn't have a BDFL and
         | they've gotten along fine.
         | 
         | But I agree that the current situation is a free-for-all mess.
         | The "official" solutions are garbage and none of the unofficial
         | solutions, which are good, have enough clout to warrant a
         | meaningful simplification of the ecosystem (held hostage by the
         | majority of users with just pip). So the ecosystem is kind of
         | frozen in place. PyPA doesn't seem to have a vision of how to
         | move forwards, or frankly much will/capacity to do anything
         | more than _very_ small, incremental changes.
        
         | Supermancho wrote:
         | > Python is otherwise the most incredible language of our times
         | 
         | By what metric(s)?
         | 
         | It's based on statements, and not only on expressions. This is
         | a fundamental issue that it has yet to grow out of.
        
         | no_wizard wrote:
         | I agree. This really seems like high impact too. A first party,
         | supported solution would solve this mess. Getting the Python
         | dependency build story under control I would include in this
         | category. In this department, I think Conda shows the way. They
         | leverage Azure Pipelines to build much of the c dependencies
         | ahead of time, and just send binaries down the pipe (at least,
         | that's the high level overview as I understand it).
         | 
         | I can't see a world where the Python Software Foundation can't
         | get support for this, I think they have the contacts at the big
         | companies to get it funded.
         | 
         | The lead Python has on machine learning, data science, and
         | scientific computing won't last forever (though, I think its
         | safe to say no matter what, it ain't going anywhere.
        
         | j88439h84 wrote:
         | Poetry is a modern packaging system for Python. It's really
         | good. I hope everyone converges on it.
         | 
         | http://python-poetry.org/
        
         | tych0 wrote:
         | FWIW, the issue you linked to was closed in favor of
         | https://github.com/pypa/pipenv/issues/3369.
         | 
         | Looks like Canonical is paying him now.
        
         | nvrspyx wrote:
         | I haven't looked much into it myself, but I've heard good
         | things about Poetry [0].
         | 
         | 0: https://python-poetry.org/
        
           | rattray wrote:
           | This looks great. Can anyone who's used both comment on how
           | poetry compares to yarn[0]?
           | 
           | [0] https://yarnpkg.com/
        
         | [deleted]
        
       | goldenshale wrote:
       | Our experience using pyenv, poetry and a Pyproject.toml for
       | projects lately has been great. I highly recommend going this
       | route compared to dealing with pip and pipenv.
        
       ___________________________________________________________________
       (page generated 2020-04-01 23:00 UTC)