From 9d1720bf00a578c1e9b2bc5cfbd4a5eca58a24f4 Mon Sep 17 00:00:00 2001 From: Miguel Gonzalez Date: Sat, 8 Jun 2024 12:07:23 +0200 Subject: [PATCH 1/3] doc: Add section howto run tests --- Makefile | 37 ------------------------------------- README.rst | 19 +++++++++++++++++++ justfile | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 37 deletions(-) delete mode 100644 Makefile create mode 100644 justfile diff --git a/Makefile b/Makefile deleted file mode 100644 index 41fb87c..0000000 --- a/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -# SPDX-FileCopyrightText: 2013-2022 Miguel Gonzalez -# -# SPDX-License-Identifier: CC0-1.0 - -PYTHON := .venv/bin/python - -default: test - -install: - python -m venv .venv - ${PYTHON} -m pip install --upgrade pip setuptools wheel - ${PYTHON} -m pip install docutils pygments - ${PYTHON} -m pip install build twine check-wheel-contents - -release: clean test build - @echo Check: - @echo '' - @echo '[ ] Change log updated.' - @echo '[ ] Version bumped (bumpversion patch).' - @echo '[ ] Updated GitHub (git push).' - @echo '' - @echo 'Finally:' - @echo '' - @echo '[ ] Upload to PyPI (twine upload dist/*).' - -test: install - ${PYTHON} test_dj_email_url.py - ${PYTHON} -m docutils README.rst --halt=info >/dev/null - ${PYTHON} -m docutils CHANGELOG.rst --halt=info >/dev/null - -build: install - ${PYTHON} -m build --sdist --wheel . - ${PYTHON} -m check_wheel_contents dist/*.whl - -clean: - rm -f README.rst.html - rm -f dist/* diff --git a/README.rst b/README.rst index 00d73b2..f3796fa 100644 --- a/README.rst +++ b/README.rst @@ -223,6 +223,25 @@ File backend The file backend is the only one which needs a path. The url path is store in ``EMAIL_FILE_PATH`` key. + +Running the tests +================= + +Fork, then clone the repo: + +.. code:: bash + + git clone git@github.com:put-your-user-here/dj-email-url.git + +Then you can run the tests with the *just* command runner: + +.. code:: bash + + just test + +If you don't have *just* installed, +you can look in the ``justfile`` for the commands that are run. + License ======= diff --git a/justfile b/justfile new file mode 100644 index 0000000..9a30ef4 --- /dev/null +++ b/justfile @@ -0,0 +1,37 @@ +# SPDX-FileCopyrightText: 2013-2022 Miguel Gonzalez +# +# SPDX-License-Identifier: CC0-1.0 + +python := ".venv/bin/python" + +default: test + +install: + python -m venv .venv + {{python}} -m pip install --upgrade pip setuptools wheel + {{python}} -m pip install docutils pygments + {{python}} -m pip install build twine check-wheel-contents + +release: clean test build + @echo Check: + @echo '' + @echo '[ ] Change log updated.' + @echo '[ ] Version bumped (bumpversion patch).' + @echo '[ ] Updated GitHub (git push).' + @echo '' + @echo 'Finally:' + @echo '' + @echo '[ ] Upload to PyPI (twine upload dist/*).' + +test: install + {{python}} test_dj_email_url.py + {{python}} -m docutils README.rst --halt=info >/dev/null + {{python}} -m docutils CHANGELOG.rst --halt=info >/dev/null + +build: install + {{python}} -m build --sdist --wheel . + {{python}} -m check_wheel_contents dist/*.whl + +clean: + rm -f README.rst.html + rm -f dist/* From 4c6c097f684b8f92a5dc3ce6acdacce241b4585a Mon Sep 17 00:00:00 2001 From: Miguel Gonzalez Date: Sat, 8 Jun 2024 12:26:30 +0200 Subject: [PATCH 2/3] chore: Check venv already exists --- justfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/justfile b/justfile index 9a30ef4..b507c2f 100644 --- a/justfile +++ b/justfile @@ -7,7 +7,7 @@ python := ".venv/bin/python" default: test install: - python -m venv .venv + test -e {{python}} || python -m venv .venv {{python}} -m pip install --upgrade pip setuptools wheel {{python}} -m pip install docutils pygments {{python}} -m pip install build twine check-wheel-contents From 14c86132ed3dab9a70f2814aa5c18a9770b8703c Mon Sep 17 00:00:00 2001 From: Miguel Gonzalez Date: Sat, 8 Jun 2024 12:36:55 +0200 Subject: [PATCH 3/3] chore: Split test/build requirements --- justfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/justfile b/justfile index b507c2f..fa8383e 100644 --- a/justfile +++ b/justfile @@ -10,6 +10,8 @@ install: test -e {{python}} || python -m venv .venv {{python}} -m pip install --upgrade pip setuptools wheel {{python}} -m pip install docutils pygments + +requirements-build: install {{python}} -m pip install build twine check-wheel-contents release: clean test build @@ -28,7 +30,7 @@ test: install {{python}} -m docutils README.rst --halt=info >/dev/null {{python}} -m docutils CHANGELOG.rst --halt=info >/dev/null -build: install +build: requirements-build {{python}} -m build --sdist --wheel . {{python}} -m check_wheel_contents dist/*.whl