From 2124cb3c472e8623a868b4caad9343572a9a4f53 Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Mon, 22 Jan 2018 09:35:16 +0100 Subject: [PATCH 01/10] change versioning scheme --- Makefile | 19 +++++++++++++++---- setup.py | 17 ++++++++++++++++- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 8f3575d..aa2fe4a 100644 --- a/Makefile +++ b/Makefile @@ -47,10 +47,6 @@ sysdeps: ## Install system deps (Ubuntu). sudo apt-get install python sudo pip2 install --pre --upgrade pyhwp -publish: ## Upload package on PYPI. - $(PYTHON) setup.py register - $(PYTHON) setup.py sdist upload - clean: ## Remove all build files. rm -rf `find . -type d -name __pycache__ \ -o -type f -name \*.bak \ @@ -81,3 +77,18 @@ install-git-hooks: ## Install GIT pre-commit hook. help: ## Display callable targets. @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' + +# --- distribution + +sdist: ## Create a tar.gz distribution. + virtualenv -p $(PYTHON) venv + rm -rf dist + venv/bin/python setup.py sdist + # Test installation from source. + venv/bin/pip install --upgrade --force-reinstall dist/*.tar.gz + venv/bin/pip install -r requirements.txt + venv/bin/python -m fulltext check + +publish: ## Upload package on PYPI. + $(PYTHON) setup.py register + $(PYTHON) setup.py sdist upload diff --git a/setup.py b/setup.py index a815a73..f2b09a2 100755 --- a/setup.py +++ b/setup.py @@ -2,6 +2,7 @@ import os import sys +import subprocess from os.path import dirname from os.path import join as pathjoin from setuptools import find_packages @@ -9,7 +10,21 @@ NAME = 'fulltext' -VERSION = '0.7' +if os.path.isdir('.git'): + # Version is "0.X.{num-commits}.{short-git-hash}", + # e.g. "pkg-0.2.102.3de9bd2". + _gitcount = subprocess.check_output( + "git rev-list --count --first-parent HEAD", + shell=True).strip().decode() + _githash = subprocess.check_output( + "git rev-parse --short HEAD", shell=True).strip().decode() + VERSION = "0.2.%s.%s" % (_gitcount, _githash) +else: + # This is here mainly for testing the .tar.gz distribution which + # has no .git directory. Distros published on the PYPI repo are + # supposed to use the above versioning notation. + VERSION = "0.1.0" + if os.name == 'nt' and not sys.maxsize > 2 ** 32: # https://github.com/btimby/fulltext/issues/79 raise RuntimeError("Python 32 bit is not supported") From 76f28fdb8ba895ddea1736debb51cc0d8c563ff5 Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Mon, 22 Jan 2018 09:37:56 +0100 Subject: [PATCH 02/10] set base ver at 0.8 --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index f2b09a2..59f2b74 100755 --- a/setup.py +++ b/setup.py @@ -18,12 +18,12 @@ shell=True).strip().decode() _githash = subprocess.check_output( "git rev-parse --short HEAD", shell=True).strip().decode() - VERSION = "0.2.%s.%s" % (_gitcount, _githash) + VERSION = "0.8.%s.%s" % (_gitcount, _githash) else: # This is here mainly for testing the .tar.gz distribution which # has no .git directory. Distros published on the PYPI repo are # supposed to use the above versioning notation. - VERSION = "0.1.0" + VERSION = "0.8.0" if os.name == 'nt' and not sys.maxsize > 2 ** 32: # https://github.com/btimby/fulltext/issues/79 From 823ab39c249a616bac3605bfa044f6a33e9f6175 Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Mon, 22 Jan 2018 09:56:04 +0100 Subject: [PATCH 03/10] make cmd to upload on private pypi repo --- Makefile | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index aa2fe4a..ea0b826 100644 --- a/Makefile +++ b/Makefile @@ -17,8 +17,8 @@ SYSDEPS = \ python3-dev \ python-pip \ python3-pip - TEST_PREFIX = PYTHONWARNINGS=all FULLTEXT_TESTING=1 +PASSWORD = test: ## Run tests. ${MAKE} install-git-hooks @@ -89,6 +89,20 @@ sdist: ## Create a tar.gz distribution. venv/bin/pip install -r requirements.txt venv/bin/python -m fulltext check +priv-pypi-upload: ## Upload src sdist on private PYPI repo. + # virtualenv -p $(PYTHON) venv + # venv/bin/pip install devpi-client + # ${MAKE} sdist +ifndef PASSWORD + venv/bin/python -m devpi login root +else + venv/bin/python -m devpi login root --password=$(PASSWORD) +endif + # Create index (done once) + # venv/bin/python -m devpi index --create root/veristack-fulltext + venv/bin/python -m devpi use http://pypi.dev.veristack.com/root/veristack-fulltext + venv/bin/python -m devpi upload -v dist/*.tar.gz + publish: ## Upload package on PYPI. $(PYTHON) setup.py register $(PYTHON) setup.py sdist upload From 73dcd693504e669290dc2e95a938624eee9c89cc Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Mon, 22 Jan 2018 09:58:48 +0100 Subject: [PATCH 04/10] decomment stuff --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index ea0b826..50936ad 100644 --- a/Makefile +++ b/Makefile @@ -90,9 +90,9 @@ sdist: ## Create a tar.gz distribution. venv/bin/python -m fulltext check priv-pypi-upload: ## Upload src sdist on private PYPI repo. - # virtualenv -p $(PYTHON) venv - # venv/bin/pip install devpi-client - # ${MAKE} sdist + virtualenv -p $(PYTHON) venv + venv/bin/pip install devpi-client + ${MAKE} sdist ifndef PASSWORD venv/bin/python -m devpi login root else From 7f6eb2fa2c38faf67f4a3f428bdc9f17a129bef4 Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Mon, 22 Jan 2018 10:11:16 +0100 Subject: [PATCH 05/10] just issue another release --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 50936ad..d4744f6 100644 --- a/Makefile +++ b/Makefile @@ -106,3 +106,4 @@ endif publish: ## Upload package on PYPI. $(PYTHON) setup.py register $(PYTHON) setup.py sdist upload + From 6fb8cd1299e1866d40427f607d4ce6133900c5a7 Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Mon, 22 Jan 2018 10:26:16 +0100 Subject: [PATCH 06/10] force new ver --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d4744f6..58ed559 100644 --- a/Makefile +++ b/Makefile @@ -101,9 +101,8 @@ endif # Create index (done once) # venv/bin/python -m devpi index --create root/veristack-fulltext venv/bin/python -m devpi use http://pypi.dev.veristack.com/root/veristack-fulltext - venv/bin/python -m devpi upload -v dist/*.tar.gz + venv/bin/python -m devpi upload -v dist/*.tar.gz publish: ## Upload package on PYPI. $(PYTHON) setup.py register $(PYTHON) setup.py sdist upload - From a9615da5c3dc2c47854daeb043ff370ee0a8bd03 Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Mon, 22 Jan 2018 10:55:05 +0100 Subject: [PATCH 07/10] update instructions --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 58ed559..f0948cb 100644 --- a/Makefile +++ b/Makefile @@ -90,6 +90,10 @@ sdist: ## Create a tar.gz distribution. venv/bin/python -m fulltext check priv-pypi-upload: ## Upload src sdist on private PYPI repo. + # Note: to reference the uploaded distribution, requirements.txt will + # need an entry like this: + # --extra-index-url http://pypi.dev.veristack.com/root/veristack-fulltext/+simple/ + # fulltext==0.8.315.b00117c virtualenv -p $(PYTHON) venv venv/bin/pip install devpi-client ${MAKE} sdist From 3e7da8e3bb526a2abeaf3663dbbee5e4fca311a2 Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Mon, 22 Jan 2018 10:57:05 +0100 Subject: [PATCH 08/10] minor change --- Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index f0948cb..2741d4f 100644 --- a/Makefile +++ b/Makefile @@ -89,14 +89,13 @@ sdist: ## Create a tar.gz distribution. venv/bin/pip install -r requirements.txt venv/bin/python -m fulltext check -priv-pypi-upload: ## Upload src sdist on private PYPI repo. +priv-pypi-upload: ## Upload source distribution on private PYPI repo. # Note: to reference the uploaded distribution, requirements.txt will # need an entry like this: # --extra-index-url http://pypi.dev.veristack.com/root/veristack-fulltext/+simple/ # fulltext==0.8.315.b00117c - virtualenv -p $(PYTHON) venv - venv/bin/pip install devpi-client ${MAKE} sdist + venv/bin/pip install devpi-client ifndef PASSWORD venv/bin/python -m devpi login root else From f1c482a7508d22a8225f92484214285a1a0ee12a Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Mon, 22 Jan 2018 15:56:45 +0100 Subject: [PATCH 09/10] PEP440 compliant versioning --- Makefile | 11 +++-------- setup.py | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 2741d4f..679a431 100644 --- a/Makefile +++ b/Makefile @@ -81,13 +81,8 @@ help: ## Display callable targets. # --- distribution sdist: ## Create a tar.gz distribution. - virtualenv -p $(PYTHON) venv - rm -rf dist - venv/bin/python setup.py sdist - # Test installation from source. - venv/bin/pip install --upgrade --force-reinstall dist/*.tar.gz - venv/bin/pip install -r requirements.txt - venv/bin/python -m fulltext check + $(PYTHON) setup.py sdist + $(PYTHON) setup.py --version priv-pypi-upload: ## Upload source distribution on private PYPI repo. # Note: to reference the uploaded distribution, requirements.txt will @@ -104,7 +99,7 @@ endif # Create index (done once) # venv/bin/python -m devpi index --create root/veristack-fulltext venv/bin/python -m devpi use http://pypi.dev.veristack.com/root/veristack-fulltext - venv/bin/python -m devpi upload -v dist/*.tar.gz + venv/bin/python -m devpi upload -v dist/fulltext-`$(PYTHON) setup.py --version`.tar.gz publish: ## Upload package on PYPI. $(PYTHON) setup.py register diff --git a/setup.py b/setup.py index 59f2b74..322cd67 100755 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ shell=True).strip().decode() _githash = subprocess.check_output( "git rev-parse --short HEAD", shell=True).strip().decode() - VERSION = "0.8.%s.%s" % (_gitcount, _githash) + VERSION = "0.8+0.%s.%s" % (_gitcount, _githash) else: # This is here mainly for testing the .tar.gz distribution which # has no .git directory. Distros published on the PYPI repo are From 2ef7fef48868320d42a3b6211de7e3c1042768ad Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Mon, 22 Jan 2018 16:27:24 +0100 Subject: [PATCH 10/10] change Makefile var --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 679a431..41d19d9 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ SYSDEPS = \ python-pip \ python3-pip TEST_PREFIX = PYTHONWARNINGS=all FULLTEXT_TESTING=1 -PASSWORD = +PASSWORD ?= test: ## Run tests. ${MAKE} install-git-hooks