Replace Makefile with doit dodo.py file
ClosedPublic

Authored by tflink on Jul 8 2015, 10:10 PM.

Details

Summary

While make is great in many situations, it has its limitations. I've reworked the functionality previously covered by the Makefile with tasks in a dodo.py file used by doit. The advantage here is less in the individual project as it will be when we can chain them together from a master dodo.py file to do builds, releases, doc etc. in CI.

After installing doit (either from Fedora repos or pip), you run the tasks by running doit <taskname> where <taskname> is one of:

  • snapshot take a git snapshot of current HEAD and make tar.gz out of it
  • checksum create checksum of the snapshot
  • builddocs build documentation
  • releasedocs build docs and put them in the builds/<version>/ directory
  • buildsrpm build srpm from most current snapshot
  • chainbuild build rpm using mockchain and the current COPR repo
Test Plan

I've run through the various commands and while they are not identical to the old make commands, they are functionally the same.

Diff Detail

Repository
rLTRN libtaskotron
Branch
feature/replace-makefile
Lint
Lint OK
Unit
No Unit Test Coverage
tflink retitled this revision from to Replace Makefile with doit dodo.py file.Jul 8 2015, 10:10 PM
tflink updated this object.
tflink edited the test plan for this revision. (Show Details)
tflink added reviewers: kparal, mkrizek, jskladan.
tflink set the repository for this revision to rLTRN libtaskotron.
tflink added a project: libtaskotron.
mkrizek accepted this revision.Jul 9 2015, 12:37 PM

Tried running a few commands, worked for me. LGTM

/me looks forward for automated releases

This revision is now accepted and ready to land.Jul 9 2015, 12:37 PM
jskladan accepted this revision.Jul 10 2015, 6:33 AM

Cool!

kparal added a comment.EditedJul 10 2015, 11:58 AM

Looks good. A few remarks:

  • Could you please mention it in the readme, at least doit list command that lists all the available targets? It's certainly not as obvious and well-known as Makefile is.
  • python-doit should probably be listed in in readme in the package requirements section (along the other tools used for development)
  • It consumes output of certain commands. For example, buildsrpm produces output, but chainbuild doesn't. builddocs doesn't either, as well as test. I'd prefer to show all output by default, or at least have an option to do so (I haven't found it). For certain targets, like builddocs, the output often contains important warnings about invalid syntax, and currently we lost all of that info. For test, I'd prefer to see the output even if everything is OK, just to make me feel more at ease. Can that be configured?
  • In doit list, the description is cropped after the first line. See details:
$ doit list
builddocs     Generate sphinx html docs
buildsrpm     build SRPM using mock, the latest git shapshot and current specfile details
chainbuild    mockchain package using COPR repo to assist. Will fail if deps in repo are not up to date
checksum      Generate checksum of git snapshot
cleandocs     Clean generated sphinx html docs
details       The idea here is to provide a method to see some bits inside the
releasedocs   Put generated docs in the release output
snapshot      Take snapshot of git specified git branch
test          Run the unit and functional tests
tflink planned changes to this revision.Jul 13 2015, 2:45 PM
In D422#7948, @kparal wrote:

Looks good. A few remarks:

  • Could you please mention it in the readme, at least doit list command that lists all the available targets? It's certainly not as obvious and well-known as Makefile is.
  • python-doit should probably be listed in in readme in the package requirements section (along the other tools used for development)

Agreed on the readme stuff, I'll make those changes and update the diff

  • It consumes output of certain commands. For example, buildsrpm produces output, but chainbuild doesn't. builddocs doesn't either, as well as test. I'd prefer to show all output by default, or at least have an option to do so (I haven't found it). For certain targets, like builddocs, the output often contains important warnings about invalid syntax, and currently we lost all of that info. For test, I'd prefer to see the output even if everything is OK, just to make me feel more at ease. Can that be configured?

The only task with a non-default verbosity is details. I think that buildsrpm has more output due to how mock handles console output. I can force everything to be more verbose if we really want it to be that way but I'd rather leave it as is - you can force more verbose output by adding --verbosity 2 to any command

  • In doit list, the description is cropped after the first line. See details:

Thanks for the reminder - details isn't really useful for more than debugging internally detected variables (spec version, release, etc.) so I wasn't paying as much attention to it

tflink updated this revision to Diff 1146.Jul 13 2015, 3:52 PM
  • added doit notes to readme, hid a few tasks that wouldn't be needed regularly from 'doit list'
This revision is now accepted and ready to land.Jul 13 2015, 3:52 PM
kparal accepted this revision.Jul 15 2015, 12:33 PM
In D422#8069, @tflink wrote:

The only task with a non-default verbosity is details. I think that buildsrpm has more output due to how mock handles console output. I can force everything to be more verbose if we really want it to be that way but I'd rather leave it as is - you can force more verbose output by adding --verbosity 2 to any command

Thanks, that seems to work. I've tried to inject invalid syntax into docs, and make some tests fail, and it seems to print the error lines (stderr) even with default verbosity. That's great. So the default values are probably fine.

However, could you please add a short note about --verbosity 2 into the readme as well? It's not documented in doit --help, so you can't figure it out easily. Thanks.

Overall, seems to be a nice build tool.

readme.rst
59–60

It was sorted by alphabet before ;-) (helps comparing with spec and requirements.txt)

tflink updated this revision to Diff 1180.Jul 15 2015, 4:34 PM
  • making small changes to readme from comments in review
tflink closed this revision.Jul 15 2015, 8:43 PM

This was fixed with rLTRN58a26f8f9df7 but the change wasn't detected automagically - closing the revision.