From 935801e0145b084cab6e1c21b14fc7f57c1f1f8f Mon Sep 17 00:00:00 2001 From: Chaim Halbert Date: Mon, 17 Dec 2018 07:26:30 -0800 Subject: [PATCH 01/12] travis tests 3.7, 3.8-dev(FAILOK) --- .travis.yml | 28 +++++++++++++++++++--------- CHANGELOG.md | 4 ++++ setup.py | 2 +- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index b025a54..d5232a2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,23 @@ language: python -python: - - "2.7" - - "3.4" - - "3.5" - - "3.6" +matrix: + include: + - python: 2.7 + - python: 3.4 + - python: 3.5 + - python: 3.6 + - python: 3.7 + dist: xenial + sudo: true + - python: 3.8-dev + env: FAILOK=y + dist: xenial + sudo: true + allow_failures: + - env: FAILOK=y install: - - make deps-dev - - pip install coverage + - make deps-dev + - pip install coverage script: - coverage run --source=intervaltree setup.py develop test + coverage run --source=intervaltree setup.py develop test after_success: - coverage report + coverage report diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ff53be..81697c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change log +## Version 3.0.1 +- Added: + - Travis testing for 3.7 (needed OpenSSL, sudo and Xenial) + ## Version 3.0.0 - Breaking: - `search(begin, end, strict)` has been replaced with `at(point)`, `overlap(begin, end)`, and `envelop(begin, end)` diff --git a/setup.py b/setup.py index 6d559ab..eef8720 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ from utils import version ## CONFIG -target_version = '3.0.0' +target_version = '3.0.1' version_info = version.version_info(target_version) if version_info['is_dev_version']: From 56ae3f7d57293958ae2a83a95d25c6f3e0834e5b Mon Sep 17 00:00:00 2001 From: Chaim Halbert Date: Mon, 17 Dec 2018 08:05:20 -0800 Subject: [PATCH 02/12] set long_description_content_type to markdown for PyPI --- CHANGELOG.md | 2 ++ setup.py | 1 + 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81697c9..4329482 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ ## Version 3.0.1 - Added: - Travis testing for 3.7 (needed OpenSSL, sudo and Xenial) +- Fixed: + - PyPI wasn't rendering markdown because I didn't tell it what format to use. ## Version 3.0.0 - Breaking: diff --git a/setup.py b/setup.py index eef8720..5757c7d 100644 --- a/setup.py +++ b/setup.py @@ -63,6 +63,7 @@ def run_tests(self): install_requires=['sortedcontainers >= 2.0, < 3.0'], description='Editable interval tree data structure for Python 2 and 3', long_description=long_description, + long_description_content_type='text/markdown', classifiers=[ # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers 'Development Status :: 4 - Beta', 'Programming Language :: Python :: Implementation :: PyPy', From 19e013586fbea2a6f68ac3998bd935b4edaa3140 Mon Sep 17 00:00:00 2001 From: Chaim Halbert Date: Mon, 17 Dec 2018 10:25:13 -0800 Subject: [PATCH 03/12] fix dev version string to be based off the most recent tag in git history --- CHANGELOG.md | 1 + utils/version.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4329482..fc88f8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Travis testing for 3.7 (needed OpenSSL, sudo and Xenial) - Fixed: - PyPI wasn't rendering markdown because I didn't tell it what format to use. + - TestPyPI version strings count from the latest tagged commit, which should be the last release ## Version 3.0.0 - Breaking: diff --git a/utils/version.py b/utils/version.py index f50ea96..920c77d 100644 --- a/utils/version.py +++ b/utils/version.py @@ -22,7 +22,7 @@ import subprocess def development_version_number(): - p = subprocess.Popen('git describe'.split(), stdout=subprocess.PIPE) + p = subprocess.Popen('git describe --tag'.split(), stdout=subprocess.PIPE) git_describe = p.communicate()[0].strip() release, build, commitish = git_describe.split('-') result = "{0}b{1}".format(release, build) From 81be789a11e4a2cb0e6240805ccdfd45861e1e19 Mon Sep 17 00:00:00 2001 From: Chaim Halbert Date: Mon, 17 Dec 2018 10:28:20 -0800 Subject: [PATCH 04/12] add utils to MANIFEST.in --- CHANGELOG.md | 1 + MANIFEST.in | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc88f8d..593b5a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Fixed: - PyPI wasn't rendering markdown because I didn't tell it what format to use. - TestPyPI version strings count from the latest tagged commit, which should be the last release + - PyPI manifest includes the new utils package ## Version 3.0.0 - Breaking: diff --git a/MANIFEST.in b/MANIFEST.in index 6644b75..6cbcf52 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1 @@ -include README.md CHANGELOG.md LICENSE.txt +include README.md CHANGELOG.md LICENSE.txt utils From 3349ead5a6e777fd921234fc309199a18b4e4a32 Mon Sep 17 00:00:00 2001 From: Chaim Halbert Date: Mon, 17 Dec 2018 10:33:57 -0800 Subject: [PATCH 05/12] use twine instead of setup.py upload --- MANIFEST.in | 2 +- Makefile | 28 ++++++++++++++++++++++++---- setup.py | 33 +++++++++++++++++++++++++-------- utils/__init__.py | 0 utils/version.py | 41 ----------------------------------------- 5 files changed, 50 insertions(+), 54 deletions(-) delete mode 100644 utils/__init__.py delete mode 100644 utils/version.py diff --git a/MANIFEST.in b/MANIFEST.in index 6cbcf52..6644b75 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1 @@ -include README.md CHANGELOG.md LICENSE.txt utils +include README.md CHANGELOG.md LICENSE.txt diff --git a/Makefile b/Makefile index 3802ca2..f9fe11c 100644 --- a/Makefile +++ b/Makefile @@ -25,6 +25,16 @@ PYTHON_MINORS:=$(shell \ # See http://peterdowns.com/posts/first-time-with-pypi.html PYPI=pypitest +TWINE=$(shell \ + if twine --version &>/dev/null; then \ + echo twine ;\ + elif [[ -x ~/Library/Python/3.7/bin/twine ]]; then \ + echo '~/Library/Python/3.7/bin/twine' ;\ + else \ + echo twine ;\ + fi \ +) + # default target all: test @@ -55,7 +65,7 @@ clean-temps: rm -rf $(TEMPS) install-testpypi: - pip install --pre -i https://testpypi.python.org/pypi intervaltree + pip install --index-url https://test.pypi.org/simple/ intervaltree install-pypi: pip install intervaltree @@ -75,8 +85,13 @@ release: $(eval PYPI=pypi) # Build source distribution -sdist-upload: - PYPI=$(PYPI) python setup.py sdist upload -r $(PYPI) +sdist-upload: deps-dev + PYPI=$(PYPI) python setup.py sdist + if [[ "$(PYPI)" == pypitest ]]; then \ + $(TWINE) upload --repository-url https://test.pypi.org/legacy/ dist/*; \ + else \ + $(TWINE) upload dist/*; \ + fi deps-dev: pyenv-install-versions @@ -88,7 +103,12 @@ pyenv-is-installed: pyenv-install-versions: pyenv-is-installed for pyver in $(PYTHONS); do (echo N | pyenv install $$pyver) || true; done - for pyver in $(PYTHONS); do export PYENV_VERSION=$$pyver; pip install -U pip; pip install -U pytest; done | grep -v 'Requirement already satisfied, skipping upgrade' + for pyver in $(PYTHONS); do \ + export PYENV_VERSION=$$pyver; \ + pip install -U pip; \ + pip install -U pytest; \ + pip install -U twine; \ + done | grep -v 'Requirement already satisfied, skipping upgrade' pyenv rehash # for debugging the Makefile diff --git a/setup.py b/setup.py index 5757c7d..ad354e2 100644 --- a/setup.py +++ b/setup.py @@ -22,22 +22,39 @@ limitations under the License. """ from __future__ import absolute_import +import os from sys import exit from setuptools import setup from setuptools.command.test import test as TestCommand - -from utils import version +import subprocess ## CONFIG target_version = '3.0.1' -version_info = version.version_info(target_version) -if version_info['is_dev_version']: + +def version_info(target_version): + is_dev_version = 'PYPI' in os.environ and os.environ['PYPI'] == 'pypitest' + if is_dev_version: + p = subprocess.Popen('git describe --tag'.split(), stdout=subprocess.PIPE) + git_describe = p.communicate()[0].strip() + release, build, commitish = git_describe.split('-') + version = "{0}.post{1}".format(release, build, commitish) + else: # This is a RELEASE version + version = target_version + return { + 'is_dev_version': is_dev_version, + 'version': version, + 'target_version': target_version + } + + +vinfo = version_info(target_version) +if vinfo['is_dev_version']: print("This is a DEV version") - print("Target: {target_version}\n".format(**version_info)) + print("Target: {target_version}\n".format(**vinfo)) else: print("!!!>>> This is a RELEASE version <<= 2.0, < 3.0'], description='Editable interval tree data structure for Python 2 and 3', long_description=long_description, @@ -91,7 +108,7 @@ def run_tests(self): author='Chaim Leib Halbert, Konstantin Tretyakov', author_email='chaim.leib.halbert@gmail.com', url='https://github.com/chaimleib/intervaltree', - download_url='https://github.com/chaimleib/intervaltree/tarball/{version}'.format(**version_info), + download_url='https://github.com/chaimleib/intervaltree/tarball/{version}'.format(**vinfo), license="Apache License, Version 2.0", packages=["intervaltree"], include_package_data=True, diff --git a/utils/__init__.py b/utils/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/utils/version.py b/utils/version.py deleted file mode 100644 index 920c77d..0000000 --- a/utils/version.py +++ /dev/null @@ -1,41 +0,0 @@ -""" -intervaltree: A mutable, self-balancing interval tree for Python 2 and 3. -Queries may be by point, by range overlap, or by range envelopment. - -Version utilities - -Copyright 2013-2018 Chaim Leib Halbert - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" -import os -import subprocess - -def development_version_number(): - p = subprocess.Popen('git describe --tag'.split(), stdout=subprocess.PIPE) - git_describe = p.communicate()[0].strip() - release, build, commitish = git_describe.split('-') - result = "{0}b{1}".format(release, build) - return result - -def version_info(target_version): - is_dev_version = 'PYPI' in os.environ and os.environ['PYPI'] == 'pypitest' - if is_dev_version: - version = development_version_number() - else: # This is a RELEASE version - version = target_version - return { - 'is_dev_version': is_dev_version, - 'version': version, - 'target_version': target_version - } From e3106da0f6d7ed8ae86ff7f10ec00b0c986953ce Mon Sep 17 00:00:00 2001 From: Chaim Halbert Date: Mon, 17 Dec 2018 12:07:48 -0800 Subject: [PATCH 06/12] upd changelog re rm utils --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 593b5a8..46cc617 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ - Fixed: - PyPI wasn't rendering markdown because I didn't tell it what format to use. - TestPyPI version strings count from the latest tagged commit, which should be the last release - - PyPI manifest includes the new utils package + - Fix for Python 2 by removing utils package ## Version 3.0.0 - Breaking: From 2239e8470e776e06da86579c5c19b42c20e56dcd Mon Sep 17 00:00:00 2001 From: Chaim Halbert Date: Mon, 17 Dec 2018 12:14:27 -0800 Subject: [PATCH 07/12] fix version numbering --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ad354e2..a94f5e4 100644 --- a/setup.py +++ b/setup.py @@ -38,7 +38,7 @@ def version_info(target_version): p = subprocess.Popen('git describe --tag'.split(), stdout=subprocess.PIPE) git_describe = p.communicate()[0].strip() release, build, commitish = git_describe.split('-') - version = "{0}.post{1}".format(release, build, commitish) + version = "{0}b{1}".format(release, build) else: # This is a RELEASE version version = target_version return { From cd0fe765b91504b9745ca63df4fad3f1efac6278 Mon Sep 17 00:00:00 2001 From: Chaim Halbert Date: Mon, 17 Dec 2018 12:19:35 -0800 Subject: [PATCH 08/12] fix testpypi install --- CHANGELOG.md | 4 +++- Makefile | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46cc617..f87edbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,10 @@ - Travis testing for 3.7 (needed OpenSSL, sudo and Xenial) - Fixed: - PyPI wasn't rendering markdown because I didn't tell it what format to use. + - Python 2 wasn't installing via pip because of a new utils package. It has been zapped. +- Maintainers: - TestPyPI version strings count from the latest tagged commit, which should be the last release - - Fix for Python 2 by removing utils package + - Install from TestPyPI works via `make install-testpypi` ## Version 3.0.0 - Breaking: diff --git a/Makefile b/Makefile index f9fe11c..4b37a49 100644 --- a/Makefile +++ b/Makefile @@ -65,7 +65,10 @@ clean-temps: rm -rf $(TEMPS) install-testpypi: - pip install --index-url https://test.pypi.org/simple/ intervaltree + pip install \ + --index-url https://test.pypi.org/simple/ \ + --extra-index-url https://pypi.org/simple \ + intervaltree install-pypi: pip install intervaltree From 0a4e1aa752dd815eca81146dd9c5c6eac78d015d Mon Sep 17 00:00:00 2001 From: Chaim Halbert Date: Mon, 17 Dec 2018 12:23:29 -0800 Subject: [PATCH 09/12] use .postN dev version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a94f5e4..ba0276a 100644 --- a/setup.py +++ b/setup.py @@ -38,7 +38,7 @@ def version_info(target_version): p = subprocess.Popen('git describe --tag'.split(), stdout=subprocess.PIPE) git_describe = p.communicate()[0].strip() release, build, commitish = git_describe.split('-') - version = "{0}b{1}".format(release, build) + version = "{0}.post{1}".format(release, build) else: # This is a RELEASE version version = target_version return { From ce14983e82663d096fa9827a1360aa33bce8f275 Mon Sep 17 00:00:00 2001 From: Chaim Halbert Date: Mon, 17 Dec 2018 12:24:26 -0800 Subject: [PATCH 10/12] distclean always before upload --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4b37a49..83ba3b3 100644 --- a/Makefile +++ b/Makefile @@ -88,7 +88,7 @@ release: $(eval PYPI=pypi) # Build source distribution -sdist-upload: deps-dev +sdist-upload: distclean deps-dev PYPI=$(PYPI) python setup.py sdist if [[ "$(PYPI)" == pypitest ]]; then \ $(TWINE) upload --repository-url https://test.pypi.org/legacy/ dist/*; \ From 28b9cbae05f2c82e273fbf2fdb4c9c54fc48b26c Mon Sep 17 00:00:00 2001 From: Chaim Halbert Date: Mon, 17 Dec 2018 12:30:47 -0800 Subject: [PATCH 11/12] disable pip cache for installing testpypi release --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 83ba3b3..7d25130 100644 --- a/Makefile +++ b/Makefile @@ -66,6 +66,7 @@ clean-temps: install-testpypi: pip install \ + --no-cache-dir \ --index-url https://test.pypi.org/simple/ \ --extra-index-url https://pypi.org/simple \ intervaltree From 94fb992179655e91d442e1487dac815c2b55f29b Mon Sep 17 00:00:00 2001 From: Chaim Halbert Date: Mon, 17 Dec 2018 12:35:51 -0800 Subject: [PATCH 12/12] upd changelog re version numbers and 3.8-dev testing --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f87edbd..d104f9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,12 +2,12 @@ ## Version 3.0.1 - Added: - - Travis testing for 3.7 (needed OpenSSL, sudo and Xenial) + - Travis testing for 3.7 and 3.8-dev. These needed OpenSSL, sudo and Xenial. 3.8-dev is allowed to fail. - Fixed: - PyPI wasn't rendering markdown because I didn't tell it what format to use. - Python 2 wasn't installing via pip because of a new utils package. It has been zapped. - Maintainers: - - TestPyPI version strings count from the latest tagged commit, which should be the last release + - TestPyPI version strings use `.postN` as the suffix instead of `bN`, and `N` counts from the latest tagged commit, which should be the last release - Install from TestPyPI works via `make install-testpypi` ## Version 3.0.0