Browse Source

Version fix for 2022.3

Joachim M. Giæver 2 years ago
parent
commit
59102373f6
2 changed files with 11 additions and 16 deletions
  1. 4 11
      snap/plugins/python_wot_plugin.py
  2. 7 5
      snap/snapcraft.yaml

+ 4 - 11
snap/plugins/python_wot_plugin.py

@@ -17,17 +17,10 @@ for python >= 3.7, see:
 class PluginImpl(plugins.python.PythonPlugin):
 class PluginImpl(plugins.python.PythonPlugin):
     def get_build_commands(self) -> List[str]:
     def get_build_commands(self) -> List[str]:
         cmds = super().get_build_commands()
         cmds = super().get_build_commands()
-        #  cmds.insert(1, 'python3 -m pip install --upgrade pip');
-        #  cmds.insert(2, 'python3 -m pip install -U "setuptools<58"')
-        #cmds.insert(1, 'pip install --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org --upgrade pip')
         for idx, cmd in enumerate(cmds):
         for idx, cmd in enumerate(cmds):
-            if cmd.strip().startswith('pip install -c'):
+            if cmd.strip().startswith('pip install -c') and "requirements_all" in cmd:
                 cmds[idx] = f"{cmd.strip()} --use-deprecated=legacy-resolver"
                 cmds[idx] = f"{cmd.strip()} --use-deprecated=legacy-resolver"
-            # Find position where to inject pip uninstall
-            #  if cmd.strip().startswith('[ -f setup.py ]'):
-            #      xcmds = cmd.split("&&", 1)
-            #      # Inject and force removal
-            #      # cmds[idx] = f"{xcmds[0]} && pip uninstall -y typing uuid && {xcmds[1]}"
-            #      cmds[idx] = f"{xcmds[0]} && pip uninstall -y typing uuid && {xcmds[1]}"
-        #  print(cmds)
+            elif "[ -f setup.py ]" in cmd:
+                # Use cfg instead of py
+                cmds[idx] = cmd.replace('[ -f setup.py ]', '"${SNAPCRAFT_PYTHON_INTERPRETER}" -m build')
         return cmds
         return cmds

+ 7 - 5
snap/snapcraft.yaml

@@ -1,6 +1,6 @@
 name: home-assistant-snap
 name: home-assistant-snap
 title: Home assistant
 title: Home assistant
-version: '2022.4.0'
+version: '2022.3.8'
 icon: snap/gui/home-assistant-snap.svg
 icon: snap/gui/home-assistant-snap.svg
 summary: Open source home automation that puts local control and privacy first
 summary: Open source home automation that puts local control and privacy first
 description: |
 description: |
@@ -157,7 +157,7 @@ apps:
 parts:
 parts:
   python:
   python:
     plugin: autotools
     plugin: autotools
-    source: https://www.python.org/ftp/python/3.9.8/Python-3.9.8.tgz
+    source: https://www.python.org/ftp/python/3.9.12/Python-3.9.12.tgz
     autotools-configure-parameters:
     autotools-configure-parameters:
       - --enable-optimizations
       - --enable-optimizations
     build-packages:
     build-packages:
@@ -211,10 +211,11 @@ parts:
     build-environment:
     build-environment:
       - SNAPCRAFT_PYTHON_INTERPRETER: python3.9
       - SNAPCRAFT_PYTHON_INTERPRETER: python3.9
     python-packages:
     python-packages:
-      #- setuptools #<58
+      - setuptools #<58
       - wheel
       - wheel
       - Cython
       - Cython
-      #- pip
+      - pip
+      - build
     build-packages:
     build-packages:
       - autoconf
       - autoconf
       - build-essential
       - build-essential
@@ -242,7 +243,7 @@ parts:
       - libxml2-dev
       - libxml2-dev
       - libxslt1-dev
       - libxslt1-dev
       - pkg-config
       - pkg-config
-      # - python3-pip
+        #- python3-pip
       - python3.9-dev
       - python3.9-dev
       - zlib1g-dev
       - zlib1g-dev
       - on arm64:
       - on arm64:
@@ -270,6 +271,7 @@ parts:
       - -lib/python3.9/site-packages/homeassistant/components/updater
       - -lib/python3.9/site-packages/homeassistant/components/updater
       - -lib/python3.9/site-packages/aiogithubapi*
       - -lib/python3.9/site-packages/aiogithubapi*
     requirements:
     requirements:
+      - requirements.txt
       - requirements_all.txt
       - requirements_all.txt
     constraints:
     constraints:
       - homeassistant/package_constraints.txt
       - homeassistant/package_constraints.txt