From bee450d951333c56194e0ed876f4d7c0a4403ff0 Mon Sep 17 00:00:00 2001 From: Stephen L Date: Tue, 13 Oct 2015 15:15:11 +0200 Subject: [PATCH] add new commands to Makefile + updated CONTRIBUTE and RELEASE Signed-off-by: Stephen L. --- CONTRIBUTE | 12 ++++++++---- Makefile | 24 +++++++++++++++++++++++- RELEASE | 15 ++++++++------- 3 files changed, 39 insertions(+), 12 deletions(-) diff --git a/CONTRIBUTE b/CONTRIBUTE index 503166e4..345c0684 100644 --- a/CONTRIBUTE +++ b/CONTRIBUTE @@ -4,6 +4,9 @@ HOW TO CONTRIBUTE TO TQDM This file describes how to contribute changes to the project, and how to upload to the pypi repository. +Most of the management commands have been directly placed inside +the Makefile, so you just have to run `make [alias]`. + HOW TO COMMIT YOUR CONTRIBUTIONS -------------------------------- @@ -34,12 +37,10 @@ To run the tests, - install `tox` - `cd` to the root of the `tqdm` directory (in the same folder as this file) -- run the following commands: +- run the following command: ``` -make test -make coverage -make flake8 +make alltests ``` Alternatively (if you can't use `make`) @@ -51,3 +52,6 @@ Alternatively (if you can't use `make`) nosetests --with-coverage --cover-package=tqdm -v tqdm/ python -m flake8 tqdm/_tqdm.py ``` + +Then wait for the tests to finish, and check your console to see if there's +any issue. diff --git a/Makefile b/Makefile index 65572c9e..cc4a19d4 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,8 @@ .PHONY: all flake8 test coverage -all: flake8 coverage +alltests: test coverage flake8 testsetup +all: alltests build + flake8: flake8 --max-line-length=80 --count --statistics --exit-zero tqdm/ flake8 --max-line-length=80 --count --statistics --exit-zero examples/ @@ -8,5 +10,25 @@ flake8: test: nosetests tqdm -v +testsetup: + python setup.py check --restructuredtext --strict + coverage: nosetests tqdm --with-coverage --cover-package=tqdm -v + +installdev: + python setup.py develop --uninstall + python setup.py develop + +install: + python setup.py install + +build: + python setup.py sdist --formats=gztar,zip bdist_wininst + python setup.py sdist bdist_wheel + +pypimeta: + python setup.py register + +pypi: + twine upload dist/* diff --git a/RELEASE b/RELEASE index 9084d7d3..f62a20d4 100644 --- a/RELEASE +++ b/RELEASE @@ -4,6 +4,9 @@ HOW TO MANAGE A NEW RELEASE This file is intended for the project's maintainers and it describes how to update, build and upload a new release. +Most of the management commands have been directly placed inside +the Makefile, so you just have to run `make [alias]`. + SEMANTIC VERSIONING ------------------- @@ -34,7 +37,7 @@ python setup.py check --restructuredtext --strict ``` Also, if you happen to mistakenly upload a broken release to PyPi, -you can fix the metadata by using: `python setup.py register`. +you can fix the metadata by using: `make pypimeta` or `python setup.py register` BUILDING A RELEASE AND UPLOADING TO PYPI @@ -46,15 +49,13 @@ process and info that will be uploaded to [pypi](pypi.python.org). Check the result by using the following commands: ``` -python setup.py develop --uninstall -python setup.py develop +make installdev ``` Secondly, build tqdm into a distributable python package: ``` -python setup.py sdist --formats=gztar,zip bdist_wininst --plat-name=win32 -python setup.py sdist bdist_wheel --plat-name=win32 +make build ``` This will generate several builds in the `dist/` folder. @@ -63,7 +64,7 @@ Finally, we can upload everything to pypi. Uploading to pypi can be done easily using the [twine](https://github.com/pypa/twine) module: ``` -twine upload dist/* +make pypi ``` NOTE: @@ -74,7 +75,7 @@ before the real deployment cannot re-upload another with the same version number! - in case of a mistake in the metadata on pypi (like the long description README getting garbled because of a silent error), you can use the following -command to update the metadata: `python setup.py register` +command to update the metadata: `make pypimeta` or `python setup.py register` Also, the new release can be added to the Github by creating a new release from the web interface.