[HN Gopher] Writing Makefiles for Python Projects
___________________________________________________________________
Writing Makefiles for Python Projects
Author : smitty1e
Score : 10 points
Date : 2021-04-01 15:29 UTC (7 hours ago)
(HTM) web link (venthur.de)
(TXT) w3m dump (venthur.de)
| smitty1e wrote:
| I've used the former to good effect. A phony help target for a
| default can print a menu, so that the only thing to know/remember
| is to type: `make`.
|
| However, for setting up the whole environment, I'm looking for a
| cookiecutter-based or -integrated solution.
| sneak wrote:
| One of my policy for all employees or contractors is that "make"
| (and optionally "make test") in the root of a repo should always
| "do the thing".
|
| We have a de facto, decades old standard for a "run the tests" or
| a "build the damn thing" big red button. We should use it, even
| if it's just a few line wrapper over npm run or docker build or
| whatever. (The fact that it could be either is the reason that
| there should be a standardized entrypoint.)
| wahern wrote:
| I wish more people would read https://www.gnu.org/software/make
| /manual/html_node/Standard-....
|
| Once upon a time anybody using a Unix-like OS was familiar with
| most of those standard targets as a consequence of the ubiquity
| of autotools, especially when package repositories weren't so
| comprehensive and it was more common to download and build
| tarballs locally.
|
| But at my current job, there's no rhyme or reason to make
| targets. Something like `make build` (where build may or may
| not be the default target, likely accidentally if it is) is
| more likely to install Go toolchain dependencies than to build
| any of the project source code. And of course little if any
| attempt is made to actually declare dependencies, correct or
| broken, as for so many programmers these days a Makefile is
| just a container for ad hoc shell code.
|
| I don't often make use of autotools in my own projects, but I
| religiously try to adhere to the standard targets and other
| build and distribution conventions outlined at
| https://www.gnu.org/software/make/manual/html_node/Makefile-...
| and
| https://www.gnu.org/prep/standards/standards.html#Managing-R...
| sneak wrote:
| Autotools are hot garbage stuck in the 1980s, and I can't
| fault anyone for avoiding the writing or advice of the
| organization that has not only failed to modernize them but
| has also stolen decades or centuries of person-hours of life
| from people due to the terrible inefficiency of this piece of
| critical infrastructure.
___________________________________________________________________
(page generated 2021-04-01 23:04 UTC)