Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved versioning #738

Merged
merged 10 commits into from
Nov 19, 2023
Merged

Improved versioning #738

merged 10 commits into from
Nov 19, 2023

Commits on Nov 19, 2023

  1. Move fallback version to VERSION file

    Previously, if not installed and no git version could be deduced,
    a hardcoded 3.0.2 version was used. Now, this fallback version is moved
    into an external VERSION file and is changed to "unreleased" instead of
    "3.0.2", to ensure that a proper version is only returned when it is
    really correct.
    
    This also makes it easier to update the version number for releases, and
    prepares for having a single place in the code to store the release version.
    matthijskooijman committed Nov 19, 2023
    Configuration menu
    Copy the full SHA
    5fd8ae2 View commit details
    Browse the repository at this point in the history
  2. Move version detection into its own file

    This prepares for using this code from waf, since it can now be imported
    without additional (gtk) dependencies.
    matthijskooijman committed Nov 19, 2023
    Configuration menu
    Copy the full SHA
    5dc1074 View commit details
    Browse the repository at this point in the history
  3. Remove duplicated version detection code from waf/wscript

    This allows running the src/hamster/version.py file as a standalone
    script that just outputs the version number and lets wscript call that.
    
    This ensures that the exact same version number is used between
    installed and non-installed versions, and removes the second place where
    the release version was previously hardcoded.
    
    To do this, the version.py code is split into a part that decides the
    version when installed, and a bit that decides the version when running
    from the source tree. This is needed since when running the script from
    waf, sys.path is not set up to allow importing hamster.defs, and trying
    this might result in importing hamster.defs from a system-wide installed
    hamster instead of the current source dir. So just skip the
    installed-version detection entirely when running from waf, it is not
    relevant anyway.
    matthijskooijman committed Nov 19, 2023
    Configuration menu
    Copy the full SHA
    99cef05 View commit details
    Browse the repository at this point in the history
  4. Strip v prefix when using git tag as version number

    Released versions omitted the v prefix (to make proper semantic
    versions), but version numbers autodetected from git would not, leading
    to discrepancies. This fixes that.
    matthijskooijman committed Nov 19, 2023
    Configuration menu
    Copy the full SHA
    e9a6a35 View commit details
    Browse the repository at this point in the history
  5. Drop .GUI from metainfo.xml file

    This file is mostly used by packaging tools, such as flatpak, to get
    info about the application. Since flatpak uses org.gnome.Hamster as the
    main package id, the metainfo.xml must be named the same for it to be
    used.
    
    Possibly more things need to be renamed for all application ids to be
    consistent, but it is non-obvious what the best approach is there (see
    also #725 for details). For now, this pragmatically renames metainfo.xml
    to ensure it is found by flatpak.
    matthijskooijman committed Nov 19, 2023
    Configuration menu
    Copy the full SHA
    9ac904b View commit details
    Browse the repository at this point in the history
  6. Add version number to metainfo.xml file

    This is now done by waf at install time and ensures that flatpak knows
    the hamster version of the build.
    matthijskooijman committed Nov 19, 2023
    Configuration menu
    Copy the full SHA
    8a82dc3 View commit details
    Browse the repository at this point in the history
  7. Hardcode fake release date in metainfo.xml

    Without a release date, flatpak ignores the version number, but
    autodetecting the release date (and carrying it into tarballs) might be
    too much work, so just hardcode an obviously fake date for now.
    matthijskooijman committed Nov 19, 2023
    Configuration menu
    Copy the full SHA
    5bdd423 View commit details
    Browse the repository at this point in the history
  8. Remove .bumpversion.cfg

    This was not actually used in practice and no longer matches the recent
    changes to the version handling, so remove it.
    matthijskooijman committed Nov 19, 2023
    Configuration menu
    Copy the full SHA
    7b51320 View commit details
    Browse the repository at this point in the history
  9. Remove setup.py

    This was added a long time ago only for the database backend, but seems
    to be outdated. In general, hamster cannot be installed using setup.py
    anyway, since it requires dbus service files, gsettings schemas, etc. so
    waf is used for all that. Remove setup.py which is no longer used
    anyway.
    
    This fixes #581.
    matthijskooijman committed Nov 19, 2023
    Configuration menu
    Copy the full SHA
    3875623 View commit details
    Browse the repository at this point in the history
  10. CI: Let github workflow use version number in the flatpak filename

    Note: For pull requests, the version that is tested is an autogenerated
    temporary merge commit (which is good, since it tests whether things
    work *after* merging), but that commit id is also included in the
    filename which might be bit suprising. To be considered later.
    matthijskooijman committed Nov 19, 2023
    Configuration menu
    Copy the full SHA
    c062980 View commit details
    Browse the repository at this point in the history