-
Notifications
You must be signed in to change notification settings - Fork 2
/
makefile
33 lines (28 loc) · 838 Bytes
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
msg?=
.ONESHELL:
gitcheck:
if [[ "$(msg)" = "" ]] ; then echo "Usage: make pkg msg='commit msg'";exit 20; fi
install:
pip install -e .
#-e git+https://somerepo/bar.git#egg=bar
#-e /path/to/pkg
install-git:
pipx install git+https://github.com/ahuigo/xlparser.git
test:
python3 -m pytest -s
###################### publish package #####################################
# poetry: make pkg msg='xx'
pkg: gitcheck test
rm -rf dist/*
{ hash newversion.py 2>/dev/null && newversion.py pyproject.toml;} # one cli
poetry build && poetry publish
git commit -am "$(msg)"
git push origin HEAD
############### how to create a new project with poetry? ##########################
# 1. create project package
create:
poetry new mypkg
# 2. 生成poetry.lock + requirements.txt
lock:
poetry lock
poetry export --output requirements.txt