django-tailwind-cli 4.2.4__tar.gz → 4.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/.github/workflows/release.yml +8 -8
  2. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/.github/workflows/test.yml +3 -3
  3. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/.pre-commit-config.yaml +12 -7
  4. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/CHANGELOG.md +50 -0
  5. django_tailwind_cli-4.4.0/CLAUDE.md +212 -0
  6. django_tailwind_cli-4.4.0/CONFIGURATION.md +414 -0
  7. django_tailwind_cli-4.4.0/DEVELOPMENT.md +478 -0
  8. django_tailwind_cli-4.4.0/PKG-INFO +374 -0
  9. django_tailwind_cli-4.4.0/README.md +318 -0
  10. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/docs/settings.md +2 -2
  11. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/docs/usage.md +62 -10
  12. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/pyproject.toml +11 -20
  13. django_tailwind_cli-4.4.0/src/django_tailwind_cli/apps.py +32 -0
  14. django_tailwind_cli-4.4.0/src/django_tailwind_cli/config.py +460 -0
  15. django_tailwind_cli-4.4.0/src/django_tailwind_cli/management/commands/tailwind.py +1646 -0
  16. django_tailwind_cli-4.4.0/src/django_tailwind_cli/templatetags/tailwind_cli.py +73 -0
  17. django_tailwind_cli-4.4.0/src/django_tailwind_cli/utils/__init__.py +1 -0
  18. django_tailwind_cli-4.4.0/src/django_tailwind_cli/utils/http.py +178 -0
  19. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/tests/.gitignore +1 -0
  20. django_tailwind_cli-4.4.0/tests/test_additional_commands.py +296 -0
  21. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/tests/test_config.py +42 -11
  22. django_tailwind_cli-4.4.0/tests/test_error_scenarios.py +851 -0
  23. django_tailwind_cli-4.4.0/tests/test_http.py +148 -0
  24. django_tailwind_cli-4.4.0/tests/test_integration.py +604 -0
  25. django_tailwind_cli-4.4.0/tests/test_management_commands.py +288 -0
  26. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/tox.ini +14 -10
  27. django_tailwind_cli-4.4.0/uv.lock +507 -0
  28. django_tailwind_cli-4.2.4/PKG-INFO +0 -187
  29. django_tailwind_cli-4.2.4/README.md +0 -130
  30. django_tailwind_cli-4.2.4/src/django_tailwind_cli/apps.py +0 -6
  31. django_tailwind_cli-4.2.4/src/django_tailwind_cli/config.py +0 -185
  32. django_tailwind_cli-4.2.4/src/django_tailwind_cli/management/commands/tailwind.py +0 -346
  33. django_tailwind_cli-4.2.4/src/django_tailwind_cli/templatetags/tailwind_cli.py +0 -15
  34. django_tailwind_cli-4.2.4/tests/test_management_commands.py +0 -268
  35. django_tailwind_cli-4.2.4/uv.lock +0 -792
  36. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/.github/dependabot.yml +0 -0
  37. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/.gitignore +0 -0
  38. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/.readthedocs.yml +0 -0
  39. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/CODE_OF_CONDUCT.md +0 -0
  40. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/LICENSE +0 -0
  41. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/docs/base_template.md +0 -0
  42. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/docs/changelog.md +0 -0
  43. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/docs/index.md +0 -0
  44. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/docs/installation.md +0 -0
  45. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/docs/requirements.txt +0 -0
  46. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/docs/template_tags.md +0 -0
  47. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/justfile +0 -0
  48. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/mkdocs.yml +0 -0
  49. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/src/django_tailwind_cli/__init__.py +0 -0
  50. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/src/django_tailwind_cli/management/__init__.py +0 -0
  51. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/src/django_tailwind_cli/management/commands/__init__.py +0 -0
  52. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/src/django_tailwind_cli/py.typed +0 -0
  53. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/src/django_tailwind_cli/templates/tailwind_cli/base.html +0 -0
  54. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/src/django_tailwind_cli/templates/tailwind_cli/tailwind_css.html +0 -0
  55. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/src/django_tailwind_cli/templatetags/__init__.py +0 -0
  56. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/tests/__init__.py +0 -0
  57. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/tests/assets/css/.gitkeep +0 -0
  58. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/tests/assets/css/tailwind.css +0 -0
  59. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/tests/conftest.py +0 -0
  60. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/tests/settings.py +0 -0
  61. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/tests/templates/tests/base.html +0 -0
  62. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/tests/templates/tests/dummy.email +0 -0
  63. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/tests/test_get_runserver_options.py +0 -0
  64. {django_tailwind_cli-4.2.4 → django_tailwind_cli-4.4.0}/tests/test_tailwind_css_tag.py +0 -0
