Skip to content

Commit

Permalink
Refactoring and addition of remove_cli command
Browse files Browse the repository at this point in the history
- Refactored the class based commands to function based ones.
- Added remove_cli subcommand. (Closes #132)
  • Loading branch information
oliverandrich committed Dec 7, 2024
1 parent 9de1e60 commit c123959
Show file tree
Hide file tree
Showing 20 changed files with 1,038 additions and 517 deletions.
104 changes: 16 additions & 88 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ cover/
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
db.sqlite3*
static/

# Flask stuff:
instance/
Expand All @@ -85,7 +85,7 @@ ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
.python-version
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
Expand All @@ -94,6 +94,12 @@ ipython_config.py
# install all needed dependencies.
#Pipfile.lock

# UV
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
#uv.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
Expand All @@ -106,8 +112,10 @@ ipython_config.py
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/
Expand Down Expand Up @@ -152,95 +160,15 @@ dmypy.json
# Cython debug symbols
cython_debug/

# Ruff cache
.ruff_cache

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Local History for Visual Studio Code
.history/
.idea/

# Built Visual Studio Code Extensions
*.vsix
# VScode
.vscode/

# General
# macOS
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

# direnv
.direnv
.envrc
5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions .idea/django-tailwind-cli.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/ruff.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,6 @@ repos:
- id: django-upgrade
args: [--target-version, "4.2"]

- repo: local
hooks:
- id: mypy
name: mypy
language: system
types: [python]
entry: uv run mypy
require_serial: true

- repo: https://github.com/adamchainz/djade-pre-commit
rev: "1.3.2"
hooks:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 2.21.0

-
- Refactored the process to build the runserver command.

## 2.20.2

- Added testpypi release workflow.
Expand Down
4 changes: 4 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ Run `python manage.py tailwind download_cli` to just download the CLI. This comm

Run `python manage.py tailwind list_templates` to find all templates in your django project. This is handy for a setup where you dynamically build the list of files being analyzed by tailwindcss.

### remove_cli

Run `python manage.py tailwind remove_cli` to remove the installed cli.

### runserver

Run `python manage.py tailwind runserver` to start the classic Django debug server in parallel to a tailwind watcher process.
Expand Down
16 changes: 12 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ classifiers = [
]
dynamic = ["version"]
requires-python = ">=3.9"
dependencies = ["django>=4.2", "certifi>=2024.8.30", "django-typer>=2.1.2"]
dependencies = [
"django>=4.2",
"django-typer>=2.1.2",
"requests>=2.32.3",
]

[project.optional-dependencies]
django-extensions = ["django-extensions>=3.2", "werkzeug>=3.0"]
Expand All @@ -34,15 +38,16 @@ Home = "https://django-tailwind-cli.rtfd.io/"
Documentation = "https://django-tailwind-cli.rtfd.io/"
Repository = "https://github.com/django-commons/django-tailwind-cli"

[tool.uv]
dev-dependencies = [
[dependency-groups]
dev = [
"pytest-cov>=5.0.0",
"pytest-django>=4.9.0",
"pytest-mock>=3.14.0",
"pytest-randomly>=3.15.0",
"pytest-sugar>=1.0.0",
"pytest>=8.3.3",
"django-stubs[compatible-mypy]>=5.1.1",
"tox>=4.23.2",
"tox-uv>=1.16.0",
]

[build-system]
Expand Down Expand Up @@ -133,6 +138,9 @@ ban-relative-imports = "all"
DJANGO_SETTINGS_MODULE = "tests.settings"
pythonpath = [".", "src"]
testpaths = ["tests"]
filterwarnings = [
"ignore:In Typer, only the parameter 'autocompletion' is supported.:DeprecationWarning",
]

# Coverage
[tool.coverage.run]
Expand Down
Loading

0 comments on commit c123959

Please sign in to comment.