Skip to content

Commit

Permalink
Merge pull request #1363 from django-wiki/feature/build-scss-on-release
Browse files Browse the repository at this point in the history
Add support for build scss files on hatch build
  • Loading branch information
benjaoming committed May 22, 2024
2 parents 050f124 + 176f6db commit 3138ec9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- image: cimg/python:<<parameters.python_version>>
steps:
- checkout
- run: pip install coverage[toml] hatch
- run: pip install coverage[toml] hatch libsass
- run: python -m hatch --env test.<<parameters.hatch_env>> run all
- codecov/upload

Expand All @@ -30,7 +30,7 @@ jobs:
- image: cimg/python:3.11
steps:
- checkout
- run: pip install hatch && python -m hatch --env test.py3.11-dj4.2 run lint
- run: pip install hatch libsass && python -m hatch --env test.py3.11-dj4.2 run lint


workflows:
Expand Down
15 changes: 13 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["hatchling"]
requires = ["hatchling", "hatch-build-scripts"]
build-backend = "hatchling.build"

[project]
Expand Down Expand Up @@ -78,6 +78,17 @@ Documentation = "https://django-wiki.readthedocs.io/en/latest/"
Tracker = "https://github.com/django-wiki/django-wiki/issues"
Source = "https://github.com/django-wiki/django-wiki"

[[tool.hatch.build.hooks.build-scripts.scripts]]
out_dir = "src/wiki/static/wiki/bootstrap/css/"
commands = [
"[[ -z $READTHEDOCS_VIRTUALENV_PATH ]] && pysassc --style compressed src/wiki/static/wiki/bootstrap/scss/wiki/wiki-bootstrap.scss src/wiki/static/wiki/bootstrap/css/wiki-bootstrap.min.css || true",
]
artifacts = [
"wiki-bootstrap.min.css",
]
clean_artifacts = true
clean_out_dir = true

[tool.hatch.publish.index]
disable = true

Expand All @@ -104,6 +115,7 @@ dependencies = [
"pytest-django",
"pytest-pythonpath",
"pytest>=6.2.5,<7.3",
"hatch-build-scripts==0.0.4",
]

[tool.hatch.envs.default.scripts]
Expand Down Expand Up @@ -131,7 +143,6 @@ clean-pyc = [
"find . -name '*~' -exec rm -f {{}} +",
"find . -name '__pycache__' -exec rm -fr {{}} +",
]
assets = "sassc --style compressed src/wiki/static/wiki/bootstrap/scss/wiki/wiki-bootstrap.scss src/wiki/static/wiki/bootstrap/css/wiki-bootstrap.min.css"
test = "pytest {args}"

[tool.hatch.envs.test.overrides]
Expand Down
4 changes: 2 additions & 2 deletions src/wiki/static/wiki/bootstrap/css/wiki-bootstrap.min.css

Large diffs are not rendered by default.

This file was deleted.

0 comments on commit 3138ec9

Please sign in to comment.