diff --git a/Dockerfile b/Dockerfile index f1419c0..37b6199 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ RUN apt-get update && \ python3-pip \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* \ - && python3 -m pip install --no-cache-dir --upgrade pip setuptools wheel + && python3 -m pip install --no-cache-dir --upgrade "pip>=21.3" setuptools wheel # Add architecture-specific compiler flags if needed ENV ARCHFLAGS="" @@ -24,7 +24,7 @@ RUN mkdir -p /app/src/simpleguardhome && \ chmod -R 755 /app # Copy source code, maintaining directory structure -COPY setup.py requirements.txt /app/ +COPY setup.py requirements.txt pyproject.toml /app/ COPY src /app/src/ # Set PYTHONPATH @@ -37,10 +37,8 @@ RUN pip install --no-cache-dir -r requirements.txt RUN set -e && \ echo "Installing package..." && \ pip uninstall -y simpleguardhome || true && \ - # First install dependencies only - pip install --no-deps -v -e . && \ - # Then install package with dependencies - pip install -e . && \ + # Install package in editable mode with compatibility mode enabled + pip install --use-pep517 -e . --config-settings editable_mode=compat && \ echo "Verifying installation..." && \ pip show simpleguardhome && \ # List all package files diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..b264e78 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,29 @@ +[build-system] +requires = ["setuptools>=64.0.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "simpleguardhome" +version = "0.1.0" +description = "SimpleGuardHome - A lightweight AdGuardHome UI" +authors = [ + {name = "SimpleGuardHome Team"} +] +readme = "README.md" +license = {file = "LICENSE"} +requires-python = ">=3.7" +dependencies = [ + "fastapi", + "uvicorn", + "python-dotenv", + "httpx", + "pydantic", + "jinja2", +] + +[tool.setuptools] +package-dir = {"" = "src"} +packages = {find = {where = ["src"]}} + +[tool.setuptools.package-data] +simpleguardhome = ["templates/*", "favicon.ico"] \ No newline at end of file diff --git a/setup.py b/setup.py index d0f350a..fc1f76c 100644 --- a/setup.py +++ b/setup.py @@ -1,22 +1,3 @@ -from setuptools import setup, find_packages -from pathlib import Path +from setuptools import setup -setup( - name="simpleguardhome", - version="0.1.0", - packages=find_packages(where="src"), - package_dir={"": "src"}, - include_package_data=True, - package_data={ - "simpleguardhome": ["templates/*", "favicon.ico"] - }, - python_requires=">=3.7", - install_requires=[ - "fastapi", - "uvicorn", - "python-dotenv", - "httpx", - "pydantic", - "jinja2", - ], -) \ No newline at end of file +setup() \ No newline at end of file diff --git a/src/simpleguardhome/templates/index.html b/src/simpleguardhome/templates/index.html index ef5fa32..0d1c463 100644 --- a/src/simpleguardhome/templates/index.html +++ b/src/simpleguardhome/templates/index.html @@ -4,7 +4,8 @@ SimpleGuardHome - + +