1414
1515define help
1616
17- Supported targets: 'develop', 'sdist', 'clean', 'test', 'pypi'
17+ Supported targets: 'develop', 'sdist', 'clean', 'test', 'pypi', or 'pypi_stable'.
1818
1919The 'develop' target creates an editable install (aka develop mode).
2020
21- The 'sdist' target creates a source distribution.
21+ The 'sdist' target creates a source distribution of this project .
2222
2323The 'clean' target undoes the effect of 'develop' and 'sdist'.
2424
2525The 'test' target runs unit tests. Set the 'tests' variable to run a particular test.
2626
27- The 'pypi' target publishes the current commit of Toil to PyPI after enforcing that the working
28- copy and the index are clean, and tagging it as an unstable .dev build.
27+ The 'pypi' target publishes the current commit of this project to PyPI after enforcing that the
28+ working copy and the index are clean, and tagging it as an unstable .dev build.
29+
30+ The 'pypi_stable' target is like 'pypi' except that it doesn't tag the build as
31+ an unstable build. IOW, it publishes a stable release.
32+
2933
3034endef
3135export help
@@ -69,17 +73,29 @@ test: _check_venv
6973
7074
7175.PHONY : pypi
72- pypi : _check_venv _check_clean_working_copy test
73- $(python ) setup.py egg_info sdist bdist_egg upload
76+ pypi : _check_clean_working_copy _check_running_on_jenkins
77+ @test " $$ (git rev-parse --verify remotes/origin/master)" ! = " $$ (git rev-parse --verify HEAD)" \
78+ && echo " Not on master branch, silently skipping deployment to PyPI." \
79+ || $(python ) setup.py egg_info --tag-build=.dev$$ BUILD_NUMBER sdist bdist_egg upload
80+
81+
82+ .PHONY : pypi_stable
83+ pypi_stable : _check_clean_working_copy _check_running_on_jenkins
84+ test " $$ (git rev-parse --verify remotes/origin/master)" ! = " $$ (git rev-parse --verify HEAD)" \
85+ && echo " Not on master branch, silently skipping deployment to PyPI." \
86+ || $(python ) setup.py egg_info register sdist bdist_egg upload
7487
7588
7689.PHONY : clean_pypi
77- clean_pypi : clean_sdist
90+ clean_pypi :
7891 - rm -rf build/
7992
8093
8194.PHONY : clean
8295clean : clean_develop clean_sdist clean_pypi
96+ -rm -rf __pychache__
97+ -rm -rf .cache .eggs
98+ find . -name ' *.pyc' | xargs rm
8399
84100
85101.PHONY : _check_venv
@@ -99,3 +115,10 @@ _check_clean_working_copy:
99115 || ( echo " $( red) You have are untracked files:$( normal) " \
100116 ; git ls-files --other --exclude-standard --directory \
101117 ; false )
118+
119+
120+ .PHONY : _check_running_on_jenkins
121+ _check_running_on_jenkins :
122+ @echo " $( green) Checking if running on Jenkins ...$( normal) "
123+ test -n " $$ BUILD_NUMBER" \
124+ || ( echo " $( red) This target should only be invoked on Jenkins.$( normal) " ; false )
0 commit comments