Skip to content

Commit

Permalink
Merge pull request #109 from nschloe/justfile
Browse files Browse the repository at this point in the history
make -> just
  • Loading branch information
nschloe authored Jul 20, 2021
2 parents 356fa1a + a35e927 commit 7ecc932
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 5 deletions.
5 changes: 0 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ dep:
cp node_modules/bootstrap/dist/css/bootstrap.min.css tuna/web/static/
cp node_modules/d3/dist/d3.min.js tuna/web/static/

update:
npm update
npm update --save-dev
npm outdated

publish: tag upload

clean:
Expand Down
44 changes: 44 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
version := `python3 -c "from configparser import ConfigParser; p = ConfigParser(); p.read('setup.cfg'); print(p['metadata']['version'])"`
name := `python3 -c "from configparser import ConfigParser; p = ConfigParser(); p.read('setup.cfg'); print(p['metadata']['name'])"`


default:
@echo "\"just publish\"?"

tag:
@if [ "$(git rev-parse --abbrev-ref HEAD)" != "main" ]; then exit 1; fi
curl -H "Authorization: token `cat ~/.github-access-token`" -d '{"tag_name": "{{version}}"}' https://api.github.com/repos/nschloe/{{name}}/releases

upload: clean
@if [ "$(git rev-parse --abbrev-ref HEAD)" != "main" ]; then exit 1; fi
# https://stackoverflow.com/a/58756491/353337
python3 -m build --sdist --wheel .
twine upload dist/*

publish: tag upload

clean:
@find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf
@rm -rf src/*.egg-info/ build/ dist/ .tox/

dep:
npm install
cp node_modules/bootstrap/dist/css/bootstrap.min.css tuna/web/static/
cp node_modules/d3/dist/d3.min.js tuna/web/static/

update:
npm update
npm update --save-dev
npm outdated

lint:
flake8 .
black --check .
# blacken-docs README.md
npm run prettier
npm run htmlhint

format:
isort .
black .
prettier --write tuna/web/static/icicle.js

0 comments on commit 7ecc932

Please sign in to comment.