Explorar o código

Version fix for 2022.3

Joachim M. Giæver %!s(int64=2) %!d(string=hai) anos
pai
achega
59102373f6
Modificáronse 2 ficheiros con 11 adicións e 16 borrados
  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):
     def get_build_commands(self) -> List[str]:
         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):
-            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"
-            # 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

+ 7 - 5
snap/snapcraft.yaml

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