Skip to content

Commit ebbfeaa

Browse files
committed
Fix name conflict for utils.py
1 parent 1be1310 commit ebbfeaa

File tree

8 files changed

+12
-9
lines changed

8 files changed

+12
-9
lines changed

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
pip --cache-dir=.pip install pylint
6363
pip --cache-dir=.pip install -r requirements.txt
6464
- name: Run Pylint
65-
run: pylint startup tests f3.py kernel_remover.py maintenance.py modem.py utils.py 2>&1 | tee pylint.txt
65+
run: pylint startup tests f3.py kernel_remover.py maintenance.py modem.py misc_misc_utils.py 2>&1 | tee pylint.txt
6666
working-directory: ${{ github.workspace }}
6767
- name: Upload results
6868
uses: actions/upload-artifact@v2

crypto/ethminer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
REPO_DIR = os.path.dirname(SCRIPT_DIR)
1919
LOG_DIR = os.path.join(REPO_DIR, "logs")
2020
sys.path.append(REPO_DIR)
21-
import utils
21+
import misc_utils as utils
2222

2323
logger = logging.getLogger(__name__)
2424
logging.basicConfig(

maintenance.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
import time
1313
import typing as tp
1414

15-
import utils
16-
from utils import print_info, run
15+
import misc_utils as utils
16+
from misc_utils import print_info, run
1717

1818
log_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "logs")
1919
os.makedirs(log_path, exist_ok=True)

utils.py renamed to misc_utils.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""
22
Utility methods for scripts
3+
4+
This file cannot be named utils.py due to naming conflicts with installed packages.
35
"""
46

57
import getpass

testing/f3.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import os.path
1010
import time
1111

12-
import utils
12+
import misc_utils as utils
1313

1414
logger = logging.getLogger(__name__)
1515
log_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "logs")

tests/test_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import unittest
22

3-
import utils
3+
import misc_utils as utils
44

55

66
class UtilsTestCase(unittest.TestCase):

wacom/install_wacom.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ TABLET_USER="${USER}"
1111

1212
sudo apt-get install python3-xlib
1313
echo "Installing the launcher."
14-
sudo cp ./99-wacom-tablet*.rules "/etc/udev/rules.d/"
15-
sudo cp "./wacom.sh" "/usr/local/bin/"
14+
sudo cp "${SCRIPT_DIR}"/99-wacom-tablet*.rules "/etc/udev/rules.d/"
15+
sudo cp "${SCRIPT_DIR}/wacom.sh" "/usr/local/bin/"
1616
sudo chown root:root /etc/udev/rules.d/99-wacom-tablet*.rules "/usr/local/bin/wacom.sh"
1717
sudo chmod 0644 /etc/udev/rules.d/99-wacom-tablet*.rules
1818
sudo chmod 0755 "/usr/local/bin/wacom.sh"
@@ -21,4 +21,5 @@ sudo chmod 0755 "/usr/local/bin/wacom.sh"
2121
sudo sed -i "s+USERNAME+${TABLET_USER}+g; s+SCRIPT_DIR+${SCRIPT_DIR}+g" "/usr/local/bin/wacom.sh"
2222

2323
sudo udevadm control --reload-rules
24+
/usr/local/bin/wacom.sh
2425
echo "Launcher installed."

wacom/wacom.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
REPO_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
3232
sys.path.append(REPO_DIR)
3333

34-
import utils
34+
import misc_utils as utils
3535

3636
XSETWACOM: str = "/usr/bin/xsetwacom"
3737

0 commit comments

Comments
 (0)