qgis-deployment-cli icon indicating copy to clipboard operation
qgis-deployment-cli copied to clipboard

feat: implement dynamic versioning with setuptools_scm

Open nicogodet opened this issue 6 months ago • 4 comments

  • Replace hardcoded version with setuptools_scm integration
  • Configure setuptools_scm to write version to _version.py
  • Add fallback mechanisms for development environments
  • Update .gitignore to exclude generated _version.py

This change enables automatic version management from git tags, eliminating the need to manually update version strings.

nicogodet avatar May 24 '25 16:05 nicogodet

Codecov Report

:x: Patch coverage is 45.45455% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
qgis_deployment_toolbelt/__about__.py 25.00% 6 Missing :warning:

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #671      +/-   ##
==========================================
- Coverage   71.90%   71.88%   -0.03%     
==========================================
  Files          48       48              
  Lines        3271     3279       +8     
  Branches      576      577       +1     
==========================================
+ Hits         2352     2357       +5     
- Misses        704      705       +1     
- Partials      215      217       +2     
Flag Coverage Δ
unittests 71.24% <36.36%> (-0.03%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
qgis_deployment_toolbelt/commands/upgrade.py 68.81% <100.00%> (+3.98%) :arrow_up:
qgis_deployment_toolbelt/__about__.py 75.00% <25.00%> (-25.00%) :arrow_down:
:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar May 24 '25 16:05 codecov[bot]

AI generated?

Guts avatar May 24 '25 17:05 Guts

for version_info_templater part, yes

nicogodet avatar May 24 '25 17:05 nicogodet

@nicogodet I think we should first switch to pyproject in a dedicated PR. Check everything works as previously in packaging and then change the way of versioning.

Still I've already made those moves on other projects and it's the good things to do.

Guts avatar Jun 16 '25 11:06 Guts

You already convert this project to pyproject.toml 🧐

https://github.com/qgis-deployment/qgis-deployment-toolbelt-cli/pull/556

nicogodet avatar Jun 16 '25 12:06 nicogodet

You already convert this project to pyproject.toml 🧐

https://github.com/qgis-deployment/qgis-deployment-toolbelt-cli/pull/556

😂 I sincerely and completely forgot about this one

Guts avatar Jun 16 '25 13:06 Guts

Welcome back!

I will take a second look at it and update this PR.

nicogodet avatar Sep 03 '25 07:09 nicogodet

Thinking on this topic, I had the opportunity to work on a similar move (pyproject and dynamic versioning with scm): https://github.com/geotribu/cli/pull/281. What do you think of this approach?

Guts avatar Sep 03 '25 13:09 Guts

Yes, approach in this PR can be simplified. The logic in builder script can be simplified and I need to remember why I set PYTHONIOENCODING...

nicogodet avatar Sep 03 '25 14:09 nicogodet

I need to remember why I set PYTHONIOENCODING...

This PR looks like a memory hole :scream_cat:

Guts avatar Sep 03 '25 14:09 Guts

Need to be re-thinked...

nicogodet avatar Sep 23 '25 15:09 nicogodet