gentzkow / template_archive

20 stars 36 forks source link

Log software + packages versions #71

Closed jc-cisneros closed 2 years ago

jc-cisneros commented 2 years ago

In this issue we will test the write_version_log feature from gslab_make (see https://github.com/gslab-econ/gslab_make/issues/56).

Task list

jc-cisneros commented 2 years ago

@gentzkow, following the latest conversations on package versions (see https://github.com/gslab-econ/gslab_make/issues/56), I added a write_versions_log feature to produce a log file that lists all the software + packages used in a conda environment, their versions and a timestamp. This feature can be added to any project using gslab_make so that we can always check the versions used in any commit. A caveat of the current code is that it requires a conda environment to be active (i.e, if a user has all the dependencies installed locally, the versions.log file would not be created).

The make.log files now include a new line when the version logs are correctly created:

Screen Shot 2022-11-09 at 12 01 02 AM

An example of how a versions.log file looks within a module can be found on the latest commit.

If this sounds good, I can proceed with the double PR (on both template and gslab_make).

gentzkow commented 2 years ago

Great! This looks very good.

I'm thinking we may want to incorporate this into template and then make the default to not specify explicit version numbers in the setup file. We can note in a comment in that file that users can add explicit version numbers if they want to freeze a package at a particular revision or if they're getting conflicts caused by package updates.

jc-cisneros commented 2 years ago

On a98903e, I updated the conda_env.yaml to reflect the new default behavior per https://github.com/gentzkow/template/issues/71#issuecomment-1309251979. I will proceed with the PR for the issue.

jc-cisneros commented 2 years ago

Summary:

On this issue we tested the a new gslab_make feature to log the package versions. The feature worked as expected and was added to the gslab_make master branch.

Flagging some of the lessons and opportunities for future updates: