Skip to content

Commit

Permalink
Merge branch 'master' into rebuild_needed_only
Browse files Browse the repository at this point in the history
  • Loading branch information
venthur committed Nov 12, 2023
2 parents c87a300 + 55e2f41 commit 71c866c
Show file tree
Hide file tree
Showing 63 changed files with 2,119 additions and 1,128 deletions.
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ updates:
directory: "/"
schedule:
interval: "weekly"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
60 changes: 52 additions & 8 deletions .github/workflows/python-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,63 @@ jobs:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
exclude:
# 3.8 on windows fails due to some pip issue
- os: windows-latest
python-version: "3.8"

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Run tests
run: |
- run: |
make venv
- run: |
make test
- name: Run linter
run: |
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.x"

- run: |
make venv
- run: |
make lint
mypy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.x"

- run: |
make venv
- run: |
make mypy
test-release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.x"

- run: |
make venv
- run: |
make test-release
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ build/
dist/
*.egg-info/

docs/_build/
docs/api/
site/

htmlcov/
.coverage
.mypy_cache

venv/
9 changes: 8 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.11"

mkdocs:
configuration: mkdocs.yml

python:
version: 3.8
install:
- requirements: requirements.txt
- requirements: requirements-dev.txt
Expand Down
106 changes: 104 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,113 @@
# Changelog

## unreleased
## [2.2.1] -- 2023-11-11

* fixed `suggests` to blag-doc

## [2.2.0] -- 2023-11-05

* switched from flake8 to ruff
* added missing docstrings
* fixed dev requirements in pyproject, still pointing to sphinx
* added Python3.12 to test suite
* removed debian/watch

## [2.1.0] -- 2023-08-27

* default theme: `img` have now `max-width: 100%` by default to avoid very
large images overflowing
* packaging: explicitly list `templates`, `static` and `content` as packages
instead of relying on package-data for setuptools. additionally, created a
MANIFEST.in to add the contents of these directories here as well. the
automatic finding of namespace packages and packaga-data, currently does not
work as advertised in setuptools' docs
* updated dependencies
* created debian/watch

## [2.0.0] - 2023-06-16

### Breaking

* blag does not use default fallback templates anymore and will return an error
if it is unable to find required templates, e.g. in `templates/`.

Users upgrading from older versions can either run `blag quickstart` (don't
forget to backup your `config.ini` or copy the templates from blag's
resources (the resource path is shown in the error message).

New users are not affected as `blag quickstart` will generate the needed
templates.

* Split former archive page which served as index.html into "index" and
"archive", each with their own template, respectively. Index is the landing
page and shows by default only the latest 10 articles. Archive shows the full
list of articles.

If you used custom templates,
* you should create an "index.html"-template (take blag's default one as a
starting point)
* you may want to include the new "/archive.html" link somewhere in your
navigation

### Changed

* blag comes now with a simple yet good looking default theme that supports
syntax highlighting and a light- and dark theme.

* apart from the generated configuration, `blag quickstart` will now also
create the initial directory structure, with the default template, the static
directory with the CSS files and the content directory with some initial
content to get the user started

* Added a make target to update the pygments themes

* updated dependencies:
* markdown 3.4.3
* pygments 2.15.1
* pytest 7.3.2
* types-markdown 3.4.2.9
* build 0.10.0

* Switched from sphinx to mkdocs

### Fixed

* fixed pyproject.toml to include tests/conftest.py


## [1.5.0] - 2023-04-16

* moved to pyproject.toml
* added python 3.11 to test suite
* break out lint and mypy from test matrix and only run on linux- and latest
stable python to make it a bit more efficient
* added dependabot check for github actions
* updated dependencies:
* mypy 1.2.0
* types-markdown 3.4.2.1
* pytest-cov 4.0.0
* sphinx 5.3.0
* pytest 7.3.0
* flake8 6.0.0
* twine 4.0.2
* wheel 0.40.0

## [1.4.1] - 2022-09-29

* applied multi-arch fix by debian-janitor
* updated dependencies:
* pytest 7.1.3
* sphinx 5.2.1
* types-markdown 3.4.2

## [1.4.0] - 2022-09-01

* added type hints and mypy --strict to test suite
* improved default template
* updated dependencies:
* markdown 3.4.1
* flake 5.0.2
* pygments 2.13.0
* flake 5.0.4
* twine 4.0.1
* sphinx 5.1.1

Expand Down
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
recursive-include blag/content *
recursive-include blag/static *
recursive-include blag/templates *
36 changes: 26 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ VENV = venv
BIN=$(VENV)/bin

DOCS_SRC = docs
DOCS_OUT = $(DOCS_SRC)/_build
DOCS_OUT = site


ifeq ($(OS), Windows_NT)
Expand All @@ -14,40 +14,56 @@ endif


.PHONY: all
all: lint test
all: lint mypy test test-release

$(VENV): requirements.txt requirements-dev.txt setup.py
$(VENV): requirements.txt requirements-dev.txt pyproject.toml
$(PY) -m venv $(VENV)
$(BIN)/pip install --upgrade -r requirements.txt
$(BIN)/pip install --upgrade -r requirements-dev.txt
$(BIN)/pip install -e .
$(BIN)/pip install -e .['dev']
touch $(VENV)

.PHONY: test
test: $(VENV)
$(BIN)/pytest

.PHONY: mypy
mypy: $(VENV)
$(BIN)/mypy

.PHONY: lint
lint: $(VENV)
$(BIN)/flake8
$(BIN)/ruff check .

.PHONY: release
release: $(VENV)
.PHONY: build
build: $(VENV)
rm -rf dist
$(BIN)/python setup.py sdist bdist_wheel
$(BIN)/python3 -m build

.PHONY: test-release
test-release: $(VENV) build
$(BIN)/twine check dist/*

.PHONY: release
release: $(VENV) build
$(BIN)/twine upload dist/*

.PHONY: update-pygmentize
update-pygmentize: $(VENV)
$(BIN)/pygmentize -f html -S default > blag/static/code-light.css
$(BIN)/pygmentize -f html -S monokai > blag/static/code-dark.css

.PHONY: docs
docs: $(VENV)
$(BIN)/sphinx-build $(DOCS_SRC) $(DOCS_OUT)
$(BIN)/mkdocs build

.PHONY: clean
clean:
rm -rf build dist *.egg-info
rm -rf $(VENV)
rm -rf $(DOCS_OUT)
rm -rf $(DOCS_SRC)/api
find . -type f -name *.pyc -delete
find . -type d -name __pycache__ -delete
# coverage
rm -rf htmlcov .coverage
rm -rf .mypy_cache
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ blag is named after [the blag of the webcomic xkcd][blagxkcd].
## Features

* Write content in [Markdown][]
* Good looking default theme:
![Blag Screenshot](blag/static/blag.png)
* Theming support using [Jinja2][] templates
* Generation of Atom feeds for blog content
* Fenced code blocks and syntax highlighting using [Pygments][]
Expand Down
2 changes: 1 addition & 1 deletion blag/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from blag.version import __VERSION__ # noqa
from blag.version import __VERSION__ as __VERSION__ # noqa
Loading

0 comments on commit 71c866c

Please sign in to comment.