Switch to using Justfile instead of Makefile#61
Conversation
treyhunner
left a comment
There was a problem hiding this comment.
I made a few commits in a separate branch to show some things I've been doing in my just files. One of them also renames the file to lowercase (jusfile instead of Justfile). For some reason, my text editor will syntax highlight the lowercased name but not the uppercased version.
I like self-documenting tasks and hiding tasks that I probably won't ever call directly (by using an _ prefix).
I also like using task groups, but there aren't many tasks in this project, so I didn't add a commit for that, as it may not be worthwhile yet.
Feel free to pull any or all of those changes or take inspiration from them in this branch.
| venv-test: venv | ||
| .venv/bin/python3 -m pip install .[test] | ||
|
|
||
| init: venv-build venv-test |
There was a problem hiding this comment.
I think this is missing a venv-docs:
init: venv-build venv-test venv-docs
| @@ -0,0 +1,50 @@ | |||
| all: init docs clean test | |||
There was a problem hiding this comment.
I often like to make the default just command do the the equivalent of just --list --unsorted because I often forget which commands various projects include.
Thoughts on something like this?
_default:
@just --list --unsorted
Odd! I see the changes listed on PyPI currently: https://pypi.org/project/django-email-log/ I wonder whether PyPI changed or whether this still works. If the include still works, maybe we should just ignore this warning. |
| find . -name '*~' -exec rm -f {} + | ||
|
|
||
| venv: | ||
| if [[ ! -d .venv ]]; then python3 -m venv .venv; fi |
There was a problem hiding this comment.
This seemed to be an error in my shell (ZSH):
...
if [[ ! -d .venv ]]; then python3 -m venv .venv; fi
sh: 1: [[: not found
.venv/bin/python3 -m pip install .[build]
There was a problem hiding this comment.
That should be pretty bog standard Bash/ZSH - I developed that using ZSH myself. Is your Just shelling out to sh instead of zsh?
Can you copy and paste that command out of the justfile and straight into your shell? If it works then Just is doing something interesting.
I just tried to deploy a release and PyPI rejected the README as invalid: Removing it worked, so I think we need to remove that |
This switches the project away from using a
Makefileto using aJustfile. This utilizes Just (installation packages/commands available here).The Justfile creates a virtualenv in
.venvand uses it within subsequent recipes. Activating the virtualenv manually is not required when running Just recipes. However, part of my intent here was to allow developers -- after they had activated that virtualenv manually with. .venv/bin/activate-- to simply run commands normally, liketoxandpytest, and produce the same result. Meaning that I tried to keep CLI tool configuration flags (likepytest --cov --cov-branch) out of theJustfileand in normal configuration files liketox.iniandpyproject.toml.I also outlined the intended building and publishing process in the README.
A few notes...
The build process currently throws up the following warning:
It's not an error yet, so I say we ignore it for this release and fix it in the next one.
Additionally, when Twine checks the built distributables, it emits this warning:
I think the issue is the
includedirective for the changelog in the README, because this patch fixes it:@treyhunner I'm not sure what you wanted to do about this, so I left it alone. If we do nothing, I think PyPI will display the unrendered rST README verbatim, but I have not confirmed this.