[meld/build-updates: 14/26] Remove __package__ sourcing




commit 98feb2538b2141ba284a74470d6926ca29fd18d3
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Sep 11 08:51:32 2022 +1000

    Remove __package__ sourcing
    
    Ideally this would come from meson introspection, but their rewriter
    doesn't appear to support this yet. In the meantime, if we decide to
    rename the entire project then changing this constant isn't going to be
    the hard bit.

 maint | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/maint b/maint
old mode 100644
new mode 100755
index 66792246..082cedc1
--- a/maint
+++ b/maint
@@ -30,10 +30,11 @@ meld.conf = mod
 sys.modules['meld.conf'] = mod
 import meld.conf  # noqa: E402 isort:skip
 
+APPLICATION_NAME = "meld"
 
 PO_DIR = "po"
 HELP_DIR = "help"
-RELEASE_BRANCH_RE = r'%s-\d+-\d+' % meld.conf.__package__
+RELEASE_BRANCH_RE = fr"{APPLICATION_NAME}-\d+-\d+"
 UPLOAD_SERVER = 'master.gnome.org'
 GITLAB_API_BASE = 'https://gitlab.gnome.org/api/v4'
 GITLAB_PROJECT_ID = 'GNOME/meld'
@@ -199,7 +200,7 @@ def get_tokens():
         'date': datetime.date.today().isoformat(),
         # Appstream appears to expect release dates in UTC.
         'utcdate': datetime.datetime.utcnow().date().isoformat(),
-        'app': meld.conf.__package__,
+        'app': APPLICATION_NAME,
         'version': version,
         'release_series': release_series,
         'stable_release': stable_release,
@@ -371,7 +372,7 @@ def appdata():
 @cli.command()
 def dist():
     build_dir = '_build'
-    archive = '%s-%s.tar.xz' % (meld.conf.__package__, meld.conf.__version__)
+    archive = f"{APPLICATION_NAME}-{meld.conf.__version__}.tar.xz"
     dist_archive_path = os.path.abspath(
         os.path.join(build_dir, 'meson-dist', archive))
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]