Skip to content

Commit

Permalink
Change modular imports to relative imports
Browse files Browse the repository at this point in the history
Update Dockerfile to accommodate
  • Loading branch information
dormant-user committed Oct 24, 2023
1 parent ff57e69 commit 225e822
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
15 changes: 5 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,16 @@ FROM python:3.11-alpine
# Install git
RUN apk add --no-cache git

# Create temp directory
RUN mkdir /opt/temp

# Copy validator.py to root
COPY src/* /opt/temp/
# Create a new directory in root and copy the module
RUN mkdir /none-shall-pass
COPY . /none-shall-pass

# Upgrade pip and install requests module
RUN python -m pip install --upgrade pip
RUN python -m pip install requests

# Set validator.py as executable
RUN chmod +x /opt/temp/validator.py

# Set working directory
WORKDIR /opt/temp
WORKDIR /none-shall-pass

# Set entrypoint for docker run
ENTRYPOINT ["python", "validator.py"]
ENTRYPOINT ["python", "./src/validator.py"]
2 changes: 1 addition & 1 deletion src/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import requests

from src.logger import LOGGER
from logger import LOGGER


def verify_url(hyperlink: Tuple[str, str], timeout: Tuple[int, int] = (3, 3)) -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import subprocess

from src.logger import LOGGER
from logger import LOGGER


def run_command(cmd: str) -> bool:
Expand Down
6 changes: 4 additions & 2 deletions src/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
from concurrent.futures import ThreadPoolExecutor, as_completed
from multiprocessing import Process, current_process

from src import lookup, connection, git
from src.logger import LOGGER
import connection
import git
import lookup
from logger import LOGGER

OWNER = sys.argv[1]
REPO = sys.argv[2]
Expand Down

0 comments on commit 225e822

Please sign in to comment.