Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
431e873529 | ||
|
|
8bacb2d32d | ||
|
|
49a7123989 | ||
|
|
311f6a7cc9 | ||
|
|
70477190f3 | ||
|
|
5c6888ff28 | ||
|
|
f0a88dfc44 | ||
|
|
4c34426782 | ||
|
|
d1e77b5547 | ||
|
|
8d38a5e9df | ||
|
|
d8402927e1 | ||
|
|
39b7704056 | ||
|
|
7d04ad2f2e | ||
|
|
50061c313e | ||
|
|
bbd4f1ddd6 | ||
|
|
9ba07d5167 | ||
|
|
f7c5a99e41 | ||
|
|
68f8cb81b5 | ||
|
|
962fa3c504 |
No files matched your search
@@ -1,35 +1,20 @@
|
||||
name: Dependabot Auto-Approve and Auto-Merge
|
||||
|
||||
name: Dependabot Auto-Merge
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened, reopened, synchronize]
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
dependabot:
|
||||
if: github.actor == 'dependabot[bot]'
|
||||
if: ${{github.actor == 'dependabot[bot]' }}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Dependabot metadata
|
||||
id: metadata
|
||||
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
|
||||
- name: Merge PR from dependabot
|
||||
uses: fastify/github-action-merge-dependabot@v3
|
||||
with:
|
||||
script: |
|
||||
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
|
||||
github-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||
@@ -31,10 +31,10 @@ jobs:
|
||||
steps:
|
||||
- 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
|
||||
with:
|
||||
{% raw %}python-version: ${{ matrix.python-version }}{% endraw %}
|
||||
python-version: {{ '{{ matrix.python-version }}' }}
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v4
|
||||
|
||||
@@ -128,9 +128,74 @@ clean:
|
||||
rm -rf htmlcov/
|
||||
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:
|
||||
uv sync
|
||||
just pin-deps
|
||||
uv run python manage.py migrate
|
||||
uv run python manage.py createsuperuser
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# {{ 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
|
||||
|
||||
@@ -62,6 +62,11 @@ Run `just` to see all available commands, including:
|
||||
- `just format` - Format code
|
||||
- `just shell` - Django shell
|
||||
- `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
|
||||
|
||||
@@ -107,6 +112,7 @@ Run `just` to see all available commands, including:
|
||||
├── manage.py
|
||||
├── requirements.txt
|
||||
├── pyproject.toml
|
||||
├── uv.lock
|
||||
├── .env.sample
|
||||
├── justfile
|
||||
├── Procfile
|
||||
@@ -146,6 +152,7 @@ Run `just` to see all available commands, including:
|
||||
├── manage.py
|
||||
├── requirements.txt
|
||||
├── pyproject.toml
|
||||
├── uv.lock
|
||||
├── .env.sample
|
||||
├── justfile
|
||||
├── Procfile
|
||||
@@ -173,6 +180,7 @@ Run `just` to see all available commands, including:
|
||||
├── manage.py
|
||||
├── requirements.txt
|
||||
├── pyproject.toml
|
||||
├── uv.lock
|
||||
├── .env.sample
|
||||
└── README.md
|
||||
|
||||
|
||||
+7
-4
@@ -7,7 +7,7 @@ packages = ["djinit"]
|
||||
|
||||
[project]
|
||||
name = "djinitx"
|
||||
version = "0.3.1"
|
||||
version = "0.3.3"
|
||||
description = "A CLI tool to setup Django project"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.10"
|
||||
@@ -47,11 +47,8 @@ classifiers=[
|
||||
"Topic :: Software Development :: Code Generators",
|
||||
]
|
||||
dependencies = [
|
||||
"click>=8.3.0",
|
||||
"rich>=14.2.0",
|
||||
"ruff>=0.14.2",
|
||||
"jinja2>=3.1.0",
|
||||
"pre-commit>=4.5.0",
|
||||
"questionary>=2.0.1",
|
||||
]
|
||||
|
||||
@@ -61,3 +58,9 @@ Homepage = "https://github.com/S4NKALP/djinit"
|
||||
[project.scripts]
|
||||
djinit = "djinit.generator:main"
|
||||
dj = "djinit.generator:main"
|
||||
|
||||
[dependency-groups]
|
||||
dev = [
|
||||
"pre-commit>=4.5.0",
|
||||
"ruff>=0.14.2",
|
||||
]
|
||||
+5
-3
@@ -1,4 +1,6 @@
|
||||
click==8.3.1
|
||||
jinja2==3.1.6
|
||||
questionary==2.1.1
|
||||
rich==14.2.0
|
||||
ruff==0.14.7
|
||||
jinja2>=3.1.0
|
||||
# dev
|
||||
ruff==0.14.9
|
||||
pre-commit==4.5.1
|
||||
@@ -2,7 +2,7 @@ from setuptools import find_packages, setup
|
||||
|
||||
setup(
|
||||
name="djinitx",
|
||||
version="0.3.1",
|
||||
version="0.3.3",
|
||||
description="A CLI tool to setup Django projects",
|
||||
long_description=open("README.md").read(),
|
||||
long_description_content_type="text/markdown",
|
||||
@@ -16,6 +16,7 @@ setup(
|
||||
"click>=8.3.0",
|
||||
"rich>=14.2.0",
|
||||
"jinja2>=3.1.0",
|
||||
"questionary>=2.0.1",
|
||||
],
|
||||
entry_points={
|
||||
"console_scripts": [
|
||||
|
||||
@@ -11,27 +11,6 @@ wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/db/3c/33bac158f8ab7f89b2e59426d5fe2e4f63f7ed25df84c036890172b412b5/cfgv-3.5.0-py2.py3-none-any.whl", hash = "sha256:a8dc6b26ad22ff227d2634a65cb388215ce6cc96bbcc5cfde7641ae87e8dacc0", size = 7445, upload-time = "2025-11-19T20:55:50.744Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "click"
|
||||
version = "8.3.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "colorama", marker = "sys_platform == 'win32'" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/46/61/de6cd827efad202d7057d93e0fed9294b96952e188f7384832791c7b2254/click-8.3.0.tar.gz", hash = "sha256:e7b8232224eba16f4ebe410c25ced9f7875cb5f3263ffc93cc3e8da705e229c4", size = 276943, upload-time = "2025-09-18T17:32:23.696Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/db/d3/9dcc0f5797f070ec8edf30fbadfb200e71d9db6b84d211e3b2085a7589a0/click-8.3.0-py3-none-any.whl", hash = "sha256:9b9f285302c6e3064f4330c05f05b81945b2a39544279343e6e7c5f27a9baddc", size = 107295, upload-time = "2025-09-18T17:32:22.42Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "colorama"
|
||||
version = "0.4.6"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "distlib"
|
||||
version = "0.4.0"
|
||||
@@ -43,24 +22,30 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "djinitx"
|
||||
version = "0.3.1"
|
||||
version = "0.3.3"
|
||||
source = { editable = "." }
|
||||
dependencies = [
|
||||
{ name = "click" },
|
||||
{ name = "jinja2" },
|
||||
{ name = "pre-commit" },
|
||||
{ name = "questionary" },
|
||||
{ name = "rich" },
|
||||
]
|
||||
|
||||
[package.dev-dependencies]
|
||||
dev = [
|
||||
{ name = "pre-commit" },
|
||||
{ name = "ruff" },
|
||||
]
|
||||
|
||||
[package.metadata]
|
||||
requires-dist = [
|
||||
{ name = "click", specifier = ">=8.3.0" },
|
||||
{ name = "jinja2", specifier = ">=3.1.0" },
|
||||
{ name = "pre-commit", specifier = ">=4.5.0" },
|
||||
{ name = "questionary", specifier = ">=2.0.1" },
|
||||
{ name = "rich", specifier = ">=14.2.0" },
|
||||
]
|
||||
|
||||
[package.metadata.requires-dev]
|
||||
dev = [
|
||||
{ name = "pre-commit", specifier = ">=4.5.0" },
|
||||
{ name = "ruff", specifier = ">=0.14.2" },
|
||||
]
|
||||
|
||||
|
||||
Reference in new issue
Block a user