File tree Expand file tree Collapse file tree 1 file changed +35
-8
lines changed Expand file tree Collapse file tree 1 file changed +35
-8
lines changed Original file line number Diff line number Diff line change 1
1
TEST_DIR =tests
2
+ # PYPI_URL=https://test.pypi.org/legacy/
3
+ PYPI_URL =https://upload.pypi.org/legacy/
4
+ DEFAULT_PYTHON_VERSION =three
2
5
3
6
# # Sets up the virtual environment via pipenv.
4
7
.PHONY : setup
5
8
setup :
6
- pipenv --three install --dev
9
+ pipenv --$( DEFAULT_PYTHON_VERSION ) install --dev
7
10
8
- # # Cleans test and packaging outputs .
11
+ # # Removes everything including virtual environments .
9
12
.PHONY : clean
10
- clean :
11
- rm -rf .coverage htmlcov/ build/ dist/
13
+ clean : mostlyclean
14
+ -pipenv --rm
15
+ rm -f Pipfile.lock
16
+
17
+ # # Removes test and packaging outputs.
18
+ .PHONY : mostlyclean
19
+ mostlyclean :
20
+ rm -rf .coverage htmlcov/ .pytest_cache/ build/ dist/
12
21
13
22
# # Runs tests.
14
23
.PHONY : test
15
- test : clean
24
+ test :
16
25
pipenv run pytest $(TEST_DIR ) -v -s --disable-warnings
17
26
18
27
# # Creates coverage report.
19
28
.PHONY : coverage
20
29
coverage :
21
- pytest --cov=src/ --cov-report=term-missing --cov-report=html --disable-warnings
30
+ pipenv run pytest --cov=src/ --cov-report=term-missing --cov-report=html --disable-warnings
22
31
open htmlcov/index.html || xdg-open htmlcov/index.html
23
32
24
- .DEFAULT :
25
- @$(MAKE ) help
33
+ # # Packages for both Python 2 and 3 for PyPi.
34
+ .PHONY : dist
35
+ dist : mostlyclean
36
+ -pipenv --rm
37
+ pipenv --three install --dev --skip-lock
38
+ pipenv run python setup.py sdist bdist_wheel
39
+ pipenv --rm
40
+ pipenv --two install --dev --skip-lock
41
+ pipenv run python setup.py sdist bdist_wheel
42
+ pipenv --rm
43
+ pipenv --$(DEFAULT_PYTHON_VERSION ) install --dev
44
+
45
+ # # Uploads packages to PyPi.
46
+ .PHONY : upload
47
+ upload :
48
+ pipenv run twine upload --repository-url $(PYPI_URL ) dist/*
49
+
50
+ # # Alias for packaging and upload together.
51
+ .PHONY : pypi
52
+ pypi : dist upload
26
53
27
54
# # This help message.
28
55
.PHONY : help
You can’t perform that action at this time.
0 commit comments