Skip to content

Commit 9584fde

Browse files
committed
Create version 0.1.0
1 parent de8bece commit 9584fde

File tree

8 files changed

+466
-61
lines changed

8 files changed

+466
-61
lines changed

.gitignore

+16
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,18 @@
1+
# Ignore Vim swap files.
12
*.sw?
3+
4+
# Ignore macOS Desktop Services Store.
25
.DS_Store
6+
7+
# Ignore development files.
8+
venv
9+
user-venv
10+
11+
# Ignore build files.
12+
*.pyc
13+
__pycache__/
14+
.coverage
15+
htmlcov/
16+
build/
17+
dist/
18+
mintotp.egg-info/

.travis.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
language: python
2+
3+
python:
4+
- "3.4"
5+
- "3.5"
6+
- "3.6"
7+
- "3.7"
8+
9+
install:
10+
- make deps
11+
12+
script:
13+
- make checks
14+
15+
after_success:
16+
- coveralls

CHANGES.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Changelog
2+
=========
3+
4+
0.1.0 (2019-08-12)
5+
------------------
6+
7+
### Added
8+
9+
- Add a minimal TOTP generator.
10+
- Expose `hotp()` and `totp()` as module-level functions.
11+
- Add project documentation.

Makefile

+110-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,119 @@
11
URI1 = otpauth://totp/alice:bob?secret=ZYTYYE5FOAGW5ML7LRWUL4WTZLNJAMZS
22
URI2 = otpauth://totp/alice:cam?secret=PW4YAYYZVDE5RK2AOLKUATNZIKAFQLZO&issuer=alice
33

4-
gen:
5-
python3 totp.py $$(zbarimg -q *.png | sed 's/.*secret=\([^&]*\).*/\1/')
4+
help:
5+
@echo 'Release Checklist'
6+
@echo '================='
7+
@echo
8+
@echo 'vim setup.py # Update version'
9+
@echo 'vim CHANGES.md # Update changelog'
10+
@echo
11+
@echo 'make checks'
12+
@echo 'make dist test-upload verify-test-upload'
13+
@echo 'open https://test.pypi.org/project/mintotp/'
14+
@echo
15+
@echo 'git add .'
16+
@echo 'git status'
17+
@echo 'git commit'
18+
@echo 'git push origin master'
19+
@echo
20+
@echo 'make upload verify-upload'
21+
@echo 'open https://pypi.org/project/mintotp/'
22+
@echo
23+
@echo "VER=$$(grep version setup.py | cut -d\' -f2)"
24+
@echo 'git tag $$VER -m "MinTOTP $$VER"'
25+
@echo 'git push origin $$VER'
26+
@echo
627

28+
# Development.
29+
rmvenv:
30+
rm -rf ~/.venv/mintotp venv
31+
32+
venv: FORCE
33+
python3 -m venv ~/.venv/mintotp
34+
echo . ~/.venv/mintotp/bin/activate > venv
35+
36+
deps:
37+
touch venv
38+
. ./venv && \
39+
pip3 install pylama pylama-pylint coverage wheel twine coveralls
40+
41+
test:
42+
python3 -m unittest -v
43+
44+
coverage:
45+
. ./venv && coverage run -m unittest -v
46+
. ./venv && coverage report --show-missing
47+
. ./venv && coverage html
48+
49+
lint:
50+
. ./venv && isort --quiet --diff
51+
. ./venv && pylama \
52+
-l pycodestyle,pyflakes,mccabe,pylint,isort \
53+
-i C0111,C0103,R0201
54+
55+
checks: lint test coverage dist
56+
57+
58+
# Helpers.
759
qr:
860
qrencode -s 10 -o secret1.png "$(URI1)"
961
qrencode -s 10 -o secret2.png "$(URI2)"
1062

1163
key:
12-
python3 -c 'import base64, os; print(base64.b32encode(os.urandom(20)).decode())'
64+
python3 -c \
65+
'import base64, os; print(base64.b32encode(os.urandom(20)).decode())'
66+
67+
68+
# Package and distribute.
69+
dist: clean venv
70+
. ./venv && python3 setup.py sdist bdist_wheel
71+
. ./venv && twine check dist/*
72+
unzip -c dist/*.whl */METADATA
73+
74+
upload:
75+
. ./venv && twine upload dist/*
76+
77+
test-upload:
78+
. ./venv && twine upload --repository-url \
79+
https://test.pypi.org/legacy/ dist/*
80+
81+
82+
# Test distributions.
83+
user-venv: FORCE
84+
rm -rf ~/.venv/test-mintotp user-venv
85+
python3 -m venv ~/.venv/test-mintotp
86+
echo . ~/.venv/test-mintotp/bin/activate > user-venv
87+
88+
verify-upload:
89+
$(MAKE) verify-sdist
90+
$(MAKE) verify-bdist
91+
92+
verify-test-upload:
93+
$(MAKE) verify-test-sdist
94+
$(MAKE) verify-test-bdist
95+
96+
verify-sdist: user-venv
97+
. ./user-venv && pip3 install --no-binary :all: mintotp
98+
. ./user-venv && echo ZYTYYE5FOAGW5ML7LRWUL4WTZLNJAMZS | mintotp
99+
100+
verify-bdist: user-venv
101+
. ./user-venv && pip3 install mintotp
102+
. ./user-venv && echo ZYTYYE5FOAGW5ML7LRWUL4WTZLNJAMZS | mintotp
103+
104+
verify-test-sdist: user-venv
105+
. ./user-venv && pip3 install \
106+
--index-url https://test.pypi.org/simple/ --no-binary :all: mintotp
107+
. ./user-venv && echo ZYTYYE5FOAGW5ML7LRWUL4WTZLNJAMZS | mintotp
108+
109+
verify-test-bdist: user-venv
110+
. ./user-venv && pip3 install \
111+
--index-url https://test.pypi.org/simple/ mintotp
112+
. ./user-venv && echo ZYTYYE5FOAGW5ML7LRWUL4WTZLNJAMZS | mintotp
113+
114+
clean:
115+
rm -rf *.pyc __pycache__
116+
rm -rf .coverage htmlcov
117+
rm -rf build dist mintotp.egg-info
118+
119+
FORCE:

0 commit comments

Comments
 (0)