Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ jobs:

- name: Build source and wheel dist
# Uses hatchling as defined in pyproject.toml
run: python3 -m build
run: |
echo "==> Set prod logging"
mv batch_img/config.json batch_img/config_bk.json
cp -p batch_img/config_prod.json batch_img/config.json
echo "Build by hatchling defined in pyproject.toml"
python3 -m build
echo "==> Restore config.json"
mv batch_img/config_bk.json batch_img/config.json

- name: Validate dist files
run: twine check dist/*
Expand Down
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# make check # validate the distribution files
# make install-local # install into current venv and smoke-test

PYTHON_FILES = batch_img
VERSION ?= $(shell python -c "from batch_img.const import __version__; print(__version__)" 2>/dev/null || echo "0.0.0")

clean:
Expand All @@ -18,16 +17,21 @@ clean:
rm -fr docs/build out_*.yaml tmp_*

lint: clean
pylint $(PYTHON_FILES) --ignore=venv,tests
pylint batch_img --ignore=venv,tests
ruff check --fix --exit-non-zero-on-fix

test: lint
pytest --cov-report=term --cov=batch_img tests

dist: clean
@echo "==> Set prod logging"
mv batch_img/config.json batch_img/config_bk.json
cp -p batch_img/config_prod.json batch_img/config.json
# Build wheel and sdist packages
python -m build --sdist
@echo "Distribution files created in ./dist/"
@echo "==> Restore config.json"
mv batch_img/config_bk.json batch_img/config.json

check: dist
# Validate the distribution files
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ requires = ["hatchling"]

[project]
name = "batch_img"
version = "1.4.2"
version = "1.4.3"
description = "Batch process (resize, rotate, remove background, remove GPS, add border, set transparency, auto do all) image files (HEIC, JPG, PNG)"
readme = "README.md"
authors = [{ name = "John Liu", email = "rim2rim@gmail.com" }]
Expand Down
6 changes: 3 additions & 3 deletions tests/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def os_platform(request):
return request.param


@pytest.fixture(params=[(PKG_NAME, "1.4.2"), ("", "1.4.2")])
@pytest.fixture(params=[(PKG_NAME, "1.4.3"), ("", "1.4.3")])
def ver_data(request):
return request.param

Expand All @@ -49,7 +49,7 @@ def test_get_version(ver_data):
(
"1.9.9",
PKG_NAME,
f"🔔 Update available: 1.4.2 → 1.9.9\nRun '{PKG_NAME} --update'",
f"🔔 Update available: 1.4.3 → 1.9.9\nRun '{PKG_NAME} --update'",
),
]
)
Expand All @@ -67,7 +67,7 @@ def test_check_latest_version(mock_get_latest_pypi, data_check_latest_version):

@pytest.fixture(
params=[
(PKG_NAME, 0, "1.4.1"),
(PKG_NAME, 0, "1.4.2"),
("bad_bogus", 1, UNKNOWN),
]
)
Expand Down