Skip to content

Commit

Permalink
Merge 50f2a86 into f3efe74
Browse files Browse the repository at this point in the history
  • Loading branch information
jamadden committed Apr 14, 2021
2 parents f3efe74 + 50f2a86 commit c3cc784
Show file tree
Hide file tree
Showing 13 changed files with 100 additions and 62 deletions.
2 changes: 2 additions & 0 deletions .coveragerc
@@ -1,5 +1,7 @@
[run]
source = nti.externalization
# New in 5.0; required for the GHA coveralls submission.
relative_files = True
omit =
*/flycheck_*py
*/benchmarks/*py
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/tests.yml
@@ -0,0 +1,55 @@
name: tests

on: [push, pull_request]

env:
PYTHONHASHSEED: 1042466059
ZOPE_INTERFACE_STRICT_IRO: 1
CFLAGS: "-Ofast -pipe -fomit-frame-pointer -march=native"
PIP_UPGRADE_STRATEGY: eager


jobs:
test:
strategy:
matrix:
python-version: [2.7, pypy2, pypy3, 3.6, 3.7, 3.8, 3.9]

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('setup.*') }}-${{ matrix.python-version }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install -U pip setuptools wheel
python -m pip install -U coverage cython
python -m pip install -U -e ".[test,docs]"
- name: Test
run: |
coverage run -m zope.testrunner --test-path=src --auto-color --auto-progress
# XXX: Fix doctests
# coverage run -a -m sphinx -b doctest -d docs/_build/doctrees docs docs/_build/doctests
- name: Submit to Coveralls
# This is a container action, which only runs on Linux.
uses: AndreMiras/coveralls-python-action@develop
with:
parallel: true

coveralls_finish:
needs: test
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@develop
with:
parallel-finished: true
47 changes: 0 additions & 47 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions CHANGES.rst
Expand Up @@ -3,10 +3,10 @@
=========


2.1.1 (unreleased)
2.2.0 (unreleased)
==================

- Nothing changed yet.
- Add support for Python 3.9.


2.1.0 (2020-08-03)
Expand Down
4 changes: 3 additions & 1 deletion MANIFEST.in
Expand Up @@ -8,10 +8,12 @@ include TODO
include babel.cfg
include nose2.cfg
include tox.ini
include .travis.yml
include *.txt
include .isort.cfg
include pyproject.toml
exclude .nti_cover_package

recursive-include .github *
recursive-include docs *.py
recursive-include docs *.rst
recursive-include docs Makefile
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Expand Up @@ -10,8 +10,8 @@
:target: https://pypi.org/project/nti.externalization/
:alt: Supported Python versions

.. image:: https://travis-ci.org/NextThought/nti.externalization.svg?branch=master
:target: https://travis-ci.org/NextThought/nti.externalization
.. image:: https://github.com/NextThought/nti.externalization/workflows/tests/badge.svg
:target: https://github.com/NextThought/nti.externalization/actions?query=workflow%3Atests

.. image:: https://coveralls.io/repos/github/NextThought/nti.externalization/badge.svg?branch=master
:target: https://coveralls.io/github/NextThought/nti.externalization?branch=master
Expand Down
2 changes: 1 addition & 1 deletion docs/basics.rst
Expand Up @@ -64,7 +64,7 @@ Getting Started
===============

In its simplest form, there are two functions you'll use to
externalize and internalize objects::
externalize and internalize objects:

>>> from nti.externalization import to_external_object
>>> from nti.externalization import update_from_external_object
Expand Down
1 change: 1 addition & 0 deletions docs/conf.py
Expand Up @@ -42,6 +42,7 @@
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
'repoze.sphinx.autointerface',
Expand Down
21 changes: 21 additions & 0 deletions pyproject.toml
@@ -0,0 +1,21 @@
[build-system]
build-backend = "setuptools.build_meta"
# Build dependencies. Remember to change these in make-manylinux and appveyor.yml
# if you add/remove/change them.
requires = [
"setuptools >= 40.8.0",
"wheel",

# Python 3.7 requires at least Cython 0.27.3.
# 0.28 is faster, and (important!) lets us specify the target module
# name to be created so that we can have both foo.py and _foo.so
# at the same time. 0.29 fixes some issues with Python 3.7,
# and adds the 3str mode for transition to Python 3. 0.29.14+ is
# required for Python 3.8. 3.0a2 introduced a change that prevented
# us from compiling (https://github.com/gevent/gevent/issues/1599)
# but once that was fixed, 3.0a4 led to all of our leak tests
# failing in Python 2 (https://travis-ci.org/github/gevent/gevent/jobs/683782800);
# This was fixed in 3.0a5 (https://github.com/cython/cython/issues/3578)
# 3.0a6 fixes an issue cythonizing source on 32-bit platforms
"Cython >= 3.0a6",
]
11 changes: 6 additions & 5 deletions setup.py
Expand Up @@ -119,7 +119,7 @@ def _c(m):
sources=[source],
depends=deps,
define_macros=[
# ('CYTHON_TRACE', '1')
# ('CYTHON_TRACE', '1')
],
))

Expand Down Expand Up @@ -147,7 +147,7 @@ def _c(m):

setup(
name='nti.externalization',
version='2.1.1.dev0',
version='2.2.0.dev0',
author='Jason Madden',
author_email='jason@nextthought.com',
description="NTI Externalization",
Expand All @@ -165,6 +165,7 @@ def _c(m):
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
],
Expand All @@ -177,12 +178,12 @@ def _c(m):
ext_modules=ext_modules,
tests_require=TESTS_REQUIRE,
install_requires=[
'BTrees >= 4.7.1',
'BTrees >= 4.8.0', # Registers BTrees as Mapping automatically.
'PyYAML >= 5.1',
'ZODB >= 5.5.1',
'isodate',
'nti.schema >= 1.14.0',
'persistent >= 4.6.4',
'persistent >= 4.7.0',
'pytz',
'setuptools',
'simplejson',
Expand All @@ -207,7 +208,7 @@ def _c(m):
extras_require={
'test': TESTS_REQUIRE,
'docs': [
'Sphinx',
'Sphinx < 4', # Sphinx 4 breaks repoze.sphinx.autointerface 0.8
'repoze.sphinx.autointerface',
'sphinx_rtd_theme',
],
Expand Down
4 changes: 3 additions & 1 deletion src/nti/externalization/datetime.py
Expand Up @@ -72,7 +72,7 @@ def date_from_string(string):
programattic input, you probably want to use a custom field that
uses :func:`zope.datetime.parse` in its ``fromUnicode`` method.
>>> IDate('1982-01-31')
>>> date_from_string('1982-01-31')
datetime.date(1982, 1, 31)
"""
# This:
Expand Down Expand Up @@ -208,6 +208,8 @@ class date_to_string(object):
>>> import datetime
>>> from nti.externalization.externalization import to_external_object
>>> from zope import component
>>> component.provideAdapter(date_to_string)
>>> to_external_object(datetime.date(1982, 1, 31))
'1982-01-31'
"""
Expand Down
1 change: 1 addition & 0 deletions src/nti/externalization/singleton.py
Expand Up @@ -62,6 +62,7 @@ class is instantiated.
The original constructor is also cached to allow subclasses to access it
and have their own instance.
>>> from nti.externalization.singleton import Singleton
>>> class TopSingleton(Singleton):
... def __init__(self):
... print("I am never called")
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
@@ -1,15 +1,13 @@
[tox]
envlist =
py27,py27-pure,py36,py36-pure,py37,py38,pypy,pypy3,coverage,docs
py27,py27-pure,py36,py36-pure,py37,py38,py39,pypy,pypy3,coverage,docs

[testenv]
usedevelop = true
commands =
zope-testrunner --test-path=src []
extras =
test
deps =
Cython >= 0.29
setenv =
pure: PURE_PYTHON=1
ZOPE_INTERFACE_STRICT_IRO=1
Expand All @@ -30,6 +28,8 @@ setenv =
[testenv:docs]
commands =
sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html
# XXX: Fix doctests
#python -m sphinx -b doctest -d docs/_build/doctrees docs docs/_build/doctests
extras = docs
setenv =
PURE_PYTHON = 1

0 comments on commit c3cc784

Please sign in to comment.