Skip to content

Commit

Permalink
Merge pull request #78 from chaimleib/dev
Browse files Browse the repository at this point in the history
Dev -> master (3.0.1)
  • Loading branch information
chaimleib authored Dec 17, 2018
2 parents 5061458 + 94fb992 commit 72e0a82
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 63 deletions.
28 changes: 19 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)`
Expand Down
32 changes: 28 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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
Expand Down
36 changes: 27 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<<!!!\n")
print("Version: {version}".format(**version_info))
print("Version: {version}".format(**vinfo))

with open('README.md', 'r') as fh:
long_description = fh.read()
Expand All @@ -59,10 +76,11 @@ def run_tests(self):
## Run setuptools
setup(
name='intervaltree',
version=version_info['version'],
version=vinfo['version'],
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',
Expand Down Expand Up @@ -90,7 +108,7 @@ def run_tests(self):
author='Chaim Leib Halbert, Konstantin Tretyakov',
author_email='[email protected]',
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,
Expand Down
Empty file removed utils/__init__.py
Empty file.
41 changes: 0 additions & 41 deletions utils/version.py

This file was deleted.

0 comments on commit 72e0a82

Please sign in to comment.