diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 4c62c870..2b07ade4 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -25,7 +25,7 @@ // "forwardPorts": [], // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip3 install -r requirements.txt", + "postCreateCommand": "python -m pip install -e '.[scripts,dev]'", // Configure tool-specific properties. // "customizations": {}, diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e3a0a033..964bd6d6 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -12,13 +12,12 @@ updates: - "*" open-pull-requests-limit: 10 - package-ecosystem: pip - directory: "/" + directories: + - "/" + - "/.github/actions/**" schedule: interval: daily groups: - pydantic-deps: - patterns: - - "pydantic*" python-deps: patterns: - "*" diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml index 2b50b0ca..a38009eb 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -23,12 +23,13 @@ jobs: with: python-version: "3.x" cache: pip + cache-dependency-path: pyproject.toml - name: Install dependencies run: | set -euo pipefail python -m pip install --upgrade pip - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + pip install -e ".[scripts]" - name: Run generate run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f2985a65..fb6a6a34 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,16 +18,16 @@ jobs: with: python-version: 3.x cache: "pip" + cache-dependency-path: pyproject.toml - name: Install pip packages run: | python -m pip install --upgrade pip + pip install -e ".[dev]" - name: flake8 run: | - pip install flake8 flake8 . - name: pydocstyle run: | - pip install pydocstyle pydocstyle . unit-test: @@ -40,11 +40,12 @@ jobs: with: python-version: 3.x cache: pip + cache-dependency-path: pyproject.toml - name: Run action unit tests run: | python -m pip install --upgrade pip - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + pip install -e ".[scripts]" python -m unittest discover -s .github/actions -p 'test_*.py' - name: Run API unit tests diff --git a/.gitignore b/.gitignore index 09681cf1..cd699549 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ __pycache__ +*.egg-info/ site/ .venv/ .pytest_cache/ diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 3b2e9e6d..3af69609 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -95,13 +95,13 @@ { "label": "upgrade", "type": "shell", - "command": " pip install --upgrade pip; for i in $(pip list -o | awk 'NR > 2 {print $1}'); do pip install -U $i; done && pip freeze > requirements.txt", + "command": "python -m pip install --upgrade pip && python -m pip install --upgrade -e '.[scripts,dev]'", "problemMatcher": [] }, { "label": "install", "type": "shell", - "command": "pip3 install -r requirements.txt", + "command": "python -m pip install -e '.[scripts,dev]'", "problemMatcher": [] } ], diff --git a/README.md b/README.md index 3095f49e..dfa2ac0d 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ pip install "git+https://github.com/althack/dockerfiles.git@main" For local development (editable install): ```bash -pip install -e . +pip install -e ".[scripts,dev]" ``` Example usage: diff --git a/pyproject.toml b/pyproject.toml index 29366d6f..e92ac425 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,6 +17,17 @@ dependencies = [ "jsonschema>=4.0.0" ] +[project.optional-dependencies] +scripts = [ + "actions-toolkit>=0.1.15", + "click>=8.1", + "Jinja2>=3.1" +] +dev = [ + "flake8>=7.3", + "pydocstyle>=6.3" +] + [project.urls] Homepage = "https://github.com/althack/dockerfiles" Repository = "https://github.com/althack/dockerfiles" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 6198cf20..00000000 --- a/requirements.txt +++ /dev/null @@ -1,42 +0,0 @@ -actions-toolkit==0.1.15 -annotated-doc==0.0.5 -annotated-types==0.8.0 -attrs==26.1.0 -certifi==2026.7.22 -cffi==2.1.0 -charset-normalizer==3.4.9 -click==8.4.2 -cryptography==50.0.0 -flake8==7.3.0 -idna==3.18 -Jinja2==3.1.6 -jsonschema==4.26.0 -jsonschema-specifications==2025.9.1 -markdown-it-py==4.2.0 -MarkupSafe==3.0.3 -mccabe==0.7.0 -mdurl==0.1.2 -packaging==26.2 -pycodestyle==2.14.0 -pycparser==3.0 -pydantic==2.13.4 -pydantic_core==2.46.4 -pyflakes==3.4.0 -PyGithub==2.9.1 -Pygments==2.20.0 -PyJWT==2.13.0 -PyNaCl==1.6.2 -pyparsing==3.3.2 -referencing==0.37.0 -requests==2.34.2 -rich==15.0.0 -rpds-py==0.30.0 -ruamel.yaml==0.19.1 -ruamel.yaml.clib==0.2.15 -shellingham==1.5.4 -tqdm==4.70.0 -typer==0.27.0 -typing-inspection==0.4.2 -typing_extensions==4.16.0 -urllib3==2.7.0 -websocket-client==1.9.0