Skip to content

Conversation

@MarcelGeo
Copy link
Contributor

@MarcelGeo MarcelGeo commented Sep 10, 2025

  • fix temp file params , which are not available in python under 3.10
  • downgade python for tests to 3.8 as discussed with @wonder-sk for support legacy QGIS 3.22

@MarcelGeo MarcelGeo marked this pull request as draft September 11, 2025 07:32
@MarcelGeo MarcelGeo marked this pull request as ready for review September 11, 2025 08:06
@MarcelGeo
Copy link
Contributor Author

We can discuss if run tests against 3.7 or 3.8 version.

Copy link
Contributor

@JanCaha JanCaha left a comment

Choose a reason for hiding this comment

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

Functionally it looks ok.

But I do not quite like that we do these changes to support that old version of the Python. Seems like we create technical debt on purpose

mergin/utils.py Outdated
tmp_dir.cleanup()
except PermissionError:
mp.log.warning(f"Permission error during tmp dir cleanup: {tmp_dir.name}")
pass # Ignore the error and continue
Copy link
Contributor

Choose a reason for hiding this comment

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

the pass here and also below is not necessary, there is another statement in the except block

Copy link
Contributor

Choose a reason for hiding this comment

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

Given that we support QGIS versions 3.22+ we can not use concepts from Python versions 3.9+

Copy link
Contributor Author

Choose a reason for hiding this comment

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

😶‍🌫️ true

Copy link
Contributor

@wonder-sk wonder-sk left a comment

Choose a reason for hiding this comment

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

There are few more places where the explicit cleanup of temporary dir should be added:

  • in download_project_cancel()
  • in download_project_finalize() when raising exceptions
  • in similar calls for pull and push

@MarcelGeo MarcelGeo changed the title Move tests to version 3.7 + fix tempdir handling in older python Move tests to version 3.10 + fix tempdir handling in older python Sep 11, 2025
@MarcelGeo
Copy link
Contributor Author

MarcelGeo commented Sep 11, 2025

There are few more places where the explicit cleanup of temporary dir should be added:

* in download_project_cancel()

* in download_project_finalize() when raising exceptions

* in similar calls for pull and push

Try to look at this in commit @wonder-sk , thanks

@MarcelGeo MarcelGeo changed the title Move tests to version 3.10 + fix tempdir handling in older python Move tests to version 3.8 + fix tempdir handling in older python Sep 12, 2025
@MarcelGeo MarcelGeo merged commit 4ad9bbf into master Sep 12, 2025
4 of 5 checks passed
@MarcelGeo MarcelGeo deleted the python-37-tests branch September 12, 2025 11:45
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.

4 participants