Skip to content

Commit

Permalink
Project cleanup
Browse files Browse the repository at this point in the history
- Set the minimum supported version of Python to 3.9.
- Set the minimum supported version of Django to 4.2.
- Switched the tooling completely to [uv](https://docs.astral.sh/uv/).
- Bumped the default version of Tailwind CSS to 3.4.11.
  • Loading branch information
oliverandrich committed Sep 15, 2024
1 parent 7435db1 commit 3db3475
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 37 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,24 @@ jobs:
with:
python-version: "3.12"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flit mkdocs-material
- name: Install and setup uv
uses: hynek/setup-cached-uv@v2

- name: Build
run: uv build

- name: Check
run: uvx twine check dist/*

- name: Publish
run: |
flit publish
uvx twine upload dist/*
env:
FLIT_USERNAME: __token__
FLIT_PASSWORD: ${{ secrets.PYPI_TOKEN }}
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}

- name: Build documentation
run: mkdocs build
run: uvx --with mkdocs-material mkdocs build

- name: Publish documentation
run: mkdocs gh-deploy --force
run: uvx --with mkdocs-material mkdocs gh-deploy --force
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 2.16.0

- Set the minimum supported version of Python to 3.9.
- Set the minimum supported version of Django to 4.2.
- Switched the tooling completely to [uv](https://docs.astral.sh/uv/).
- Bumped the default version of Tailwind CSS to 3.4.11.

## 2.15.0

- [#130](https://github.com/oliverandrich/django-tailwind-cli/pull/130) by [@Tobi-De](https://github.com/Tobi-De) extended the support for custom tailwind cli builds. See `TAILWIND_CLI_SRC_REPO` and `TAILWIND_CLI_ASSET_NAME` in the documentation.
Expand Down
24 changes: 8 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/oliverandrich/django-tailwind-cli/test.yml?style=flat-square)
[![PyPI](https://img.shields.io/pypi/v/django-tailwind-cli.svg?style=flat-square)](https://pypi.org/project/django-tailwind-cli/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://github.com/psf/black)
[![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
![GitHub](https://img.shields.io/github/license/oliverandrich/django-tailwind-cli?style=flat-square)
![Django Versions](https://img.shields.io/pypi/frameworkversions/django/django-tailwind-cli)
![Python Versions](https://img.shields.io/pypi/pyversions/django-tailwind-cli)
Expand Down Expand Up @@ -72,17 +73,15 @@ Checkout the detailed [installation guide](https://django-tailwind-cli.andrich.m
## Requirements
Python 3.8 or newer with Django >= 3.2.
Python 3.9 or newer with Django >= 4.2.
## Documentation
The documentation can be found at [https://django-tailwind-cli.andrich.me/](https://django-tailwind-cli.andrich.me/)
## Contributing
In order to contribute, this package has no required tool dependencies besides an installed version
of Python and pip. But you can use uv to speed up your workflow a bit. The following commands assume
that you have already setup a virtual environment and activated it.
This package requires [uv](https://docs.astral.sh/uv/) for dependency management and tooling. So you have to [install it](https://docs.astral.sh/uv/getting-started/installation/) first. [just](https://github.com/casey/just) is used as a handy command runner to save some typing on the command line. Do yourself a favor and install it too.
```shell
# Setup development environment
Expand All @@ -98,24 +97,17 @@ just lint
just test
```
### Without just, but using pip
```bash
# Install dependencies
pip3 install -e ".[django-extensions,dev,docs]"
# Run tox testrunner
tox
```
### Without just, but using uv
```bash
# Create venv
uv venv
# Install dependencies
uv pip install -r pyproject.toml --all-extras -e .
uv sync --all-extras
# Run tox testrunner
tox
uvx --with tox-uv tox
```
## License
Expand Down
2 changes: 1 addition & 1 deletion docs/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The package can be configured by a few settings, which can be overwritten in the
your project.

`TAILWIND_CLI_VERSION`
: **Default**: `"3.4.10"`
: **Default**: `"3.4.11"`

This defines the version of the CLI and of Tailwind CSS you want to use in your project.

Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ classifiers = [
"Framework :: Django :: 5.0",
"Framework :: Django :: 5.1",
]
version = "2.15.0"
dynamic = ["version"]
requires-python = ">=3.9"
dependencies = [
"django>=4.2",
Expand All @@ -48,9 +48,12 @@ dev-dependencies = [
]

[build-system]
requires = ["hatchling"]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[tool.hatch.version]
source = "vcs"

# Black
[tool.black]
target-version = ["py38"]
Expand Down
4 changes: 3 additions & 1 deletion src/django_tailwind_cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
__version__ = "2.15.0"
from importlib.metadata import version

__version__ = version("django-tailwind-cli")
2 changes: 1 addition & 1 deletion src/django_tailwind_cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Config:

@property
def tailwind_version(self) -> str:
return getattr(settings, "TAILWIND_CLI_VERSION", "3.4.10")
return getattr(settings, "TAILWIND_CLI_VERSION", "3.4.11")

@property
def cli_path(self) -> Union[Path, None]:
Expand Down
14 changes: 7 additions & 7 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ def configure_settings(settings):


def test_default_config(config):
assert "3.4.10" == config.tailwind_version
assert "3.4.11" == config.tailwind_version
assert Path("~/.local/bin/").expanduser() == config.cli_path
assert config.src_css is None
assert "css/tailwind.css" == config.dist_css
assert "tailwind.config.js" == config.config_file
assert "3.4.10" in config.get_download_url()
assert "3.4.10" in str(config.get_full_cli_path())
assert "3.4.11" in config.get_download_url()
assert "3.4.11" in str(config.get_full_cli_path())


def test_validate_settigns(config, settings):
Expand Down Expand Up @@ -99,10 +99,10 @@ def test_get_download_url(config, mocker, platform, machine, result):
@pytest.mark.parametrize(
"platform,machine,result",
[
("Windows", "x86_64", "tailwindcss-windows-x64-3.4.10.exe"),
("Windows", "amd64", "tailwindcss-windows-x64-3.4.10.exe"),
("Darwin", "aarch64", "tailwindcss-macos-arm64-3.4.10"),
("Darwin", "arm64", "tailwindcss-macos-arm64-3.4.10"),
("Windows", "x86_64", "tailwindcss-windows-x64-3.4.11.exe"),
("Windows", "amd64", "tailwindcss-windows-x64-3.4.11.exe"),
("Darwin", "aarch64", "tailwindcss-macos-arm64-3.4.11"),
("Darwin", "arm64", "tailwindcss-macos-arm64-3.4.11"),
],
)
def test_get_full_cli_path(config, mocker, platform, machine, result):
Expand Down

0 comments on commit 3db3475

Please sign in to comment.