#11 F35: Update to 3.3 + backport fix for finishing esptool when the port can't be open
Merged 2 years ago by ksurma. Opened 2 years ago by ksurma.
rpms/ ksurma/esptool ffinish  into  f35

file modified
+3
@@ -12,3 +12,6 @@ 

  /esptool-2.8.tar.gz

  /esptool-3.0.tar.gz

  /esptool-3.1.tar.gz

+ /esptool-3.2.tar.gz

+ /esptool-3.3.tar.gz

+ /esptool-3.3.1.tar.gz

file removed
-30
@@ -1,30 +0,0 @@ 

- From 3f2746ad05067aad960f7a08e53f6e72c5eecd07 Mon Sep 17 00:00:00 2001

- From: Bartosz Bilas <b.bilas@grinn-global.com>

- Date: Sat, 12 Jun 2021 13:50:15 +0200

- Subject: [PATCH] setup.py: require wheel only when installing from pip

- 

- Fix the build from sources (that don't require wheel)

- in environments where this module is not available.

- 

- Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>

- ---

-  setup.py | 6 +++++-

-  1 file changed, 5 insertions(+), 1 deletion(-)

- 

- diff --git a/setup.py b/setup.py

- index 2b17b28..1a8421d 100644

- --- a/setup.py

- +++ b/setup.py

- @@ -110,7 +110,11 @@ def find_version(*file_paths):

-          'Programming Language :: Python :: 3.8',

-          'Programming Language :: Python :: 3.9',

-      ],

- -    setup_requires=['wheel'] if sys.version_info[0:2] not in [(3, 4), (3, 5)] else [],

- +    setup_requires=(

- +        ['wheel']

- +        if 'bdist_wheel' in sys.argv and sys.version_info[0:2] not in [(3, 4), (3, 5)] else

- +        []

- +    ),

