File tree 4 files changed +40
-2
lines changed
4 files changed +40
-2
lines changed Original file line number Diff line number Diff line change @@ -2,3 +2,4 @@ __pycache__/
2
2
build /
3
3
click_command_tree.egg-info /
4
4
dist /
5
+ .eggs /
Original file line number Diff line number Diff line change
1
+ PYTHON3 =/usr/bin/python3
2
+ BUILD_DIR =build
3
+ DIST_DIR =dist
4
+ VIRTUALENV =$(BUILD_DIR ) /_virtualenv
5
+ VIRTUALENV_BIN =$(VIRTUALENV ) /bin
6
+ ACTIVATE =$(VIRTUALENV_BIN ) /activate
7
+
8
+ .PHONY : clean test
9
+
10
+ clean :
11
+ rm -rf $(BUILD_DIR ) $(DIST_DIR )
12
+
13
+ lint : $(ACTIVATE )
14
+ $(VIRTUALENV_BIN ) /python setup.py flake8
15
+
16
+ test : $(ACTIVATE )
17
+ $(VIRTUALENV_BIN ) /python -m unittest discover -v
18
+
19
+ build-dist : clean $(ACTIVATE ) lint test
20
+ $(VIRTUALENV_BIN ) /python setup.py sdist bdist_wheel
21
+
22
+ publish-dist : build-dist
23
+ $(VIRTUALENV_BIN ) /pip install twine==1.12.1 && \
24
+ $(VIRTUALENV_BIN ) /twine upload dist/*
25
+
26
+ $(VIRTUALENV ) $(ACTIVATE ) :
27
+ @command -v virtualenv > /dev/null 2>&1 || { echo >&2 " This build requires virtualenv to be installed. Aborting." ; exit 1; }
28
+ @mkdir -p $(BUILD_DIR )
29
+ @if [ -d $( VIRTUALENV) ]; then \
30
+ echo " Existing virtualenv found. Skipping virtualenv creation." ; \
31
+ else \
32
+ echo " Creating virtualenv at $( VIRTUALENV) " ; \
33
+ virtualenv $(VIRTUALENV ) --python=$(PYTHON3 ) ; \
34
+ fi
35
+ . $(ACTIVATE ) && pip install .
Original file line number Diff line number Diff line change @@ -24,7 +24,6 @@ def __repr__(self):
24
24
return '{{_CommandWrapper {}}}' .format (self .name )
25
25
26
26
27
-
28
27
def _build_command_tree (click_command ):
29
28
wrapper = _CommandWrapper (click_command )
30
29
Original file line number Diff line number Diff line change 18
18
'License :: OSI Approved :: MIT License' ,
19
19
'Programming Language :: Python :: 3'
20
20
],
21
- py_modules = ['click_command_tree' ],\
21
+ py_modules = ['click_command_tree' ],
22
22
include_package_data = True ,
23
23
install_requires = [
24
24
'click' ,
25
25
],
26
+ setup_requires = [
27
+ 'flake8==3.7.5' ,
28
+ ],
26
29
entry_points = '''
27
30
[click_command_tree]
28
31
tree=click_command_tree:tree
You can’t perform that action at this time.
0 commit comments