Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Auto Updater!
#1
Star 
Do any of you know how to make a python app, update itself?

Example:
Example1.py is version 1
I release version 2 on github - Example2.py
Example1.py downloads and replaces it with Example2.py (Version 2)

Thanks!
Reply
#2
check https://www.pyupdater.org/
Note, I didn't use it
Oshadha likes this post
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
(Mar-13-2021, 10:00 AM)buran Wrote: check https://www.pyupdater.org/
Note, I didn't use it

Error:
C:\Users\User>pip install --upgrade PyUpdater[all] Collecting PyUpdater[all] Using cached PyUpdater-3.1.1-py2.py3-none-any.whl (76 kB) Collecting bsdiff4==1.1.5 Using cached bsdiff4-1.1.5.tar.gz (8.3 kB) Requirement already satisfied: urllib3<2.0,>=1.24.1 in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from PyUpdater[all]) (1.26.2) Collecting stevedore<2.0,>=1.30.1 Using cached stevedore-1.32.0-py2.py3-none-any.whl (43 kB) Collecting PyUpdater[all] Using cached PyUpdater-3.0.1.tar.gz (63 kB) Requirement already satisfied: appdirs>=1.4.3 in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from PyUpdater[all]) (1.4.4) Requirement already satisfied: certifi>=2019.3.9 in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from PyUpdater[all]) (2020.12.5) Collecting dsdev-utils>=1.0.2 Using cached dsdev-utils-1.0.4.tar.gz (25 kB) Collecting pure25519==0.0.1 Using cached pure25519-0.0.1.tar.gz (17 kB) Requirement already satisfied: pyinstaller>=3.0 in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from PyUpdater[all]) (4.1) Requirement already satisfied: six<2.0,>=1.12.0 in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from PyUpdater[all]) (1.15.0) Collecting PyUpdater[all] Using cached PyUpdater-2.5.3.tar.gz (63 kB) Collecting bsdiff4==1.1.4 Using cached bsdiff4-1.1.4.tar.gz (9.1 kB) Collecting ed25519==1.4 Using cached ed25519-1.4.tar.gz (866 kB) Collecting PyUpdater-s3-Plugin>=3.0.6 Using cached PyUpdater_S3_Plugin-4.1.2-py2.py3-none-any.whl (4.2 kB) Collecting PyUpdater-scp-Plugin>=3.0.5 Using cached PyUpdater_SCP_Plugin-4.0.3-py2.py3-none-any.whl (4.8 kB) Requirement already satisfied: chardet in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from dsdev-utils>=1.0.2->PyUpdater[all]) (3.0.4) Requirement already satisfied: pyinstaller-hooks-contrib>=2020.6 in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from pyinstaller>=3.0->PyUpdater[all]) (2020.10) Requirement already satisfied: pefile>=2017.8.1 in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from pyinstaller>=3.0->PyUpdater[all]) (2019.4.18) Requirement already satisfied: setuptools in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from pyinstaller>=3.0->PyUpdater[all]) (53.0.0) Requirement already satisfied: pywin32-ctypes>=0.2.0 in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from pyinstaller>=3.0->PyUpdater[all]) (0.2.0) Requirement already satisfied: altgraph in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from pyinstaller>=3.0->PyUpdater[all]) (0.17) Requirement already satisfied: future in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from pefile>=2017.8.1->pyinstaller>=3.0->PyUpdater[all]) (0.18.2) Collecting boto3>=1.9.0 Using cached boto3-1.17.27-py2.py3-none-any.whl (130 kB) Collecting s3transfer<0.4.0,>=0.3.0 Using cached s3transfer-0.3.4-py2.py3-none-any.whl (69 kB) Collecting jmespath<1.0.0,>=0.7.1 Using cached jmespath-0.10.0-py2.py3-none-any.whl (24 kB) Collecting botocore<1.21.0,>=1.20.27 Downloading botocore-1.20.27-py2.py3-none-any.whl (7.3 MB) |████ | 962 kB 1.3 MB/s eta 0:00:05ERROR: Exception: Traceback (most recent call last): File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 171, in _merge_into_criterion crit = self.state.criteria[name] KeyError: 'botocore' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\urllib3\response.py", line 438, in _error_catcher yield File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\urllib3\response.py", line 519, in read data = self._fp.read(amt) if not fp_closed else b"" File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 62, in read data = self.__fp.read(amt) File "c:\users\user\appdata\local\programs\python\python39\lib\http\client.py", line 458, in read n = self.readinto(b) File "c:\users\user\appdata\local\programs\python\python39\lib\http\client.py", line 502, in readinto n = self.fp.readinto(b) File "c:\users\user\appdata\local\programs\python\python39\lib\socket.py", line 704, in readinto return self._sock.recv_into(b) File "c:\users\user\appdata\local\programs\python\python39\lib\ssl.py", line 1241, in recv_into return self.read(nbytes, buffer) File "c:\users\user\appdata\local\programs\python\python39\lib\ssl.py", line 1099, in read return self._sslobj.read(len, buffer) ssl.SSLError: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2622) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\cli\base_command.py", line 189, in _main status = self.run(options, args) File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\cli\req_command.py", line 178, in wrapper return func(self, options, args) File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\commands\install.py", line 316, in run requirement_set = resolver.resolve( File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\resolution\resolvelib\resolver.py", line 121, in resolve self._result = resolver.resolve( File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 453, in resolve state = resolution.resolve(requirements, max_rounds=max_rounds) File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 347, in resolve failure_causes = self._attempt_to_pin_criterion(name, criterion) File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 207, in _attempt_to_pin_criterion criteria = self._get_criteria_to_update(candidate) File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 199, in _get_criteria_to_update name, crit = self._merge_into_criterion(r, parent=candidate) File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 173, in _merge_into_criterion crit = Criterion.from_requirement(self._p, requirement, parent) File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 82, in from_requirement if not cands: File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\resolvelib\structs.py", line 124, in __bool__ return bool(self._sequence) File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 143, in __bool__ return any(self) File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 38, in _iter_built candidate = func() File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\resolution\resolvelib\factory.py", line 167, in _make_candidate_from_link self._link_candidate_cache[link] = LinkCandidate( File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 300, in __init__ super().__init__( File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 144, in __init__ self.dist = self._prepare() File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 226, in _prepare dist = self._prepare_distribution() File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 311, in _prepare_distribution return self._factory.preparer.prepare_linked_requirement( File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\operations\prepare.py", line 457, in prepare_linked_requirement return self._prepare_linked_requirement(req, parallel_builds) File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\operations\prepare.py", line 480, in _prepare_linked_requirement local_file = unpack_url( File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\operations\prepare.py", line 230, in unpack_url file = get_http_url( File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\operations\prepare.py", line 108, in get_http_url from_path, content_type = download(link, temp_dir.path) File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\network\download.py", line 163, in __call__ for chunk in chunks: File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\cli\progress_bars.py", line 159, in iter for x in it: File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\network\utils.py", line 64, in response_chunks for chunk in response.raw.stream( File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\urllib3\response.py", line 576, in stream data = self.read(amt=amt, decode_content=decode_content) File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\urllib3\response.py", line 541, in read raise IncompleteRead(self._fp_bytes_read, self.length_remaining) File "c:\users\user\appdata\local\programs\python\python39\lib\contextlib.py", line 135, in __exit__ self.gen.throw(type, value, traceback) File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\urllib3\response.py", line 449, in _error_catcher raise SSLError(e) pip._vendor.urllib3.exceptions.SSLError: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2622)
Reply
#4
Is Gitea a good option?
Reply
#5
(Mar-13-2021, 10:18 AM)Oshadha Wrote: Is Gitea a good option?

It is described as selfhosted Git service, i.e. alternative to GitHub, GitLab, BitBucket
i.e. auto-update functionality and code hosting/version control are different things, right?
Oshadha likes this post
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#6
as to the error, I would try to download the botocore wheel locally and try to install it
Oshadha likes this post
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#7
Can you make python read a file in github and download that file?
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020