Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
431e873529 | ||
|
|
8bacb2d32d | ||
|
|
49a7123989 | ||
|
|
311f6a7cc9 | ||
|
|
70477190f3 | ||
|
|
5c6888ff28 | ||
|
|
f0a88dfc44 | ||
|
|
4c34426782 | ||
|
|
d1e77b5547 | ||
|
|
8d38a5e9df | ||
|
|
d8402927e1 | ||
|
|
39b7704056 | ||
|
|
7d04ad2f2e | ||
|
|
50061c313e | ||
|
|
bbd4f1ddd6 | ||
|
|
9ba07d5167 |
No files matched your search
@@ -1,35 +1,20 @@
|
|||||||
name: Dependabot Auto-Approve and Auto-Merge
|
|
||||||
|
name: Dependabot Auto-Merge
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request:
|
||||||
types: [opened, reopened, synchronize]
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
dependabot:
|
dependabot:
|
||||||
if: github.actor == 'dependabot[bot]'
|
if: ${{github.actor == 'dependabot[bot]' }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Dependabot metadata
|
- name: Merge PR from dependabot
|
||||||
id: metadata
|
uses: fastify/github-action-merge-dependabot@v3
|
||||||
uses: dependabot/fetch-metadata@v2
|
|
||||||
- name: Approve PR
|
|
||||||
if: |
|
|
||||||
steps.metadata.outputs.update-type == 'version-update:semver-minor' ||
|
|
||||||
steps.metadata.outputs.update-type == 'version-update:semver-patch'
|
|
||||||
uses: actions/github-script@v8
|
|
||||||
with:
|
with:
|
||||||
script: |
|
github-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||||
await github.rest.pulls.createReview({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
pull_number: context.payload.pull_request.number,
|
|
||||||
event: 'APPROVE'
|
|
||||||
})
|
|
||||||
- name: Enable auto-merge (squash)
|
|
||||||
if: |
|
|
||||||
steps.metadata.outputs.update-type == 'version-update:semver-minor' ||
|
|
||||||
steps.metadata.outputs.update-type == 'version-update:semver-patch'
|
|
||||||
uses: peter-evans/enable-pull-request-automerge@v3
|
|
||||||
with:
|
|
||||||
merge-method: squash
|
|
||||||
@@ -31,10 +31,10 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
{% raw %}- name: Set up Python ${{ matrix.python-version }}{% endraw %}
|
- name: Set up Python {{ '{{ matrix.python-version }}' }}
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
{% raw %}python-version: ${{ matrix.python-version }}{% endraw %}
|
python-version: {{ '{{ matrix.python-version }}' }}
|
||||||
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
uses: astral-sh/setup-uv@v4
|
uses: astral-sh/setup-uv@v4
|
||||||
|
|||||||
@@ -128,9 +128,74 @@ clean:
|
|||||||
rm -rf htmlcov/
|
rm -rf htmlcov/
|
||||||
rm -rf .pytest_cache/
|
rm -rf .pytest_cache/
|
||||||
|
|
||||||
|
# Pin dependencies in pyproject.toml using versions from uv.lock, keeping >= and extras
|
||||||
|
pin-deps:
|
||||||
|
#!/usr/bin/env -S uv run python
|
||||||
|
import tomllib, re
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
lock = Path("uv.lock")
|
||||||
|
if not lock.exists():
|
||||||
|
print("uv.lock not found — run `uv sync` first")
|
||||||
|
raise SystemExit(0)
|
||||||
|
|
||||||
|
data = tomllib.loads(lock.read_text())
|
||||||
|
packages = {p["name"].lower(): p["version"] for p in data.get("package", [])}
|
||||||
|
|
||||||
|
py = Path("pyproject.toml")
|
||||||
|
lines = py.read_text().splitlines()
|
||||||
|
|
||||||
|
pattern = re.compile(r'^(\s*)"([^"]+)"(,?)')
|
||||||
|
|
||||||
|
out = []
|
||||||
|
for line in lines:
|
||||||
|
m = pattern.match(line)
|
||||||
|
if not m:
|
||||||
|
out.append(line)
|
||||||
|
continue
|
||||||
|
|
||||||
|
indent, dep, comma = m.groups()
|
||||||
|
|
||||||
|
base = dep
|
||||||
|
extras = ""
|
||||||
|
operator = ">="
|
||||||
|
version = None
|
||||||
|
|
||||||
|
# extras: django[postgres]
|
||||||
|
if "[" in base and "]" in base:
|
||||||
|
before, after = base.split("[", 1)
|
||||||
|
extras = "[" + after.split("]")[0] + "]"
|
||||||
|
base = before
|
||||||
|
|
||||||
|
# detect >= or ==
|
||||||
|
if ">=" in dep:
|
||||||
|
operator = ">="
|
||||||
|
base, version = dep.split(">=")
|
||||||
|
base = base.strip()
|
||||||
|
elif "==" in dep:
|
||||||
|
operator = "=="
|
||||||
|
base, version = dep.split("==")
|
||||||
|
base = base.strip()
|
||||||
|
else:
|
||||||
|
base = dep
|
||||||
|
|
||||||
|
base_lower = base.lower()
|
||||||
|
new_version = packages.get(base_lower)
|
||||||
|
|
||||||
|
if new_version:
|
||||||
|
new_dep = f'{base}{extras}{operator}{new_version}'
|
||||||
|
line = f'{indent}"{new_dep}"{comma}'
|
||||||
|
|
||||||
|
out.append(line)
|
||||||
|
|
||||||
|
py.write_text("\n".join(out) + "\n")
|
||||||
|
print("Pinned dependencies (>= preserved, extras preserved).")
|
||||||
|
|
||||||
|
|
||||||
# Setup project for development (using uv)
|
# Setup project for development (using uv)
|
||||||
setup:
|
setup:
|
||||||
uv sync
|
uv sync
|
||||||
|
just pin-deps
|
||||||
uv run python manage.py migrate
|
uv run python manage.py migrate
|
||||||
uv run python manage.py createsuperuser
|
uv run python manage.py createsuperuser
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# {{ project_name }}
|
# {{ project_name }}
|
||||||
|
|
||||||
A Django project created with [djinitx/djinit/dj](https://github.com/S4NKALP/djinit).
|
A Django project folder structure is generated with [djinitx/djinit/dj](https://github.com/S4NKALP/djinit).
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
@@ -62,6 +62,11 @@ Run `just` to see all available commands, including:
|
|||||||
- `just format` - Format code
|
- `just format` - Format code
|
||||||
- `just shell` - Django shell
|
- `just shell` - Django shell
|
||||||
- `just clean` - Clean cache files
|
- `just clean` - Clean cache files
|
||||||
|
- `just install <package>` - Install package
|
||||||
|
- `just remove <package>` - Remove package
|
||||||
|
- `just server` - Run production server
|
||||||
|
- `just ci` - Run all linting and checks
|
||||||
|
- `just test-coverage` - Run tests with coverage
|
||||||
|
|
||||||
## Project Structure
|
## Project Structure
|
||||||
|
|
||||||
@@ -107,6 +112,7 @@ Run `just` to see all available commands, including:
|
|||||||
├── manage.py
|
├── manage.py
|
||||||
├── requirements.txt
|
├── requirements.txt
|
||||||
├── pyproject.toml
|
├── pyproject.toml
|
||||||
|
├── uv.lock
|
||||||
├── .env.sample
|
├── .env.sample
|
||||||
├── justfile
|
├── justfile
|
||||||
├── Procfile
|
├── Procfile
|
||||||
@@ -146,6 +152,7 @@ Run `just` to see all available commands, including:
|
|||||||
├── manage.py
|
├── manage.py
|
||||||
├── requirements.txt
|
├── requirements.txt
|
||||||
├── pyproject.toml
|
├── pyproject.toml
|
||||||
|
├── uv.lock
|
||||||
├── .env.sample
|
├── .env.sample
|
||||||
├── justfile
|
├── justfile
|
||||||
├── Procfile
|
├── Procfile
|
||||||
@@ -173,6 +180,7 @@ Run `just` to see all available commands, including:
|
|||||||
├── manage.py
|
├── manage.py
|
||||||
├── requirements.txt
|
├── requirements.txt
|
||||||
├── pyproject.toml
|
├── pyproject.toml
|
||||||
|
├── uv.lock
|
||||||
├── .env.sample
|
├── .env.sample
|
||||||
└── README.md
|
└── README.md
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ packages = ["djinit"]
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "djinitx"
|
name = "djinitx"
|
||||||
version = "0.3.2"
|
version = "0.3.3"
|
||||||
description = "A CLI tool to setup Django project"
|
description = "A CLI tool to setup Django project"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.10"
|
requires-python = ">=3.10"
|
||||||
|
|||||||
+2
-3
@@ -1,7 +1,6 @@
|
|||||||
jinja2==3.1.6
|
jinja2==3.1.6
|
||||||
questionary==2.1.1
|
questionary==2.1.1
|
||||||
rich==14.2.0
|
rich==14.2.0
|
||||||
|
|
||||||
# dev
|
# dev
|
||||||
ruff==0.14.2
|
ruff==0.14.9
|
||||||
pre-commit==4.5.0
|
pre-commit==4.5.1
|
||||||
@@ -2,7 +2,7 @@ from setuptools import find_packages, setup
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="djinitx",
|
name="djinitx",
|
||||||
version="0.3.2",
|
version="0.3.3",
|
||||||
description="A CLI tool to setup Django projects",
|
description="A CLI tool to setup Django projects",
|
||||||
long_description=open("README.md").read(),
|
long_description=open("README.md").read(),
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
|
|||||||
Reference in new issue
Block a user