Skip to content

Commit

Permalink
IMPROVEMENT: setup.py pylint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
amilcarlucas committed Jun 12, 2024
1 parent 58cabf0 commit afbe508
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,19 @@
f"{PRJ_URL}/raw/master/images/App_screenshot1.png")

# So that the vehicle_templates directory contents get correctly read by the MANIFEST.in file
source_dir = 'vehicle_templates'
dest_dir = 'MethodicConfigurator/vehicle_templates'
TEMPLATES_SRC_DIR = 'vehicle_templates'
TEMPLATES_DST_DIR = 'MethodicConfigurator/vehicle_templates'

if os.path.exists(dest_dir):
shutil.rmtree(dest_dir)
if os.path.exists(TEMPLATES_DST_DIR):
shutil.rmtree(TEMPLATES_DST_DIR)

try:
shutil.copytree(source_dir, dest_dir)
shutil.copytree(TEMPLATES_SRC_DIR, TEMPLATES_DST_DIR)
print("Directory tree copied successfully.")
except FileExistsError as e:

Check failure on line 67 in setup.py

View workflow job for this annotation

GitHub Actions / build (3.12)

Ruff (F841)

setup.py:67:27: F841 Local variable `e` is assigned to but never used
print(f"The destination directory '{dest_dir}' already exists and cannot be overwritten.")
print(f"The destination directory '{TEMPLATES_DST_DIR}' already exists and cannot be overwritten.")
except PermissionError as e:

Check failure on line 69 in setup.py

View workflow job for this annotation

GitHub Actions / build (3.12)

Ruff (F841)

setup.py:69:27: F841 Local variable `e` is assigned to but never used
print(f"Permission denied when trying to copy '{source_dir}' to '{dest_dir}'. Please check your permissions.")
print(f"Permission denied when trying to copy '{TEMPLATES_SRC_DIR}' to '{TEMPLATES_DST_DIR}'. Please check your permissions.")
except Exception as e: # pylint: disable=broad-except
print(f"An unexpected error occurred while copying the directory tree: {e}")

Expand Down Expand Up @@ -137,5 +137,5 @@
)

# Remove the symbolic link now that the setup is done
if os.path.exists(dest_dir):
shutil.rmtree(dest_dir)
if os.path.exists(TEMPLATES_DST_DIR):
shutil.rmtree(TEMPLATES_DST_DIR)

0 comments on commit afbe508

Please sign in to comment.