@@ -14,9 +14,9 @@ jobs:
14
14
  runs-on: ubuntu-latest
15
15
 
16
16
  steps:
17
- - uses: actions/checkout@v4
17
+ - uses: actions/checkout@v5
18
18
  - name: Set up Python
19
- uses: actions/setup-python@v5
19
+ uses: actions/setup-python@v6
20
20
  with:
21
21
  python-version: "3.x"
22
22
  - name: Install pypa/build
@@ -44,12 +44,12 @@ jobs:
44
44
  id-token: write # IMPORTANT: mandatory for trusted publishing
45
45
  steps:
46
46
  - name: Download all the dists
47
- uses: actions/download-artifact@v4
47
+ uses: actions/download-artifact@v5
48
48
  with:
49
49
  name: python-package-distributions
50
50
  path: dist/
51
51
  - name: Publish distribution 📦 to PyPI
52
- uses: pypa/gh-action-pypi-publish@release/v1.12
52
+ uses: pypa/gh-action-pypi-publish@release/v1.13
53
53
 
54
54
  github-release:
55
55
  name: >-
@@ -65,12 +65,12 @@ jobs:
65
65
 
66
66
  steps:
67
67
  - name: Download all the dists
68
- uses: actions/download-artifact@v4
68
+ uses: actions/download-artifact@v5
69
69
  with:
70
70
  name: python-package-distributions
71
71
  path: dist/
72
72
  - name: Sign the dists with Sigstore
73
- uses: sigstore/gh-action-sigstore-python@v3.0.0
73
+ uses: sigstore/gh-action-sigstore-python@v3.0.1
74
74
  with:
75
75
  inputs: >-
