esm-tools / esm_version_checker

GNU General Public License v2.0
0 stars 0 forks source link

Can't do esm_versions upgrade on Mistral #1

Closed joakimkjellsson closed 4 years ago

joakimkjellsson commented 4 years ago

Hey all

I'm getting the following when I do esm_versions upgrade on mistral:

Installing collected packages: esm-runscripts
  Attempting uninstall: esm-runscripts
    Found existing installation: esm-runscripts 3.1.4
    Uninstalling esm-runscripts-3.1.4:
      Successfully uninstalled esm-runscripts-3.1.4
Successfully installed esm-runscripts-3.1.4
Only allowed to pull on release or develop! Otherwise, do it yourself please...
Traceback (most recent call last):
  File "/pf/b/b350090/.local/bin/esm_versions", line 8, in <module>
    sys.exit(main())
  File "/sw/rhel6-x64/conda/anaconda3-bleeding_edge/lib/python3.6/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/sw/rhel6-x64/conda/anaconda3-bleeding_edge/lib/python3.6/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/sw/rhel6-x64/conda/anaconda3-bleeding_edge/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/sw/rhel6-x64/conda/anaconda3-bleeding_edge/lib/python3.6/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/sw/rhel6-x64/conda/anaconda3-bleeding_edge/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/pf/b/b350090/.local/lib/python3.6/site-packages/esm_version_checker/cli.py", line 158, in upgrade
    pip_or_pull(tool)
  File "/pf/b/b350090/.local/lib/python3.6/site-packages/esm_version_checker/cli.py", line 126, in pip_or_pull
    assert esm_tools_repo.active_branch.name in ["release", "develop"]
AssertionError

Before this it seems to correctly install a bunch of stuff, esm_calendar etc. But esm-runscripts fails for some reason. I'm not sure why it's trying to pull something else than release.

Cheers Joakim

pgierz commented 4 years ago

What branch are you on for esm_tools? The version tool does git stuff for you for that repo specifically, since that's where all the yaml files are.

seb-wahl commented 4 years ago

I have the same error. I'm on the foci2 branch. The error message Only allowed to pull on release or develop! Otherwise, do it yourself please... does not help. What do you mean by do it yourself, please...

pgierz commented 4 years ago

Perhaps at this point better error messages are needed...

In this case, the version checker is only allowed to update release or develop for you, any other branches (usually from a developer) are not touched.

For almost all the tools, the version checker upgrades via a pip install --upgrade. However, for specifically the esm_tools repository, this isn't the case, since the main YAML files are there. We in principle could ship those via a MANIFEST.in file, thereby also allowing you to "install" the main repo; but I think @dbarbi would rather have them in plain sight for people to use and modify. So, instead, a "update" for esm_tools means you need to do git pull. Since I don't want to accidentally break anyones branches, this only happens if you are on develop or release, since the repository owners control those. Everything else is refused and the system stops; however, it should still update other packages. If it stops everything at this point, I've programmed something incorrectly...

@joakimkjellsson @seb-wahl, if you have a nice suggestion for a better error message, please let me know (or, add it on your own!). This error comes out of the cli.py...

joakimkjellsson commented 4 years ago

Hi Paul

Thanks for the help. I switched to the develop branch of esm_tools and then esm_versions upgrade worked fine.

How about doing this instead:

print("Your esm_tools directory is not clean!") print( "Possible problems:" " * You have un-committed local changes " " * You are not on the release or develop branch " )

I'd add it myself, but I don't know how to contribute. My ".local/lib/python3.6/site-packages/esm_version_checker" is not a git directory.

Cheers Joakim

pgierz commented 4 years ago

....also a good point to add to the documentation: how to do a development install of a specific package in order to make contributions. @MiguelAndresMartinez, I know you are updating the handbook currently, maybe we can add a section about that?

@joakimkjellsson, I've changed the error message to be a bit friendlier ;-) Can I close the issue?