Conversation
…est citation and acknowledgement information
…wledgement text to it.
… top of the release_automation.py file
…alues for sasdata and sasmodels
…ler and flatpak manifests
llimeht
left a comment
There was a problem hiding this comment.
Great strides forward in fixing things that can confuse in the release process :)
| with open(citation_filename, 'w') as file: | ||
| file.write(acknowledgement_template.format(doi, release_manager)) | ||
|
|
||
| # Update the Pyinstall config with the version and the year |
There was a problem hiding this comment.
This is innosetup config not pyinstaller config (just for the comment)
| # Update the Pyinstall config with the version and the year | ||
| for line in fileinput.input(iss_file, inplace=True): | ||
| if line.startswith('#define MyAppVersion'): | ||
| print(f'#define MyAppVersion "{version}"', end='\r') |
There was a problem hiding this comment.
\r line endings does not look right here. The current file is unix file endings (\n) and a mixture of them will not be fun.
| version_filename = system_directory /"version.py" | ||
| citation_filename = system_directory / "citation.py" | ||
| iss_file = installers_directory / 'installer.iss' | ||
| flatpak_manifest = flatpak_directory / 'org.sasview.sasview.metainfo.xml' |
There was a problem hiding this comment.
Not wild about these flatpak_* variable names - these is a quite generic freedesktop metadata files and used by other linux packaging. The metainfo file is also not the flatpak manifest of course, which is the yml/json elsewhere.
| # Update the flatpak manifest with the version and date | ||
| for line in fileinput.input(flatpak_manifest, inplace=True): | ||
| if line.strip().startswith('<release '): | ||
| print(f' <release version="{version}" date="{date}"></release>', end='\r') |
There was a problem hiding this comment.
\r again - this file is definitely unix file endings \n
|
|
||
| # Pull the license from a know location | ||
| license_line = legal.copyright | ||
| license_line = legal.copyright + "\r" |
| import sphinx | ||
| from packaging.version import parse | ||
|
|
||
| from sas.system.version import __version__ as sasview_version |
There was a problem hiding this comment.
Importing the package while it is being built makes me very nervous - there is a circularity about this. It currently works because of some PYTHONPATH manipulation in the hatch-sphinx config (pyproject.toml [[tool.hatch.build.targets.wheel.hooks.sphinx.tools]] build table), but that could be fragile.
| __version__ = "{0}" | ||
|
|
||
| __release_date__ = "{1}" | ||
| __build__ = "GIT_COMMIT" |
There was a problem hiding this comment.
Is it time to get rid of that __build__ member (it's unreferenced, and we'd use the git describe info that is in the version string / version tuple instead.
(and perhaps __version_tuple__ should be imported+exported as well, since other things seem to be wanting the version of sasview at a granular level in src/sas/system/config/config_meta.py and src/sas/system/user.py)
| # in http://epydoc.sourceforge.net/stdlib/distutils.version.StrictVersion-class.html | ||
| # The short X.Y version. | ||
| version = '6.1' | ||
| parsed_version = parse(sasview_version) |
There was a problem hiding this comment.
In sas.system.user the code uses Version(sasview_version). I wonder if we should use the exact same method each time so that no-one needs to go and re-read the docs to find that they are actually the same (as I just did)
|
|
||
| def parse_args(): | ||
| parser = argparse.ArgumentParser('Script to automate release process') | ||
| parser.add_argument('-v', '--sasview_version', required=True) |
There was a problem hiding this comment.
Are we at the stage where these 3 values are introspectable? (or is that for the next batch of improvements some future time). We're more or less getting to standardised ways of reading the version strings for each project.
Description
This revamps the release automation script used to create the Zenodo DOI.
Changes:
config.pyfor theLAST_WHATS_NEW_HIDDEN_VERSIONandLAST_UPDATE_DISMISSED_VERSIONFixes #3489
Refs #3884 (second bullet)
Fixes #1840
How Has This Been Tested?
Tested locally and the majority of files listed in https://github.com/SasView/sasview/wiki/DevNotes_DevGuide_ReleaseChecklistTemplate that need to be updated are updated.
Review Checklist:
Documentation (check at least one)
Licensing (untick if necessary)