76
76
  ./dist/*.tar.gz
@@ -110,12 +110,12 @@ jobs:
110
110
 
111
111
  steps:
112
112
  - name: Download all the dists
113
- uses: actions/download-artifact@v4
113
+ uses: actions/download-artifact@v5
114
114
  with:
115
115
  name: python-package-distributions
116
116
  path: dist/
117
117
  - name: Publish distribution 📦 to TestPyPI
118
- uses: pypa/gh-action-pypi-publish@release/v1.12
118
+ uses: pypa/gh-action-pypi-publish@release/v1.13
119
119
  with:
120
120
  repository-url: https://test.pypi.org/legacy/
121
121
  skip-existing: true
@@ -11,13 +11,13 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  strategy:
13
13
  matrix:
14
- python-version: ["3.9", "3.10", "3.11", "3.12"]
14
+ python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
15
15
 
16
16
  steps:
17
- - uses: actions/checkout@v4
17
+ - uses: actions/checkout@v5
18
18
 
19
19
  - name: Set up Python ${{ matrix.python-version }}
20
- uses: actions/setup-python@v5
20
+ uses: actions/setup-python@v6
21
21
  with:
22
22
  python-version: ${{ matrix.python-version }}
23
23
  allow-prereleases: true
@@ -1,5 +1,5 @@
1
1
  default_language_version:
2
- python: python3.9
2
+ python: python3.10
3
3
 
4
4
  repos:
5
5
  - repo: https://github.com/pre-commit/pre-commit-hooks
@@ -16,30 +16,35 @@ repos:
16
16
  - id: check-json
17
17
 
18
18
  - repo: https://github.com/charliermarsh/ruff-pre-commit
19
- rev: "v0.11.2"
19
+ rev: "v0.12.3"
20
20
  hooks:
21
21
  - id: ruff
22
22
  - id: ruff-format
23
23
 
24
24
  - repo: https://github.com/asottile/pyupgrade
25
- rev: v3.19.1
25
+ rev: v3.20.0
26
26
  hooks:
27
27
  - id: pyupgrade
28
- args: [--py39-plus]
28
+ args: [--py310-plus]
29
29
 
30
30
  - repo: https://github.com/adamchainz/django-upgrade
31
- rev: "1.23.1"
31
+ rev: "1.25.0"
32
32
  hooks:
33
33
  - id: django-upgrade
34
34
  args: [--target-version, "4.2"]
35
35
 
36
36
  - repo: https://github.com/adamchainz/djade-pre-commit
37
- rev: "1.3.2"
37
+ rev: "1.4.0"
38
38
  hooks:
39
39
  - id: djade
40
40
  args: [--target-version, "4.2"]
41
41
 
42
42
  - repo: https://github.com/owenlamont/uv-secure
43
- rev: 0.9.0
43
+ rev: 0.11.1
44
44
  hooks:
45
45
  - id: uv-secure
46
+
47
+ - repo: https://github.com/RobertCraigie/pyright-python
48
+ rev: v1.1.403
49
+ hooks:
50
+ - id: pyright
@@ -1,5 +1,55 @@
1
1
  # Changelog
2
2
 
3
+ ## Unreleased
4
+
5
+ ## 4.4.0 (2025-09-21)
6
+
7
+ ### 🔧 Technical Improvements
8
+ - **Type safety**: Fixed all pyright typing errors for better code quality and maintainability
9
+ - **Code cleanup**: Removed unused functions and improved type annotations throughout codebase
10
+ - **Dependencies**: Removed requests dependency, replaced with custom HTTP implementation
11
+ - **Exception handling**: Fixed exception naming to follow Python conventions and avoid builtin shadowing
12
+ - **Test coverage**: Added comprehensive HTTP module tests, improving coverage from 82% to 85%
13
+ - **Error handling**: Complete test coverage for network timeouts, connection errors, and edge cases
14
+ - **VS Code integration**: Added PyLance ignore comments for test files accessing private methods
15
+ - **Django 6.0 support**: Added Django 6.0 to testing matrix and version compatibility
16
+
17
+ ## 4.3.0 (2025-07-12)
18
+
19
+ ### 🎯 New Features
20
+ - **Interactive setup command**: `python manage.py tailwind setup` for guided configuration
21
+ - **Configuration viewer**: `python manage.py tailwind config` to inspect current settings
22
+ - **Troubleshooting guide**: `python manage.py tailwind troubleshoot` for common issues
23
+ - **Performance tips**: `python manage.py tailwind optimize` for optimization guidance
24
+ - **Enhanced verbose mode**: `--verbose` flag for detailed build and watch diagnostics
25
+
26
+ ### ⚡ Performance Improvements
27
+ - **Smart rebuilds**: File modification checks prevent unnecessary CSS rebuilds
28
+ - **Version caching**: 1-hour cache reduces GitHub API requests
29
+ - **Process optimization**: Improved `tailwind runserver` with better signal handling
30
+ - **File operations**: Optimized I/O with caching and content comparison
31
+
32
+ ### 🛠️ Developer Experience
33
+ - **Better error messages**: Actionable solutions for configuration and system issues
34
+ - **Colorized output**: Visual feedback with emojis and progress indicators
35
+ - **Help text improvements**: Detailed examples and use cases for all commands
36
+ - **Template scanning**: Enhanced discovery with error handling and performance metrics
37
+
38
+ ### 📚 Documentation & Resources
39
+ - **Comprehensive README**: Step-by-step quick start and feature overview
40
+ - **Advanced guides**: CONFIGURATION.md and DEVELOPMENT.md for production deployments
41
+ - **Inline documentation**: Detailed docstrings and usage examples throughout codebase
42
+
43
+ ### 🧪 Quality Assurance
44
+ - **Comprehensive testing**: 58+ new tests covering integration workflows and error scenarios
45
+ - **Cross-platform support**: Windows, macOS, and Linux compatibility testing
46
+ - **89% test coverage**: Robust validation of all major functionality
47
+
48
+ ### 🔧 Technical Improvements
49
+ - **Python 3.10+ minimum**: Updated supported Python versions to 3.10-3.14
50
+ - **Refactored internals**: Better maintainability with focused, single-responsibility functions
51
+ - **Type safety**: Improved with `PlatformInfo` and `VersionCache` data structures
52
+
3
53
  ## 4.2.4
4
54
 
5
55
  - Merged pull request [#161](https://github.com/django-commons/django-tailwind-cli/pull/161) by [@adamghill](https://github.com/adamghill) which fixed the [prefix handling for staticfiles diretories](https://docs.djangoproject.com/en/5.2/ref/settings/#prefixes-optional).
@@ -0,0 +1,212 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Project Overview
6
+
7
+ `django-tailwind-cli` is a Django package that provides seamless integration between Django and Tailwind CSS 4.x using the precompiled Tailwind CSS CLI, eliminating the need for Node.js.
8
+
9
+ ## Development Setup and Commands
10
+
11
+ ### Required Tools
12
+ - Python 3.10-3.14
13
+ - [uv](https://docs.astral.sh/uv/) - Modern Python package manager
14
+ - [just](https://github.com/casey/just) - Command runner (optional but recommended)
15
+
16
+ ### Common Development Commands
17
+
18
+ ```bash
19
+ # Setup development environment
20
+ just bootstrap
21
+
22
+ # Install/upgrade dependencies
23
+ just upgrade
24
+
25
+ # Run linting and formatting
26
+ just lint
27
+
28
+ # Run tests
29
+ just test # Run pytest with coverage
30
+ just test-all # Run full test matrix with tox
31
+
32
+ # Documentation
33
+ just serve-docs # Serve docs locally with mkdocs
34
+ ```
35
+
36
+ ### Without `just` (using uv directly)
37
+ ```bash
38
+ # Create virtual environment
39
+ uv venv
40
+
41
+ # Install all dependencies
42
+ uv sync --all-extras
43
+
44
+ # Run tests
45
+ uv run pytest
46
+
47
+ # Run tox test matrix
48
+ uvx --with tox-uv tox
49
+
50
+ # Run linting
51
+ uvx --with pre-commit-uv pre-commit run --all-files
52
+ ```
53
+
54
+ ## Code Architecture
55
+
56
+ ### Package Structure
57
+ ```
58
+ src/django_tailwind_cli/
59
+ ├── apps.py # Django app configuration
60
+ ├── config.py # Central configuration (Config class)
61
+ ├── management/commands/ # Django management commands
62
+ │ └── tailwind.py # Main command: build, watch, runserver
63
+ ├── templates/tailwind_cli/ # Template files
64
+ ├── templatetags/ # Template tags ({% tailwind_css %})
65
+ └── utils/ # Utility modules for CLI download, etc.
66
+ ```
67
+
68
+ ### Key Components
69
+
70
+ 1. **Configuration System** (`config.py`):
71
+ - `Config` class centralizes all settings
72
+ - Reads from Django settings with sensible defaults
73
+ - Handles CLI paths, CSS paths, and command configurations
74
+
75
+ 2. **Management Commands** (`management/commands/tailwind.py`):
76
+ - `tailwind build`: Production CSS build
77
+ - `tailwind watch`: Development mode with auto-rebuild
78
+ - `tailwind runserver`: Combined Django runserver + Tailwind watch
79
+
80
+ 3. **Template Integration**:
81
+ - `{% load tailwind_cli %}` - Load template tags
82
+ - `{% tailwind_css %}` - Include CSS in templates
83
+ - Base template provided at `tailwind_cli/base.html`
84
+
85
+ 4. **CLI Management**:
86
+ - Automatic download of Tailwind CSS CLI binaries
87
+ - Support for custom CLI paths
88
+ - Platform-specific binary selection
89
+
90
+ ## Testing
91
+
92
+ The project uses pytest with Django integration:
93
+ - Test files in `tests/` directory
94
+ - Configuration in `tests/settings.py`
95
+ - Run with coverage: `uv run pytest --cov`
96
+ - Full matrix testing: `uvx --with tox-uv tox`
97
+
98
+ ## Important Settings
99
+
100
+ Key Django settings for configuration:
101
+ - `TAILWIND_CLI_PATH`: Custom path to Tailwind CLI
102
+ - `TAILWIND_CSS_PATH`: Output CSS file location
103
+ - `TAILWIND_CONFIG_FILE`: Path to tailwind.config.js
104
+ - `STATICFILES_DIRS`: Must be configured for asset collection
105
+
106
+ ## Development Workflow
107
+
108
+ 1. Make changes to the code
109
+ 2. Run `just lint` to check formatting and linting
110
+ 3. Run `just test` to ensure tests pass
111
+ 4. For multi-version testing, run `just test-all`
112
+ 5. Update documentation if needed
113
+
114
+ ## Version Support
115
+
116
+ - Python: 3.10-3.14
117
+ - Django: 4.0-6.0
118
+ - Tailwind CSS: 4.x only (use v2.21.1 for Tailwind 3.x)
119
+
120
+ ## Commit Message Guidelines
121
+
122
+ **⚠️ CRITICAL REQUIREMENT: NO CLAUDE REFERENCES**
123
+ - **NEVER include any Claude Code references, marketing info, or AI-generated footers in commit messages**
124
+ - **NEVER add "Generated with Claude Code", "Co-Authored-By: Claude", or any similar lines**
125
+ - **Commit messages must be completely clean and professional - no AI tool attribution whatsoever**
126
+ - **This is a strict project requirement and violations will require commit message rewrites**
127
+
128
+ Use conventional commit format with the following structure:
129
+
130
+ ```
131
+ type(scope): brief description
132
+
133
+ - Bullet point describing key change
134
+ - Another bullet point for significant addition
135
+ - Additional points as needed
136
+ ```
137
+
138
+ ### Commit Types
139
+ - **feat**: New feature
140
+ - **fix**: Bug fix
141
+ - **docs**: Documentation changes
142
+ - **style**: Code style changes (formatting, missing semicolons, etc.)
143
+ - **refactor**: Code refactoring without changing functionality
144
+ - **test**: Adding or modifying tests
145
+ - **chore**: Maintenance tasks (deps updates, build changes, etc.)
146
+ - **ci**: CI/CD configuration changes
147
+ - **perf**: Performance improvements
148
+
149
+ ### Project Scopes
150
+ - **config**: Configuration handling (config.py)
151
+ - **management**: Management commands
152
+ - **templatetags**: Template tags functionality
153
+ - **templates**: HTML template files
154
+ - **build**: Build command functionality
155
+ - **watch**: Watch mode functionality
156
+ - **runserver**: Development server integration
157
+ - **download**: CLI download functionality
158
+ - **deps**: Dependencies
159
+ - **ci**: Continuous integration
160
+ - **docs**: Documentation
161
+ - **tests**: Test suite
162
+ - **daisyui**: DaisyUI integration
163
+ - **staticfiles**: Static files handling
164
+
165
+ ### Example Commits
166
+ ```
167
+ feat(management): add purge command for cleaning CSS
168
+
169
+ - Add new purge subcommand to remove unused styles
170
+ - Support custom purge configuration
171
+ - Integrate with existing build process
172
+
173
+ fix(config): handle prefixed staticfile directories
174
+
175
+ - Correctly resolve paths when STATIC_URL has prefix
176
+ - Add validation for malformed configurations
177
+
178
+ chore(deps): bump django-typer to 2.1.2
179
+
180
+ - Update minimum version for security fix
181
+ - Adjust type hints for new API
182
+ ```
183
+
184
+ ### Important Notes
185
+ - Keep commit messages focused on the technical changes made
186
+ - Use bullet points to describe key modifications and their impact
187
+ - Follow conventional commit format consistently
188
+ - Be concise but descriptive about what changed and why
189
+
190
+ ## Changelog Requirements
191
+
192
+ **IMPORTANT**: Every time you are asked to commit changes, you MUST also update the CHANGELOG.md file:
193
+
194
+ 1. **Update CHANGELOG.md**: Add a compact entry under the "## Unreleased" section describing the changes
195
+ 2. **Format**: Use the existing changelog format with appropriate categories:
196
+ - 🎯 **New Features**: For new functionality
197
+ - ⚡ **Performance Improvements**: For optimization changes
198
+ - 🛠️ **Developer Experience**: For DX improvements
199
+ - 🔧 **Technical Improvements**: For internal code improvements
200
+ - 🐛 **Bug Fixes**: For fixes
201
+ - 📚 **Documentation**: For docs changes
202
+ 3. **Keep it concise**: One or two bullet points maximum describing the key change
203
+ 4. **Focus on user impact**: Describe what changed from a user's perspective, not implementation details
204
+
205
+ ### Example Changelog Entry
206
+ ```markdown
207
+ ## Unreleased
208
+
209
+ ### 🔧 Technical Improvements
210
+ - **Type safety**: Fixed all pyright typing errors for better code quality
211
+ - **Code cleanup**: Removed unused functions and improved type annotations
212
+ ```