-      extras_require={

-          "dev": [

-              'flake8>=3.2.0',

@@ -0,0 +1,28 @@ 

+ From 833915ed26aa8352c25a679771c04a2480154766 Mon Sep 17 00:00:00 2001

+ From: Karolina Surma <ksurma@redhat.com>

+ Date: Mon, 13 Jun 2022 11:38:42 +0200

+ Subject: [PATCH] Gracefully finish esptool when port cannot be open

+ 

+ ---

+  esptool.py | 5 ++++-

+  1 file changed, 4 insertions(+), 1 deletion(-)

+ 

+ diff --git a/esptool.py b/esptool.py

+ index 7b107ab..30d3e78 100755

+ --- a/esptool.py

+ +++ b/esptool.py

+ @@ -317,7 +317,10 @@ class ESPLoader(object):

+          self.stub_is_disabled = False  # flag is set to True if esptool detects conditions which require the stub to be disabled

+  

+          if isinstance(port, basestring):

+ -            self._port = serial.serial_for_url(port)

+ +            try:

+ +                self._port = serial.serial_for_url(port)

+ +            except serial.serialutil.SerialException:

+ +                raise FatalError(f"Could not open {port}, the port doesn't exist")

+          else:

+              self._port = port

+          self._slip_reader = slip_reader(self._port, self.trace)

+ -- 

+ 2.35.3

+ 

file modified
+44 -24
@@ -1,25 +1,21 @@ 

  Name:           esptool

- Version:        3.1

- Release:        2%{?dist}

+ Version:        3.3.1

+ Release:        1%{?dist}

  Summary:        A utility to communicate with the ROM bootloader in Espressif ESP8266 & ESP32

  

  License:        GPLv2+

- URL:            https://github.com/themadinventor/%{name}

+ URL:            https://github.com/espressif/%{name}

  Source0:        %pypi_source

  BuildArch:      noarch

  

- # esptool 3.1 added dependency on wheel to solve problem occuring when installing via pip

- # As this is not needed in our environment, we backport a patch that doesn't make it mandatory

- # It shall land in esptool 3.2

- Patch1:         https://github.com/espressif/esptool/pull/632.patch

- 

  BuildRequires:  python3-devel

- BuildRequires:  python3-setuptools

- 

- %?python_enable_dependency_generator

  

  Provides:       %{name}.py = %{version}-%{release}

  

+ # Gracefully finish esptool when the port cannot be open

+ # Merged upstream: https://github.com/espressif/esptool/pull/751

+ Patch:          Gracefully-finish-esptool-when-port-cannot-be-open.patch

+ 

  %description

  %{name}.py A command line utility to communicate with the ROM bootloader in

  Espressif ESP8266 & ESP32 WiFi microcontroller. Allows flashing firmware,
@@ -29,25 +25,34 @@ 

  

  %prep

  %autosetup -p1

- pathfix.py -i %{__python3} -pn esp*.py

  

- %build

- %py3_build

  

- # Shebangs in site-packages

- grep -r '^#!' build/lib/

- sed -i 1d $(grep -rl '^#' build/lib/)

+ %generate_buildrequires

+ %pyproject_buildrequires

+ 

+ 

+ %build

+ %pyproject_wheel

  

  

  %install

- %py3_install

+ %pyproject_install

+ %pyproject_save_files esptool espefuse espsecure espressif

+ 

+ # Remove shebangs from site-packages

+ grep -r '^#!' %{buildroot}%{python3_sitelib}

+ sed -i 1d $(grep -rl '^#!' %{buildroot}%{python3_sitelib})

+ 

  for NAME in %{name} espefuse espsecure ; do

    ln -s ./$NAME.py %{buildroot}%{_bindir}/$NAME

  done

  

  

- %files

- %license LICENSE

+ %check

+ %pyproject_check_import

+ 

+ 

+ %files -f %{pyproject_files}

  %doc README.md

  %{_bindir}/%{name}

  %{_bindir}/%{name}.py
@@ -55,12 +60,27 @@ 

  %{_bindir}/espefuse.py

  %{_bindir}/espsecure

  %{_bindir}/espsecure.py

- %{python3_sitelib}/espressif/

- %{python3_sitelib}/esp*.py*

- %{python3_sitelib}/%{name}-%{version}-py%{python3_version}.egg-info

- %{python3_sitelib}/__pycache__/esp*.*.pyc

+ 

  

  %changelog

+ * Wed Jun 22 2022 Karolina Surma <ksurma@redhat.com> - 3.3.1-1

+ - Update to 3.3.1

+ 

+ * Mon Jun 13 2022 Karolina Surma <ksurma@redhat.com> - 3.3-2

+ - Gracefully finish esptool when port can't be open

+ Resolves: rhbz#2092910

+ 

+ * Mon Apr 11 2022 Karolina Surma <ksurma@redhat.com> - 3.3-1

+ - Update to 3.3

+ Resolves: rhbz#2066963

+ 

+ * Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.2-2

+ - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

+ 

+ * Wed Nov 03 2021 Karolina Surma <ksurma@redhat.com> - 3.2-1

+ - Update to 3.2

+ Resolves: rhbz#2017113

+ 

  * Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.1-2

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

  

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- SHA512 (esptool-3.1.tar.gz) = c8c360213911125244d8e9c5460a82a026545b5e09a518ca92af4e3155770ed2333169aa64a4ff7df38519be7074f040b03685f231fd7a6e617ba5e1b6ee6913

+ SHA512 (esptool-3.3.1.tar.gz) = 28d68c52dc00daf8667685e95f266e1be64f93566386ac0375e8b3e0fa5d15cbfd62031a46caf42a31cd6ee45f8b3e6df108af0f858fecff6e958b1d1301f99f

no initial comment

Build succeeded.

1 new commit added

  • Update to 3.3.1
2 years ago

Build succeeded.

This is the same as the F36 PR. But we are upgrading from 3.1 here.

I've checked https://github.com/espressif/esptool/releases/tag/v3.2 and it also seems OK to me.

+1

Pull-Request has been merged by ksurma

2 years ago