Skip to content

Conversation

@apdavison
Copy link
Contributor

@apdavison apdavison commented Mar 29, 2025

Since it is a long time since Sumatra was updated, this is a large pull request. There is more to be done, given the rapid changes in the Python packaging ecosystem in recent years, such as moving to a pyproject.toml-based build/distribution system, but that will be done in a future PR.

Main changes:

  • Remove Python 2.7 support
  • Migration to Django 2.x (we plan to migrate to Django 5, but this will be done in a future PR)
  • Switch to GitHub Actions for CI

The other changes are mostly related to the above.

@apdavison apdavison marked this pull request as draft March 29, 2025 21:14
Squashed commits:
[4ddbf4e] Drop Windows tests for now
[94f40ae] test failures may be due to new pytest version
[e35e512] Missing CI dependency
[6c73a1e] Tests failing on GH Actions, but passing locally - trying to debug
[441540d] temporarily comment out flake8 on Actions, due to pyflakes failure for which I get no Google hits (and which doesn't occur locally)
[9056357] Drop Python 3.7 support
[e03a03f] Try the ubuntu-22.04 runner on GitHub Actions
[4b01682] It seems there are no ubuntu-18.04 runners any more in GH actions. Let's see if the tests run on Mac OS, Windows.
Reduce the number of Python versions tested to keep the total test matrix size reasonable.
alcrene and others added 9 commits April 11, 2025 11:19
This is a partial solution to making projects portable: rather than
hardcoding the entire path in .smt/projects, only the path relative
to the home directory is hardcoded.
This commit simply adds `os.path.expanduser` in the relevant places,
allowing paths can be specified with '~' to indicate the home directory.
It does not provide a mechanism to change how they are written to
the project file; to make the project file portable, it needs to be edited
by hand. If the project file is re-saved (e.g. with smt configure),
the changes are overwritten.

(cherry picked from commit 235abc0)
Importing `pkg_resources` causes errors on recent Python.
The functionality we use is available as `import.resources.files`
since Python 3.9;
for Python 3.7 and 3.8, the backport `import_resources` is used;
for Python ≤3.6, the old implementation with `pkg_resources` is used.

(cherry picked from commit 7b9fb6d)
As far as I know, there is no advantage to using `f = open() ... f.close()
when a `with open() as f:` will do. The `with` form deals better with
corner cases where program execution ends unexpectedly, and is
generally more Pythonic.

(cherry picked from commit d5528a7)
Adds the SerialTqdmLaunchMode, which disables stderr capture.
This option to leave stderr as-is is propagated through a new keyword argument
to `run()`.

(cherry picked from commit 2a07202)
In cases where record parameters are malformed, they may not load
correctly as a dict, and then `rec.parameters.pop` raises AttributeError.
One may still want to compare the record to another however – for example,
to identify differences with a record where parameters are not malformed.
Adding a `hasattr` guard helps with this corner case, and as far as
I can tell has no downsides.

(cherry picked from commit 20abf3d)
(probably not detected earlier since I no longer had R installed, so these tests were being skipped)
@apdavison apdavison merged commit af74387 into master Apr 11, 2025
8 checks passed
@apdavison apdavison added this to the 0.8 milestone Apr 11, 2025
@apdavison apdavison deleted the updates branch April 14, 2025 11:03
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.

3 participants