proud-dentist-22844
04/10/2023, 11:02 PMpython_distribution
that provides its own setup.py
and then extract the dependencies from the .dist-info/METADATA
file. Or better yet, just run the PEP-517 backend method prepare_metadata_for_build_wheel
(without everything else involved in building a PEP-660 editable wheel), and extract the requirements from there. It'd be a python_requirements
target that gets its requirements from wheel metadata instead of defining the deps used to build the wheel.
I know it's kind of a wild idea. How many people write their own setup.py
? And would the ability to extract requirements from a setup.py
be useful?
-- Mayor of crazy town, signing off. 😜happy-kitchen-89482
04/10/2023, 11:14 PMhappy-kitchen-89482
04/10/2023, 11:14 PMhappy-kitchen-89482
04/10/2023, 11:14 PMproud-dentist-22844
04/10/2023, 11:17 PMsetup.py
because it's ultimately arbitrary code execution. I've seen some really awful setup.py
files.proud-dentist-22844
04/10/2023, 11:19 PMsetup.py
then you might have to duplicate reqs in setup.py
and requirements.txt
or something. All the awful hacks to avoid that duplication are just that: awful.happy-kitchen-89482
04/10/2023, 11:21 PMproud-dentist-22844
04/10/2023, 11:21 PMsetup.py
to work well. I look forward to pants generating pyproject.toml
instead because I want to see setup.py
just go away. :Phappy-kitchen-89482
04/10/2023, 11:21 PMhappy-kitchen-89482
04/10/2023, 11:21 PMproud-dentist-22844
04/10/2023, 11:22 PMhappy-kitchen-89482
04/10/2023, 11:22 PMhappy-kitchen-89482
04/10/2023, 11:22 PMhappy-kitchen-89482
04/10/2023, 11:22 PMproud-dentist-22844
04/10/2023, 11:24 PMsetup.py
. probably not worth it. But an interesting mental exercise.proud-dentist-22844
04/10/2023, 11:31 PMRight, but even in that world the convention is that requirements.txt is canonical and setup.py is the copy, for publishing
That world doesn't make sense to me. That is the most succinct explanation I've ever seen for why someone might want the two files to differ, but I still think that's confusing and leads to one or the other bitrotting. So, it is conceivable that someone would only have the one file. Luckily the days of
setup.py
are numbered, so my crazy hacky idea shouldn't ever be necessary.happy-kitchen-89482
04/10/2023, 11:41 PM