Skip to content

Commit

Permalink
Add suppot for Python 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
mgedmin committed Aug 9, 2018
1 parent 9608463 commit 569827b
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 12 deletions.
9 changes: 7 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ python:
- 3.4
- 3.5
- 3.6
- pypy-5.4.1
- pypy
matrix:
include:
- python: 3.7
dist: xenial
sudo: true
script:
- coverage run -m zope.testrunner --test-path=src --auto-color --auto-progress

Expand All @@ -24,4 +29,4 @@ install:
cache: pip

before_cache:
- rm -f $HOME/.cache/pip/log/debug.log
- rm -f $HOME/.cache/pip/log/debug.log
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ Changes
- Fix the possibility of a rare crash in the C extension when deallocating items. See
https://github.com/zopefoundation/zope.i18nmessageid/issues/7

- Add support for Python 3.7.


4.1.0 (2017-05-02)
------------------

Expand Down
2 changes: 2 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ environment:
- python: 35-x64
- python: 36
- python: 36-x64
- python: 37
- python: 37-x64

install:
- "SET PATH=C:\\Python%PYTHON%;c:\\Python%PYTHON%\\scripts;%PATH%"
Expand Down
24 changes: 15 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,30 @@
"_zope_i18nmessageid_message.c")
codeoptimization = Feature(
"Optional code optimizations",
standard = True,
ext_modules = [Extension(
standard=True,
ext_modules=[Extension(
"zope.i18nmessageid._zope_i18nmessageid_message",
[os.path.normcase(codeoptimization_c)]
)])

extra = {
'extras_require': {'testing': ['nose', 'coverage'],
'docs': ['Sphinx'],
},
'extras_require': {
'testing': ['nose', 'coverage'],
'docs': ['Sphinx'],
},
}

if not is_pypy and not is_jython:
# Jython cannot build the C optimizations, while on PyPy they are
# anti-optimizations (the C extension compatibility layer is known-slow,
# and defeats JIT opportunities).
extra['features'] = {'codeoptimization':codeoptimization}
extra['features'] = {'codeoptimization': codeoptimization}


def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()


class optional_build_ext(build_ext):
"""This class subclasses build_ext and allows
the building of C extensions to fail.
Expand Down Expand Up @@ -94,7 +97,9 @@ def _unavailable(self, e):
sys.stderr.write(str(e) + '\n')
sys.stderr.write('*' * 80 + '\n')

setup(name='zope.i18nmessageid',

setup(
name='zope.i18nmessageid',
version='4.1.1.dev0',
author='Zope Foundation and Contributors',
author_email='zope-dev@zope.org',
Expand All @@ -118,6 +123,7 @@ def _unavailable(self, e):
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
'Natural Language :: English',
Expand All @@ -129,11 +135,11 @@ def _unavailable(self, e):
url='http://pypi.python.org/pypi/zope.i18nmessageid',
packages=find_packages('src'),
package_dir={'': 'src'},
namespace_packages=['zope',],
namespace_packages=['zope'],
install_requires=['setuptools'],
include_package_data=True,
test_suite='zope.i18nmessageid.tests.test_suite',
zip_safe=False,
cmdclass={'build_ext':optional_build_ext},
cmdclass={'build_ext': optional_build_ext},
**extra
)
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist =
py27,py33,py34,py35,py36,pypy,pypy3,coverage,docs
py27,py33,py34,py35,py36,py37,pypy,pypy3,coverage,docs

[testenv]
deps =
Expand Down

0 comments on commit 569827b

Please sign in to comment.