Skip to content

Release automation script rework#3918

Open
krzywon wants to merge 18 commits intomainfrom
release-automation-script-rework
Open

Release automation script rework#3918
krzywon wants to merge 18 commits intomainfrom
release-automation-script-rework

Conversation

@krzywon
Copy link
Copy Markdown
Contributor

@krzywon krzywon commented Apr 8, 2026

Description

This revamps the release automation script used to create the Zenodo DOI.

Changes:

  • Automates the DOI generation process for sasdata and sasmodels, in addition to sasview.
  • Generalizes most of the functions that were separate for sasview vs. sasmodels. Metadata updates are different, and will likely remain different due to differences in repos.
  • Removes all release note generation routines, in favor of the GitHub automated releases notes generated by the website.
  • Documentation and type hints updated to match the latest functionality.
  • Updates the version number is in many places in the repo. The only outstanding place a version needs changing is in config.py for the LAST_WHATS_NEW_HIDDEN_VERSION and LAST_UPDATE_DISMISSED_VERSION
  • Updates the copyright year is in multiple spots.

Fixes #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)

  • There is nothing that needs documenting
  • Documentation changes are in this PR
  • There is an issue open for the documentation (link?)

Licensing (untick if necessary)

  • The introduced changes comply with SasView license (BSD 3-Clause)

@krzywon krzywon marked this pull request as ready for review April 9, 2026 15:35
@krzywon krzywon changed the title [DRAFT] Release automation script rework Release automation script rework Apr 9, 2026
Copy link
Copy Markdown
Contributor

@llimeht llimeht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\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'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\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"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\n

import sphinx
from packaging.version import parse

from sas.system.version import __version__ as sasview_version
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Release Automation Script: A list of issues must be provided Further develop release automation scripts

2 participants