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..d104f9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Change log +## Version 3.0.1 +- Added: + - 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 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 - Breaking: - `search(begin, end, strict)` has been replaced with `at(point)`, `overlap(begin, end)`, and `envelop(begin, end)` diff --git a/Makefile b/Makefile index 3802ca2..7d25130 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,11 @@ clean-temps: rm -rf $(TEMPS) install-testpypi: - pip install --pre -i https://testpypi.python.org/pypi intervaltree + pip install \ + --no-cache-dir \ + --index-url https://test.pypi.org/simple/ \ + --extra-index-url https://pypi.org/simple \ + intervaltree install-pypi: pip install intervaltree @@ -75,8 +89,13 @@ release: $(eval PYPI=pypi) # Build source distribution -sdist-upload: - PYPI=$(PYPI) python setup.py sdist upload -r $(PYPI) +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/*; \ + else \ + $(TWINE) upload dist/*; \ + fi deps-dev: pyenv-install-versions @@ -88,7 +107,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 6d559ab..ba0276a 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.0' +target_version = '3.0.1' + + +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) + else: # This is a RELEASE version + version = target_version + return { + 'is_dev_version': is_dev_version, + 'version': version, + 'target_version': target_version + } + -version_info = version.version_info(target_version) -if version_info['is_dev_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, + 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', @@ -90,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 f50ea96..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'.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 - }