django-tailwind-cli 2.19.2__tar.gz → 2.20.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.
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/.github/workflows/release.yml +1 -1
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/.pre-commit-config.yaml +18 -14
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/CHANGELOG.md +8 -0
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/PKG-INFO +3 -4
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/README.md +1 -1
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/mkdocs.yml +2 -0
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/pyproject.toml +10 -13
- django_tailwind_cli-2.20.0/src/django_tailwind_cli/conf.py +46 -0
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/src/django_tailwind_cli/management/commands/tailwind.py +9 -9
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/src/django_tailwind_cli/templatetags/tailwind_cli.py +3 -2
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/src/django_tailwind_cli/utils.py +14 -9
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/tests/test_utils.py +5 -5
- django_tailwind_cli-2.20.0/uv.lock +584 -0
- django_tailwind_cli-2.19.2/src/django_tailwind_cli/conf.py +0 -18
- django_tailwind_cli-2.19.2/tests/test_conf.py +0 -9
- django_tailwind_cli-2.19.2/uv.lock +0 -507
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/.github/dependabot.yml +0 -0
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/.github/workflows/test.yml +0 -0
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/.gitignore +0 -0
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/.readthedocs.yml +0 -0
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/CODE_OF_CONDUCT.md +0 -0
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/LICENSE +0 -0
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/docs/base_template.md +0 -0
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/docs/changelog.md +0 -0
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/docs/index.md +0 -0
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/docs/installation.md +0 -0
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/docs/requirements.txt +0 -0
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/docs/settings.md +0 -0
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/docs/template_tags.md +0 -0
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/docs/usage.md +0 -0
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/justfile +0 -0
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/src/django_tailwind_cli/__init__.py +0 -0
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/src/django_tailwind_cli/apps.py +0 -0
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/src/django_tailwind_cli/management/__init__.py +0 -0
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/src/django_tailwind_cli/management/commands/__init__.py +0 -0
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/src/django_tailwind_cli/py.typed +0 -0
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/src/django_tailwind_cli/templates/tailwind_cli/base.html +0 -0
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/src/django_tailwind_cli/templates/tailwind_cli/tailwind_css.html +0 -0
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/src/django_tailwind_cli/templatetags/__init__.py +0 -0
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/tests/.gitignore +0 -0
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/tests/__init__.py +0 -0
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/tests/conftest.py +0 -0
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/tests/settings.py +0 -0
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/tests/templates/tests/base.html +0 -0
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/tests/test_management_commands.py +0 -0
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/tests/test_tailwind_css_tag.py +0 -0
- {django_tailwind_cli-2.19.2 → django_tailwind_cli-2.20.0}/tox.ini +0 -0
|
@@ -16,30 +16,34 @@ repos:
|
|
|
16
16
|
- id: check-json
|
|
17
17
|
|
|
18
18
|
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
|
19
|
-
rev: "v0.
|
|
19
|
+
rev: "v0.7.4"
|
|
20
20
|
hooks:
|
|
21
21
|
- id: ruff
|
|
22
22
|
- id: ruff-format
|
|
23
23
|
|
|
24
|
-
- repo: https://github.com/RobertCraigie/pyright-python
|
|
25
|
-
rev: v1.1.384
|
|
26
|
-
hooks:
|
|
27
|
-
- id: pyright
|
|
28
|
-
|
|
29
|
-
- repo: https://github.com/adamchainz/djade-pre-commit
|
|
30
|
-
rev: "1.3.0"
|
|
31
|
-
hooks:
|
|
32
|
-
- id: djade
|
|
33
|
-
args: [--target-version, "4.2"]
|
|
34
|
-
|
|
35
24
|
- repo: https://github.com/asottile/pyupgrade
|
|
36
|
-
rev: v3.
|
|
25
|
+
rev: v3.19.0
|
|
37
26
|
hooks:
|
|
38
27
|
- id: pyupgrade
|
|
39
28
|
args: [--py39-plus]
|
|
40
29
|
|
|
41
30
|
- repo: https://github.com/adamchainz/django-upgrade
|
|
42
|
-
rev: "1.
|
|
31
|
+
rev: "1.22.1"
|
|
43
32
|
hooks:
|
|
44
33
|
- id: django-upgrade
|
|
45
34
|
args: [--target-version, "4.2"]
|
|
35
|
+
|
|
36
|
+
- repo: local
|
|
37
|
+
hooks:
|
|
38
|
+
- id: mypy
|
|
39
|
+
name: mypy
|
|
40
|
+
language: system
|
|
41
|
+
types: [python]
|
|
42
|
+
entry: uv run mypy
|
|
43
|
+
require_serial: true
|
|
44
|
+
|
|
45
|
+
- repo: https://github.com/adamchainz/djade-pre-commit
|
|
46
|
+
rev: "1.3.2"
|
|
47
|
+
hooks:
|
|
48
|
+
- id: djade
|
|
49
|
+
args: [--target-version, "4.2"]
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.20.0
|
|
4
|
+
|
|
5
|
+
- Removed django-appconf again.
|
|
6
|
+
- Switched from pyright to mypy for type checking.
|
|
7
|
+
- Fixed broken links in the documentation.
|
|
8
|
+
- Bumped default version of Tailwind CSS to 3.4.13.
|
|
9
|
+
- Bumped minimum version of certifi to 2024.8.30. Removed the upper boundary of the version number.
|
|
10
|
+
|
|
3
11
|
## 2.19.0
|
|
4
12
|
|
|
5
13
|
- Transfered the project to django-commons.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: django-tailwind-cli
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.20.0
|
|
4
4
|
Summary: Django and Tailwind integration based on the prebuilt Tailwind CSS CLI.
|
|
5
5
|
Project-URL: Home, https://django-tailwind-cli.rtfd.io/
|
|
6
6
|
Project-URL: Documentation, https://django-tailwind-cli.rtfd.io/
|
|
@@ -41,8 +41,7 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
41
41
|
Classifier: Topic :: Software Development :: Libraries
|
|
42
42
|
Classifier: Topic :: Utilities
|
|
43
43
|
Requires-Python: >=3.9
|
|
44
|
-
Requires-Dist: certifi
|
|
45
|
-
Requires-Dist: django-appconf>=1.0.6
|
|
44
|
+
Requires-Dist: certifi>=2024.8.30
|
|
46
45
|
Requires-Dist: django-typer>=2.1.2
|
|
47
46
|
Requires-Dist: django>=4.2
|
|
48
47
|
Provides-Extra: django-extensions
|
|
@@ -109,7 +108,7 @@ The goal of this library is to provided the simplest possible Tailwind integrati
|
|
|
109
108
|
|
|
110
109
|
Enjoy!
|
|
111
110
|
|
|
112
|
-
Checkout the detailed [installation guide](https://django-tailwind-cli.rtfd.io/installation/) if you want to activate browser reload or the `runserver_plus` management command known from `django-extensions`.
|
|
111
|
+
Checkout the detailed [installation guide](https://django-tailwind-cli.rtfd.io/latest/installation/) if you want to activate browser reload or the `runserver_plus` management command known from `django-extensions`.
|
|
113
112
|
|
|
114
113
|
## Features
|
|
115
114
|
|
|
@@ -57,7 +57,7 @@ The goal of this library is to provided the simplest possible Tailwind integrati
|
|
|
57
57
|
|
|
58
58
|
Enjoy!
|
|
59
59
|
|
|
60
|
-
Checkout the detailed [installation guide](https://django-tailwind-cli.rtfd.io/installation/) if you want to activate browser reload or the `runserver_plus` management command known from `django-extensions`.
|
|
60
|
+
Checkout the detailed [installation guide](https://django-tailwind-cli.rtfd.io/latest/installation/) if you want to activate browser reload or the `runserver_plus` management command known from `django-extensions`.
|
|
61
61
|
|
|
62
62
|
## Features
|
|
63
63
|
|
|
@@ -50,6 +50,8 @@ extra:
|
|
|
50
50
|
social:
|
|
51
51
|
- icon: fontawesome/brands/mastodon
|
|
52
52
|
link: https://social.tchncs.de/@oliverandrich
|
|
53
|
+
- icon: fontawesome/brands/bluesky
|
|
54
|
+
link: https://bsky.app/profile/andrich.me
|
|
53
55
|
- icon: fontawesome/brands/github
|
|
54
56
|
link: https://github.com/oliverandrich
|
|
55
57
|
- icon: fontawesome/brands/linkedin
|
|
@@ -24,12 +24,7 @@ classifiers = [
|
|
|
24
24
|
]
|
|
25
25
|
dynamic = ["version"]
|
|
26
26
|
requires-python = ">=3.9"
|
|
27
|
-
dependencies = [
|
|
28
|
-
"django>=4.2",
|
|
29
|
-
"certifi>=2023.7.22,<2025.0.0",
|
|
30
|
-
"django-typer>=2.1.2",
|
|
31
|
-
"django-appconf>=1.0.6",
|
|
32
|
-
]
|
|
27
|
+
dependencies = ["django>=4.2", "certifi>=2024.8.30", "django-typer>=2.1.2"]
|
|
33
28
|
|
|
34
29
|
[project.optional-dependencies]
|
|
35
30
|
django-extensions = ["django-extensions>=3.2", "werkzeug>=3.0"]
|
|
@@ -41,13 +36,13 @@ Repository = "https://github.com/django-commons/django-tailwind-cli"
|
|
|
41
36
|
|
|
42
37
|
[tool.uv]
|
|
43
38
|
dev-dependencies = [
|
|
44
|
-
"django-types>=0.19.1",
|
|
45
39
|
"pytest-cov>=5.0.0",
|
|
46
40
|
"pytest-django>=4.9.0",
|
|
47
41
|
"pytest-mock>=3.14.0",
|
|
48
42
|
"pytest-randomly>=3.15.0",
|
|
49
43
|
"pytest-sugar>=1.0.0",
|
|
50
44
|
"pytest>=8.3.3",
|
|
45
|
+
"django-stubs[compatible-mypy]>=5.1.1",
|
|
51
46
|
]
|
|
52
47
|
|
|
53
48
|
[build-system]
|
|
@@ -74,12 +69,14 @@ exclude = '''
|
|
|
74
69
|
)/
|
|
75
70
|
'''
|
|
76
71
|
|
|
77
|
-
#
|
|
78
|
-
[tool.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
72
|
+
# mypy
|
|
73
|
+
[tool.mypy]
|
|
74
|
+
python_version = "3.9"
|
|
75
|
+
plugins = ["mypy_django_plugin.main"]
|
|
76
|
+
|
|
77
|
+
[tool.django-stubs]
|
|
78
|
+
django_settings_module = "tests.settings"
|
|
79
|
+
strict_settings = false
|
|
83
80
|
|
|
84
81
|
# Ruff
|
|
85
82
|
[tool.ruff]
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from django.conf import settings
|
|
4
|
+
|
|
5
|
+
DEFAULT_VERSION = "3.4.13"
|
|
6
|
+
DEFAULT_SRC_REPO = "tailwindlabs/tailwindcss"
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def get_tailwind_cli_version() -> str:
|
|
10
|
+
"""Get the version of the Tailwind CSS CLI."""
|
|
11
|
+
return getattr(settings, "TAILWIND_CLI_VERSION", DEFAULT_VERSION)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def get_tailwind_cli_path() -> str:
|
|
15
|
+
"""Get the path to the Tailwind CSS CLI."""
|
|
16
|
+
return getattr(settings, "TAILWIND_CLI_PATH", "~/.local/bin/")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def get_tailwind_cli_automatic_download() -> bool:
|
|
20
|
+
"""Get the automatic download setting for the Tailwind CSS CLI."""
|
|
21
|
+
return getattr(settings, "TAILWIND_CLI_AUTOMATIC_DOWNLOAD", True)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def get_tailwind_cli_src_css() -> Optional[str]:
|
|
25
|
+
"""Get the source css file for the Tailwind CSS CLI."""
|
|
26
|
+
return getattr(settings, "TAILWIND_CLI_SRC_CSS", None)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def get_tailwind_cli_dist_css() -> str:
|
|
30
|
+
"""Get the dist css file for the Tailwind CSS CLI."""
|
|
31
|
+
return getattr(settings, "TAILWIND_CLI_DIST_CSS", "css/tailwind.css")
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def get_tailwind_cli_config_file() -> str:
|
|
35
|
+
"""Get the config file for the Tailwind CSS CLI."""
|
|
36
|
+
return getattr(settings, "TAILWIND_CLI_CONFIG_FILE", "tailwind.config.js")
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def get_tailwind_cli_src_repo() -> str:
|
|
40
|
+
"""Get the source repository for the Tailwind CSS CLI."""
|
|
41
|
+
return getattr(settings, "TAILWIND_CLI_SRC_REPO", DEFAULT_SRC_REPO)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def get_tailwind_cli_asset_name() -> str:
|
|
45
|
+
"""Get the asset name for the Tailwind CSS CLI."""
|
|
46
|
+
return getattr(settings, "TAILWIND_CLI_ASSET_NAME", "tailwindcss")
|
|
@@ -13,12 +13,12 @@ from typing import Optional, Union
|
|
|
13
13
|
|
|
14
14
|
import certifi
|
|
15
15
|
import typer
|
|
16
|
+
from django.conf import settings
|
|
16
17
|
from django.core.management.base import CommandError
|
|
17
18
|
from django.template.utils import get_app_template_dirs
|
|
18
19
|
from django_typer.management import TyperCommand, command, initialize
|
|
19
20
|
|
|
20
|
-
from django_tailwind_cli import utils
|
|
21
|
-
from django_tailwind_cli.conf import DEFAULT_SRC_REPO, settings
|
|
21
|
+
from django_tailwind_cli import conf, utils
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
class Command(TyperCommand):
|
|
@@ -35,7 +35,7 @@ class Command(TyperCommand):
|
|
|
35
35
|
|
|
36
36
|
# Before running the actual subcommand, we need to make sure that the CLI is installed and
|
|
37
37
|
# the config file exists.
|
|
38
|
-
if
|
|
38
|
+
if conf.get_tailwind_cli_automatic_download():
|
|
39
39
|
self.download_cli()
|
|
40
40
|
self._create_tailwind_config_if_not_exists()
|
|
41
41
|
|
|
@@ -50,7 +50,7 @@ class Command(TyperCommand):
|
|
|
50
50
|
str(utils.get_full_dist_css_path()),
|
|
51
51
|
"--minify",
|
|
52
52
|
]
|
|
53
|
-
if
|
|
53
|
+
if conf.get_tailwind_cli_src_css() is not None:
|
|
54
54
|
build_cmd.extend(
|
|
55
55
|
[
|
|
56
56
|
"--input",
|
|
@@ -75,7 +75,7 @@ class Command(TyperCommand):
|
|
|
75
75
|
str(utils.get_full_dist_css_path()),
|
|
76
76
|
"--watch",
|
|
77
77
|
]
|
|
78
|
-
if
|
|
78
|
+
if conf.get_tailwind_cli_src_css() is not None:
|
|
79
79
|
watch_cmd.extend(
|
|
80
80
|
[
|
|
81
81
|
"--input",
|
|
@@ -89,7 +89,7 @@ class Command(TyperCommand):
|
|
|
89
89
|
self._write_success("Stopped watching for changes.")
|
|
90
90
|
|
|
91
91
|
@command(name="list_templates", help="List the templates of your django project.")
|
|
92
|
-
def list_templates(self):
|
|
92
|
+
def list_templates(self) -> None:
|
|
93
93
|
template_files: list[str] = []
|
|
94
94
|
app_template_dirs = get_app_template_dirs("templates")
|
|
95
95
|
for app_template_dir in app_template_dirs:
|
|
@@ -201,7 +201,7 @@ class Command(TyperCommand):
|
|
|
201
201
|
):
|
|
202
202
|
msg = (
|
|
203
203
|
"Missing dependencies. Follow the instructions found on "
|
|
204
|
-
"https://django-tailwind-cli.rtfd.io/installation/."
|
|
204
|
+
"https://django-tailwind-cli.rtfd.io/latest/installation/."
|
|
205
205
|
)
|
|
206
206
|
raise CommandError(msg)
|
|
207
207
|
|
|
@@ -272,8 +272,8 @@ class Command(TyperCommand):
|
|
|
272
272
|
dest_file = utils.get_full_cli_path()
|
|
273
273
|
extra_msg = (
|
|
274
274
|
""
|
|
275
|
-
if
|
|
276
|
-
else f" from '{
|
|
275
|
+
if conf.get_tailwind_cli_src_repo() == conf.DEFAULT_SRC_REPO
|
|
276
|
+
else f" from '{conf.get_tailwind_cli_src_repo()}'"
|
|
277
277
|
)
|
|
278
278
|
|
|
279
279
|
if dest_file.exists():
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
from typing import Union
|
|
4
4
|
|
|
5
5
|
from django import template
|
|
6
|
+
from django.conf import settings
|
|
6
7
|
|
|
7
|
-
from django_tailwind_cli
|
|
8
|
+
from django_tailwind_cli import conf
|
|
8
9
|
|
|
9
10
|
register = template.Library()
|
|
10
11
|
|
|
@@ -12,4 +13,4 @@ register = template.Library()
|
|
|
12
13
|
@register.inclusion_tag("tailwind_cli/tailwind_css.html")
|
|
13
14
|
def tailwind_css() -> dict[str, Union[bool, str]]:
|
|
14
15
|
"""Template tag to include the css files into the html templates."""
|
|
15
|
-
return {"debug": settings.DEBUG, "tailwind_dist_css":
|
|
16
|
+
return {"debug": settings.DEBUG, "tailwind_dist_css": conf.get_tailwind_cli_dist_css()}
|
|
@@ -9,7 +9,9 @@ import os
|
|
|
9
9
|
import platform
|
|
10
10
|
from pathlib import Path
|
|
11
11
|
|
|
12
|
-
from
|
|
12
|
+
from django.conf import settings
|
|
13
|
+
|
|
14
|
+
from django_tailwind_cli import conf
|
|
13
15
|
|
|
14
16
|
|
|
15
17
|
def get_system_and_machine() -> tuple[str, str]:
|
|
@@ -32,15 +34,17 @@ def get_download_url() -> str:
|
|
|
32
34
|
system, machine = get_system_and_machine()
|
|
33
35
|
extension = ".exe" if system == "windows" else ""
|
|
34
36
|
return (
|
|
35
|
-
f"https://github.com/{
|
|
36
|
-
f"v{
|
|
37
|
+
f"https://github.com/{conf.get_tailwind_cli_src_repo}/releases/download/"
|
|
38
|
+
f"v{conf.get_tailwind_cli_version()}/{conf.get_tailwind_cli_asset_name()}-{system}-{machine}{extension}"
|
|
37
39
|
)
|
|
38
40
|
|
|
39
41
|
|
|
40
42
|
def get_full_cli_path() -> Path:
|
|
41
43
|
"""Get path to the Tailwind CSS CLI."""
|
|
42
44
|
|
|
43
|
-
cli_path =
|
|
45
|
+
cli_path = (
|
|
46
|
+
Path(conf.get_tailwind_cli_path()).expanduser() if conf.get_tailwind_cli_path() else None
|
|
47
|
+
)
|
|
44
48
|
|
|
45
49
|
# If Tailwind CSS CLI path points to an existing executable use is.
|
|
46
50
|
if cli_path and cli_path.exists() and cli_path.is_file() and os.access(cli_path, os.X_OK):
|
|
@@ -49,7 +53,7 @@ def get_full_cli_path() -> Path:
|
|
|
49
53
|
# Otherwise try to calculate the full cli path as usual.
|
|
50
54
|
system, machine = get_system_and_machine()
|
|
51
55
|
extension = ".exe" if system == "windows" else ""
|
|
52
|
-
executable_name = f"tailwindcss-{system}-{machine}-{
|
|
56
|
+
executable_name = f"tailwindcss-{system}-{machine}-{conf.get_tailwind_cli_version()}{extension}"
|
|
53
57
|
if cli_path is None:
|
|
54
58
|
return Path(settings.BASE_DIR) / executable_name
|
|
55
59
|
else:
|
|
@@ -58,10 +62,11 @@ def get_full_cli_path() -> Path:
|
|
|
58
62
|
|
|
59
63
|
def get_full_src_css_path() -> Path:
|
|
60
64
|
"""Get path to the source css."""
|
|
61
|
-
|
|
65
|
+
cli_src_css = conf.get_tailwind_cli_src_css()
|
|
66
|
+
if cli_src_css is None:
|
|
62
67
|
msg = "No source CSS file specified. Please set TAILWIND_SRC_CSS in your settings."
|
|
63
68
|
raise ValueError(msg)
|
|
64
|
-
return Path(settings.BASE_DIR) /
|
|
69
|
+
return Path(settings.BASE_DIR) / cli_src_css
|
|
65
70
|
|
|
66
71
|
|
|
67
72
|
def get_full_dist_css_path() -> Path:
|
|
@@ -70,12 +75,12 @@ def get_full_dist_css_path() -> Path:
|
|
|
70
75
|
msg = "STATICFILES_DIRS is empty. Please add a path to your static files."
|
|
71
76
|
raise ValueError(msg)
|
|
72
77
|
|
|
73
|
-
return Path(settings.STATICFILES_DIRS[0]) /
|
|
78
|
+
return Path(settings.STATICFILES_DIRS[0]) / conf.get_tailwind_cli_dist_css()
|
|
74
79
|
|
|
75
80
|
|
|
76
81
|
def get_full_config_file_path() -> Path:
|
|
77
82
|
"""Get path to the tailwind.config.js file."""
|
|
78
|
-
return Path(settings.BASE_DIR) /
|
|
83
|
+
return Path(settings.BASE_DIR) / conf.get_tailwind_cli_config_file()
|
|
79
84
|
|
|
80
85
|
|
|
81
86
|
def validate_settings() -> None:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import pytest
|
|
2
2
|
|
|
3
|
-
from django_tailwind_cli import utils
|
|
3
|
+
from django_tailwind_cli import conf, utils
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
@pytest.fixture(autouse=True)
|
|
@@ -93,10 +93,10 @@ def test_get_download_url(mocker, platform, machine, result):
|
|
|
93
93
|
@pytest.mark.parametrize(
|
|
94
94
|
"platform,machine,result",
|
|
95
95
|
[
|
|
96
|
-
("Windows", "x86_64", "tailwindcss-windows-x64-
|
|
97
|
-
("Windows", "amd64", "tailwindcss-windows-x64-
|
|
98
|
-
("Darwin", "aarch64", "tailwindcss-macos-arm64-
|
|
99
|
-
("Darwin", "arm64", "tailwindcss-macos-arm64-
|
|
96
|
+
("Windows", "x86_64", f"tailwindcss-windows-x64-{conf.DEFAULT_VERSION}.exe"),
|
|
97
|
+
("Windows", "amd64", f"tailwindcss-windows-x64-{conf.DEFAULT_VERSION}.exe"),
|
|
98
|
+
("Darwin", "aarch64", f"tailwindcss-macos-arm64-{conf.DEFAULT_VERSION}"),
|
|
99
|
+
("Darwin", "arm64", f"tailwindcss-macos-arm64-{conf.DEFAULT_VERSION}"),
|
|
100
100
|
],
|
|
101
101
|
)
|
|
102
102
|
def test_get_full_cli_path(mocker, platform, machine, result):
|