Skip to content

Commit

Permalink
Merge branch 'master' of github.com:zopefoundation/Btrees
Browse files Browse the repository at this point in the history
Conflicts:
	CHANGES.rst
	setup.py
  • Loading branch information
Jim Fulton committed Jan 24, 2017
2 parents e407241 + 7c96119 commit 0a9d624
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 35 deletions.
23 changes: 20 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,40 @@ matrix:
python: 3.4
- os: linux
python: 3.5
- os: linux
python: 3.6
- os: linux
python: pypy
- os: linux
python: pypy3
python: pypy3.3-5.2-alpha1
# It's important to use 'macpython' builds to get the least
# restrictive wheel tag. It's also important to avoid
# 'homebrew 3' because it floats instead of being a specific version.
- os: osx
language: generic
env: TERRYFY_PYTHON='homebrew 2'
env: TERRYFY_PYTHON='macpython 2.7'
- os: osx
language: generic
env: TERRYFY_PYTHON='macpython 3.4'
- os: osx
language: generic
env: TERRYFY_PYTHON='homebrew 3'
env: TERRYFY_PYTHON='macpython 3.5'
- os: osx
language: generic
env: TERRYFY_PYTHON='macpython 3.6.0'
before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then git clone https://github.com/MacPython/terryfy; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then source terryfy/travis_tools.sh; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then get_python_environment $TERRYFY_PYTHON venv; fi
- if [[ "$TERRYFY_PYTHON" == "homebrew 3" ]]; then alias pip=`which pip3` ; fi
install:
- pip install -U pip setuptools
# persistent is a setup_requires, which gets downloaded by
# setuptools, not pip. But macpython 3.6.0 setuptools has trouble with SSL on
# Travis CI
# (https://travis-ci.org/zopefoundation/BTrees/jobs/192340692) so
# we install with pip manually.
- pip install -U persistent
- pip install -e .[ZODB]
script:
- python setup.py -q test -q
Expand All @@ -48,3 +63,5 @@ after_success:
env:
global:
secure: "Oh5gRJ+Fo8ZNmCkdrffpx201EPyTr9iUXmv6VqJMTebrzQpFdSWUVcANRmAzyfdyk3Wo0IjifVfWsKc+hvtbFmXZiLRFyEgoCUmzeWVumjebg2xxm0PbFHcRQgl4daBXxB0iqWkP8wXZ3daytuL74sYcbHizMYyhc7AxFbANsZc="

cache: pip
12 changes: 11 additions & 1 deletion BTrees/BTreeModuleTemplate.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,18 @@ module_init(void)
cPersistenceCAPI = (cPersistenceCAPIstruct *)PyCObject_Import(
"persistent.cPersistence", "CAPI");
#endif
if (cPersistenceCAPI == NULL)
if (cPersistenceCAPI == NULL) {
/* The Capsule API attempts to import 'persistent' and then
* walk down to the specified attribute using getattr. If the C
* extensions aren't available, this can result in an
* AttributeError being raised. Let that percolate up as an
* ImportError so it can be caught in the expected way.
*/
if (PyErr_Occurred() && !PyErr_ExceptionMatches(PyExc_ImportError)) {
PyErr_SetString(PyExc_ImportError, "persistent C extension unavailable");
}
return NULL;
}

#ifdef PY3K
#define _SET_TYPE(typ) ((PyObject*)(&typ))->ob_type = &PyType_Type
Expand Down
9 changes: 9 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
``BTrees`` Changelog
====================

4.4.2 (unreleased)
------------------

- Add support for Python 3.6.
- Raise an ``ImportError`` consistently on Python 3 if the C extension for
BTrees is used but the ``persistent`` C extension is not available.
Previously this could result in an odd ``AttributeError``. See
https://github.com/zopefoundation/BTrees/pull/55

4.4.1 (2017-01-24)
------------------

Expand Down
48 changes: 23 additions & 25 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,38 @@
environment:
password:
secure: CZWv3s2DBRU90N7aCoOKtw==
global:
TWINE_USERNAME: zope.wheelbuilder
TWINE_PASSWORD:
secure: UcdTh6W78cRLVGfKRFoa5A==

matrix:
- python : 27
- python : 27-x64
- python : 33
- python : 33-x64
- python : 34
- python : 34-x64
- python : 35
- python : 35-x64
- python: 27
- python: 27-x64
- python: 33
- python: 33-x64
- python: 34
- python: 34-x64
- python: 35
- python: 35-x64
- python: 36
- python: 36-x64

install:
- "SET PATH=C:\\Python%PYTHON%;c:\\Python%PYTHON%\\scripts;%PATH%"
- echo "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 > "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\vcvars64.bat"
- pip install -e .[ZODB]
- pip install -e .[ZODB]

build: false
build_script:
- pip install wheel
- python -W ignore setup.py -q bdist_wheel

test_script:
- python setup.py -q test -q

on_success:
- echo Build succesful!
artifacts:
- path: 'dist\*.whl'
name: wheel

deploy_script:
- echo [distutils] > %USERPROFILE%\\.pypirc
- echo index-servers = >> %USERPROFILE%\\.pypirc
- echo pypi >> %USERPROFILE%\\.pypirc
- echo [pypi] >> %USERPROFILE%\\.pypirc
- echo repository=https://pypi.python.org/pypi >> %USERPROFILE%\\.pypirc
- echo username=zope.wheelbuilder >> %USERPROFILE%\\.pypirc
- echo password=%password% >> %USERPROFILE%\\.pypirc
- set HOME=%USERPROFILE%
- pip install wheel twine
- ps: if($env:APPVEYOR_REPO_TAG -eq $TRUE) { python -W ignore setup.py bdist_wheel; twine upload dist/* }
- ps: if ($env:APPVEYOR_REPO_TAG -eq $TRUE) { pip install twine; twine upload dist/* }

deploy : on
deploy: on
11 changes: 6 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def __str__(self):
]

FLAVORS = {"O": "object", "I": "int", "F": "float", 'L': 'int'}
#XXX should 'fs' be in ZODB instead?
# XXX should 'fs' be in ZODB instead?
FAMILIES = ("OO", "IO", "OI", "II", "IF", "fs", "LO", "OL", "LL", "LF")

KEY_H = "BTrees/%skeymacros.h"
Expand Down Expand Up @@ -127,6 +127,7 @@ def BTreeExtension(family):
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Framework :: ZODB",
Expand All @@ -143,9 +144,9 @@ def BTreeExtension(family):
packages=find_packages(),
include_package_data=True,
zip_safe=False,
ext_modules = ext_modules,
ext_modules=ext_modules,
setup_requires=['persistent'],
extras_require = {
extras_require={
'test': TESTS_REQUIRE,
'ZODB': ['ZODB'],
'testing': TESTS_REQUIRE + ['nose', 'coverage'],
Expand All @@ -154,6 +155,6 @@ def BTreeExtension(family):
test_suite="BTrees.tests",
tests_require=TESTS_REQUIRE,
install_requires=REQUIRES,
entry_points = """\
entry_points="""\
"""
)
)
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ envlist =
# Jython support pending 2.7 support, due 2012-07-15 or so. See:
# http://fwierzbicki.blogspot.com/2012/03/adconion-to-fund-jython-27.html
# py27,jython,pypy,coverage,docs
py27,py27-pure,pypy,py33,py34,py35,py35-pure,pypy3,w_zodb,coverage,docs
py27,py27-pure,pypy,py33,py34,py35,py35-pure,py36,pypy3,w_zodb,coverage,docs

[testenv]
deps =
Expand Down

0 comments on commit 0a9d624

Please sign in to comment.