Closed jc-cisneros closed 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:
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
).
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.
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.
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:
write_versions_log.py
feature currently returns the output of running conda list
with the active environment and a timestamp. We could add some extra formatting to differentiate Python, R, and Julia packages from each other (see https://github.com/gentzkow/template/pull/72#discussion_r1020986095).versions.log
file for each module. In the future we can try to produce a versions.log
that prints only the packages that were used in each module or script (see https://github.com/gentzkow/template/pull/72#discussion_r1020986973).
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
versions.log
file is created in each submodule'slog
folder.versions.log
correctly prints the versions from the active environment.