bcpkgfox 0.16.5b3__tar.gz → 0.16.5b4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bcpkgfox
3
- Version: 0.16.5b3
3
+ Version: 0.16.5b4
4
4
  Summary: Biblioteca BCFOX
5
5
  Home-page: https://github.com/robotsbcfox/PacotePythonBCFOX
6
6
  Author: Guilherme Neri
@@ -275,6 +275,7 @@ class cli:
275
275
  self.error = 0
276
276
  self.descerror = ""
277
277
  self.visuals = self.cli.visuals
278
+ self.ultimate_error = None
278
279
 
279
280
  def preparations(self):
280
281
  self.current_dir = os.getcwd()
@@ -389,12 +390,25 @@ class cli:
389
390
  else:
390
391
  print("Error: 'dist' directory not found!")
391
392
 
392
- shutil.make_archive(new_path, 'zip', new_path)
393
- os.remove(new_path)
393
+ zip_path = shutil.make_archive(new_path, 'zip', new_path)
394
+
395
+ # Espera o sistema liberar o zip
396
+ wait = 0
397
+ while True:
398
+ try:
399
+ with open(zip_path, 'rb'):
400
+ break
401
+ except (PermissionError, OSError):
402
+ time.sleep(0.1)
403
+ wait += 1
404
+ if wait >= 600:
405
+ raise TimeoutError("Timeout while waiting for zip file to be accessible.")
406
+
407
+ shutil.rmtree(new_path)
394
408
  zip_log = True
395
409
 
396
410
  except Exception as e:
397
- print(e)
411
+ self.ultimate_error = e
398
412
 
399
413
  finally:
400
414
  animation.finish()
@@ -402,7 +416,8 @@ class cli:
402
416
  if zip_log:
403
417
  print(f"{self.visuals.bold}{self.visuals.GR} > Zip file created successfully {self.visuals.RESET}\n")
404
418
  else:
405
- print(f"{self.visuals.bold}{self.visuals.RD} > Error creating zip file {self.visuals.RESET}\n")
419
+ print(f"{self.visuals.bold}{self.visuals.RD} > Error creating zip file:\n")
420
+ print(f"{self.ultimate_error}{self.visuals.RESET}")
406
421
  sys.exit(1)
407
422
 
408
423
  def main(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bcpkgfox
3
- Version: 0.16.5b3
3
+ Version: 0.16.5b4
4
4
  Summary: Biblioteca BCFOX
5
5
  Home-page: https://github.com/robotsbcfox/PacotePythonBCFOX
6
6
  Author: Guilherme Neri
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="bcpkgfox",
5
- version="0.16.5b3",
5
+ version="0.16.5b4",
6
6
  author="Guilherme Neri",
7
7
  author_email="guilherme.neri@bcfox.com.br",
8
8
  description="Biblioteca BCFOX",
File without changes
File without changes