summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2019-10-24 13:40:28 +0100
committerColin Watson <cjwatson@debian.org>2019-10-24 13:40:51 +0100
commitdad8f22cb73a0f6b76299e71ce2aaa7792442a1f (patch)
tree0dfe5b665667be9888df2aa9a7da03176c12eca5
parent6c99ef1641ae3bbf0b033b86d16be1c5c6c1356b (diff)
parent1b170095f3e7d03666d8e672d3ad62355a5240dc (diff)
Update upstream source from tag 'upstream/1.5.0'
Update to upstream version '1.5.0' with Debian dir d529afc2e5a25c782a39ba9924425a0eb5fac3f1
-rw-r--r--.appveyor.yml (renamed from appveyor.yml)50
-rw-r--r--.bumpversion.cfg2
-rw-r--r--.cookiecutterrc25
-rw-r--r--.editorconfig2
-rw-r--r--.gitignore71
-rw-r--r--.travis.yml48
-rw-r--r--AUTHORS.rst3
-rw-r--r--CHANGELOG.rst10
-rw-r--r--CONTRIBUTING.rst4
-rw-r--r--MANIFEST.in2
-rw-r--r--PKG-INFO33
-rw-r--r--README.rst30
-rw-r--r--ci/appveyor-bootstrap.py111
-rwxr-xr-xci/appveyor-download.py2
-rwxr-xr-xci/bootstrap.py59
-rw-r--r--ci/requirements.txt3
-rw-r--r--ci/templates/.appveyor.yml (renamed from ci/templates/appveyor.yml)32
-rw-r--r--ci/templates/.travis.yml24
-rw-r--r--debian/changelog6
-rw-r--r--docs/conf.py8
-rw-r--r--docs/requirements.txt1
-rw-r--r--setup.cfg2
-rw-r--r--setup.py8
-rw-r--r--src/tblib.egg-info/PKG-INFO33
-rw-r--r--src/tblib.egg-info/SOURCES.txt7
-rw-r--r--src/tblib/__init__.py9
-rw-r--r--tests/test_issue30.py8
-rw-r--r--tox.ini49
28 files changed, 333 insertions, 309 deletions
diff --git a/appveyor.yml b/.appveyor.yml
index dce598c..71d0450 100644
--- a/appveyor.yml
+++ b/.appveyor.yml
@@ -1,85 +1,77 @@
version: '{branch}-{build}'
build: off
-cache:
- - '%LOCALAPPDATA%\pip\Cache'
environment:
- global:
- WITH_COMPILER: 'cmd /E:ON /V:ON /C .\ci\appveyor-with-compiler.cmd'
matrix:
- TOXENV: check
TOXPYTHON: C:\Python36\python.exe
PYTHON_HOME: C:\Python36
PYTHON_VERSION: '3.6'
PYTHON_ARCH: '32'
- - TOXENV: 'py27,report,codecov'
+ - TOXENV: py27,codecov
TOXPYTHON: C:\Python27\python.exe
PYTHON_HOME: C:\Python27
PYTHON_VERSION: '2.7'
PYTHON_ARCH: '32'
- - TOXENV: 'py27,report,codecov'
+ - TOXENV: py27,codecov
TOXPYTHON: C:\Python27-x64\python.exe
- WINDOWS_SDK_VERSION: v7.0
PYTHON_HOME: C:\Python27-x64
PYTHON_VERSION: '2.7'
PYTHON_ARCH: '64'
- - TOXENV: 'py34,report,codecov'
- TOXPYTHON: C:\Python34\python.exe
- PYTHON_HOME: C:\Python34
- PYTHON_VERSION: '3.4'
- PYTHON_ARCH: '32'
- - TOXENV: 'py34,report,codecov'
- TOXPYTHON: C:\Python34-x64\python.exe
- WINDOWS_SDK_VERSION: v7.1
- PYTHON_HOME: C:\Python34-x64
- PYTHON_VERSION: '3.4'
- PYTHON_ARCH: '64'
- - TOXENV: 'py35,report,codecov'
+ WINDOWS_SDK_VERSION: v7.0
+ - TOXENV: py35,codecov
TOXPYTHON: C:\Python35\python.exe
PYTHON_HOME: C:\Python35
PYTHON_VERSION: '3.5'
PYTHON_ARCH: '32'
- - TOXENV: 'py35,report,codecov'
+ - TOXENV: py35,codecov
TOXPYTHON: C:\Python35-x64\python.exe
PYTHON_HOME: C:\Python35-x64
PYTHON_VERSION: '3.5'
PYTHON_ARCH: '64'
- - TOXENV: 'py36,report,codecov'
+ - TOXENV: py36,codecov
TOXPYTHON: C:\Python36\python.exe
PYTHON_HOME: C:\Python36
PYTHON_VERSION: '3.6'
PYTHON_ARCH: '32'
- - TOXENV: 'py36,report,codecov'
+ - TOXENV: py36,codecov
TOXPYTHON: C:\Python36-x64\python.exe
PYTHON_HOME: C:\Python36-x64
PYTHON_VERSION: '3.6'
PYTHON_ARCH: '64'
- - TOXENV: 'py37,report,codecov'
+ - TOXENV: py37,codecov
TOXPYTHON: C:\Python37\python.exe
PYTHON_HOME: C:\Python37
PYTHON_VERSION: '3.7'
PYTHON_ARCH: '32'
- - TOXENV: 'py37,report,codecov'
+ - TOXENV: py37,codecov
TOXPYTHON: C:\Python37-x64\python.exe
PYTHON_HOME: C:\Python37-x64
PYTHON_VERSION: '3.7'
PYTHON_ARCH: '64'
+ - TOXENV: py38,codecov
+ TOXPYTHON: C:\Python38\python.exe
+ PYTHON_HOME: C:\Python38
+ PYTHON_VERSION: '3.8'
+ PYTHON_ARCH: '32'
+ - TOXENV: py38,codecov
+ TOXPYTHON: C:\Python38-x64\python.exe
+ PYTHON_HOME: C:\Python38-x64
+ PYTHON_VERSION: '3.8'
+ PYTHON_ARCH: '64'
init:
- ps: echo $env:TOXENV
- ps: ls C:\Python*
install:
- - python -u ci\appveyor-bootstrap.py
+ - '%PYTHON_HOME%\python -mpip install --progress-bar=off tox -rci/requirements.txt'
- '%PYTHON_HOME%\Scripts\virtualenv --version'
- '%PYTHON_HOME%\Scripts\easy_install --version'
- '%PYTHON_HOME%\Scripts\pip --version'
- '%PYTHON_HOME%\Scripts\tox --version'
test_script:
- - '%WITH_COMPILER% %PYTHON_HOME%\Scripts\tox'
-
+ - cmd /E:ON /V:ON /C .\ci\appveyor-with-compiler.cmd %PYTHON_HOME%\Scripts\tox
on_failure:
- ps: dir "env:"
- ps: get-content .tox\*\log\*
-artifacts:
- - path: dist\*
### To enable remote debugging uncomment this (also, see: http://www.appveyor.com/docs/how-to/rdp-to-build-worker):
# on_finish:
diff --git a/.bumpversion.cfg b/.bumpversion.cfg
index 8b40540..98a565a 100644
--- a/.bumpversion.cfg
+++ b/.bumpversion.cfg
@@ -1,5 +1,5 @@
[bumpversion]
-current_version = 1.4.0
+current_version = 1.5.0
commit = True
tag = True
diff --git a/.cookiecutterrc b/.cookiecutterrc
index ce3c52b..5e0c749 100644
--- a/.cookiecutterrc
+++ b/.cookiecutterrc
@@ -3,40 +3,53 @@
cookiecutter:
_extensions:
- jinja2_time.TimeExtension
- _template: cookiecutter-pylibrary
+ _template: /home/ionel/open-source/cookiecutter-pylibrary
+ allow_tests_inside_package: no
appveyor: yes
c_extension_function: '-'
c_extension_module: '-'
c_extension_optional: no
c_extension_support: no
+ c_extension_test_pypi: no
+ c_extension_test_pypi_username: '-'
codacy: no
+ codacy_projectid: '-'
codeclimate: no
codecov: yes
command_line_interface: no
command_line_interface_bin_name: '-'
- coveralls: yes
+ coveralls: no
+ coveralls_token: '-'
distribution_name: tblib
email: contact@ionelmc.ro
full_name: Ionel Cristian Mărieș
- github_username: ionelmc
landscape: no
license: BSD 2-Clause License
linter: flake8
package_name: tblib
project_name: tblib
project_short_description: Traceback serialization library.
- release_date: '2017-04-09'
+ pypi_badge: yes
+ pypi_disable_upload: no
+ release_date: '2019-05-02'
+ repo_hosting: github.com
+ repo_hosting_domain: github.com
repo_name: python-tblib
+ repo_username: ionelmc
requiresio: yes
scrutinizer: no
+ setup_py_uses_setuptools_scm: no
+ setup_py_uses_test_runner: no
sphinx_docs: yes
+ sphinx_docs_hosting: https://python-tblib.readthedocs.io/
sphinx_doctest: no
sphinx_theme: sphinx-py3doc-enhanced-theme
test_matrix_configurator: no
test_matrix_separate_coverage: no
test_runner: pytest
travis: yes
- version: 1.3.2
- website: http://blog.ionelmc.ro
+ travis_osx: no
+ version: 1.4.0
+ website: https://blog.ionelmc.ro/
year_from: '2013'
year_to: '2019'
diff --git a/.editorconfig b/.editorconfig
index 4000618..6eb7567 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,4 +1,4 @@
-# see http://editorconfig.org
+# see https://editorconfig.org/
root = true
[*]
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..dfe5838
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,71 @@
+*.py[cod]
+__pycache__
+
+# C extensions
+*.so
+
+# Packages
+*.egg
+*.egg-info
+dist
+build
+eggs
+.eggs
+parts
+bin
+var
+sdist
+wheelhouse
+develop-eggs
+.installed.cfg
+lib
+lib64
+venv*/
+pyvenv*/
+pip-wheel-metadata/
+
+# Installer logs
+pip-log.txt
+
+# Unit test / coverage reports
+.coverage
+.tox
+.coverage.*
+.pytest_cache/
+nosetests.xml
+coverage.xml
+htmlcov
+
+# Translations
+*.mo
+
+# Mr Developer
+.mr.developer.cfg
+.project
+.pydevproject
+.idea
+*.iml
+*.komodoproject
+
+# Complexity
+output/*.html
+output/*/index.html
+
+# Sphinx
+docs/_build
+
+.DS_Store
+*~
+.*.sw[po]
+.build
+.ve
+.env
+.cache
+.pytest
+.benchmarks
+.bootstrap
+.appveyor.token
+*.bak
+
+# Mypy Cache
+.mypy_cache/
diff --git a/.travis.yml b/.travis.yml
index 171d58f..0e947cb 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,6 @@
language: python
dist: xenial
+cache: false
env:
global:
- LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so
@@ -12,33 +13,34 @@ matrix:
- python: '3.6'
env:
- TOXENV=docs
- - python: '2.7'
- env:
- - TOXENV=py27,report,coveralls,codecov
- - python: '3.4'
- env:
- - TOXENV=py34,report,coveralls,codecov
- - python: '3.5'
- env:
- - TOXENV=py35,report,coveralls,codecov
- - python: '3.6'
- env:
- - TOXENV=py36,report,coveralls,codecov
- - python: '3.7'
- env:
- - TOXENV=py37,report,coveralls,codecov
- - python: 'pypy2.7-6.0'
- env:
- - TOXENV=pypy,report,coveralls,codecov
- - python: 'pypy3.5-6.0'
- env:
- - TOXENV=pypy3,report,coveralls,codecov
+ - env:
+ - TOXENV=py27,codecov
+ python: '2.7'
+ - env:
+ - TOXENV=py35,codecov
+ python: '3.5'
+ - env:
+ - TOXENV=py36,codecov
+ python: '3.6'
+ - env:
+ - TOXENV=py37,codecov
+ python: '3.7'
+ - env:
+ - TOXENV=py38,codecov
+ python: '3.8'
+ - env:
+ - TOXENV=pypy,codecov
+ python: 'pypy'
+ - env:
+ - TOXENV=pypy3,codecov
+ - TOXPYTHON=pypy3
+ python: 'pypy3'
before_install:
- python --version
- uname -a
- - lsb_release -a
+ - lsb_release -a || true
install:
- - pip install tox
+ - python -mpip install --progress-bar=off tox -rci/requirements.txt
- virtualenv --version
- easy_install --version
- pip --version
diff --git a/AUTHORS.rst b/AUTHORS.rst
index a11e80c..9db24b3 100644
--- a/AUTHORS.rst
+++ b/AUTHORS.rst
@@ -6,5 +6,6 @@ Authors
* Beckjake - https://github.com/beckjake
* DRayX - https://github.com/DRayX
* Jason Madden - https://github.com/jamadden
-* Jon Dufresne - https://github.com/jdufresne/
+* Jon Dufresne - https://github.com/jdufresne
* Elliott Sales de Andrade - https://github.com/QuLogic
+* Victor Stinner - https://github.com/vstinner
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index ea857c3..aaab9d8 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -2,10 +2,18 @@
Changelog
=========
+1.5.0 (2019-10-23)
+~~~~~~~~~~~~~~~~~~
+
+* Added support for Python 3.8. Contributed by Victor Stinner in
+ `#42 <HTTPS://GITHUB.COM/IONELMC/PYTHON-TBLIB/ISSUES/42>`_.
+* Removed support for end of life Python 3.4.
+* Few CI improvements and fixes.
+
1.4.0 (2019-05-02)
~~~~~~~~~~~~~~~~~~
-* Remove support for end of life Python 3.3.
+* Removed support for end of life Python 3.3.
* Fixed tests for Python 3.7. Contributed by Elliott Sales de Andrade in
`#36 <https://github.com/ionelmc/python-tblib/issues/36>`_.
* Fixed compatibility issue with Twised (``twisted.python.failure.Failure`` expected a ``co_code`` attribute).
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
index 229e5cd..1d6bfc5 100644
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -41,7 +41,7 @@ To set up `python-tblib` for local development:
(look for the "Fork" button).
2. Clone your fork locally::
- git clone git@github.com:your_name_here/python-tblib.git
+ git clone git@github.com:ionelmc/python-tblib.git
3. Create a branch for local development::
@@ -49,7 +49,7 @@ To set up `python-tblib` for local development:
Now you can make your changes locally.
-4. When you're done making changes, run all the checks, doc builder and spell checker with `tox <http://tox.readthedocs.io/en/latest/install.html>`_ one command::
+4. When you're done making changes run all the checks and docs builder with `tox <https://tox.readthedocs.io/en/latest/install.html>`_ one command::
tox
diff --git a/MANIFEST.in b/MANIFEST.in
index 3ae9b54..81df70c 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -14,6 +14,6 @@ include CONTRIBUTING.rst
include LICENSE
include README.rst
-include tox.ini .travis.yml appveyor.yml
+include tox.ini .travis.yml .appveyor.yml
global-exclude *.py[cod] __pycache__ *.so *.dylib
diff --git a/PKG-INFO b/PKG-INFO
index e7e6fc9..672d955 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,11 +1,11 @@
Metadata-Version: 1.2
Name: tblib
-Version: 1.4.0
+Version: 1.5.0
Summary: Traceback serialization library.
Home-page: https://github.com/ionelmc/python-tblib
Author: Ionel Cristian Mărieș
Author-email: contact@ionelmc.ro
-License: BSD 2-Clause License
+License: BSD-2-Clause
Project-URL: Documentation, https://python-tblib.readthedocs.io/
Project-URL: Changelog, https://python-tblib.readthedocs.io/en/latest/changelog.html
Project-URL: Issue Tracker, https://github.com/ionelmc/python-tblib/issues
@@ -506,11 +506,14 @@ Description: ========
>>> def local_0():
... pool = Pool()
- ... for i in pool.map(apply_with_return_error, zip(repeat(func_a), range(5))):
- ... if isinstance(i, Error):
- ... i.reraise()
- ... else:
- ... print(i)
+ ... try:
+ ... for i in pool.map(apply_with_return_error, zip(repeat(func_a), range(5))):
+ ... if isinstance(i, Error):
+ ... i.reraise()
+ ... else:
+ ... print(i)
+ ... finally:
+ ... pool.close()
...
>>> def local_1():
... local_0()
@@ -529,7 +532,7 @@ Description: ========
local_1()
File "<doctest README.rst[...]>", line 2, in local_1
local_0()
- File "<doctest README.rst[...]>", line 5, in local_0
+ File "<doctest README.rst[...]>", line 6, in local_0
i.reraise()
File "...tblib...decorators.py", line 20, in reraise
reraise(self.exc_type, self.exc_value, self.traceback)
@@ -578,10 +581,18 @@ Description: ========
Changelog
=========
+ 1.5.0 (2019-10-23)
+ ~~~~~~~~~~~~~~~~~~
+
+ * Added support for Python 3.8. Contributed by Victor Stinner in
+ `#42 <HTTPS://GITHUB.COM/IONELMC/PYTHON-TBLIB/ISSUES/42>`_.
+ * Removed support for end of life Python 3.4.
+ * Few CI improvements and fixes.
+
1.4.0 (2019-05-02)
~~~~~~~~~~~~~~~~~~
- * Remove support for end of life Python 3.3.
+ * Removed support for end of life Python 3.3.
* Fixed tests for Python 3.7. Contributed by Elliott Sales de Andrade in
`#36 <https://github.com/ionelmc/python-tblib/issues/36>`_.
* Fixed compatibility issue with Twised (``twisted.python.failure.Failure`` expected a ``co_code`` attribute).
@@ -634,11 +645,11 @@ Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Utilities
-Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
+Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
diff --git a/README.rst b/README.rst
index 48f23d2..9377f35 100644
--- a/README.rst
+++ b/README.rst
@@ -11,7 +11,7 @@ Overview
- |docs|
* - tests
- | |travis| |appveyor| |requires|
- | |coveralls| |codecov|
+ | |codecov|
* - package
- | |version| |wheel| |supported-versions| |supported-implementations|
| |commits-since|
@@ -19,7 +19,7 @@ Overview
:target: https://readthedocs.org/projects/python-tblib
:alt: Documentation Status
-.. |travis| image:: https://travis-ci.org/ionelmc/python-tblib.svg?branch=master
+.. |travis| image:: https://api.travis-ci.org/ionelmc/python-tblib.svg?branch=master
:alt: Travis-CI Build Status
:target: https://travis-ci.org/ionelmc/python-tblib
@@ -31,10 +31,6 @@ Overview
:alt: Requirements Status
:target: https://requires.io/github/ionelmc/python-tblib/requirements/?branch=master
-.. |coveralls| image:: https://coveralls.io/repos/ionelmc/python-tblib/badge.svg?branch=master&service=github
- :alt: Coverage Status
- :target: https://coveralls.io/r/ionelmc/python-tblib
-
.. |codecov| image:: https://codecov.io/github/ionelmc/python-tblib/coverage.svg?branch=master
:alt: Coverage Status
:target: https://codecov.io/github/ionelmc/python-tblib
@@ -43,10 +39,6 @@ Overview
:alt: PyPI Package latest release
:target: https://pypi.org/project/tblib
-.. |commits-since| image:: https://img.shields.io/github/commits-since/ionelmc/python-tblib/v1.4.0.svg
- :alt: Commits since latest release
- :target: https://github.com/ionelmc/python-tblib/compare/v1.4.0...master
-
.. |wheel| image:: https://img.shields.io/pypi/wheel/tblib.svg
:alt: PyPI Wheel
:target: https://pypi.org/project/tblib
@@ -59,6 +51,9 @@ Overview
:alt: Supported implementations
:target: https://pypi.org/project/tblib
+.. |commits-since| image:: https://img.shields.io/github/commits-since/ionelmc/python-tblib/v1.5.0.svg
+ :alt: Commits since latest release
+ :target: https://github.com/ionelmc/python-tblib/compare/v1.5.0...master
.. end-badges
@@ -553,11 +548,14 @@ What if we have a local call stack ?
>>> def local_0():
... pool = Pool()
- ... for i in pool.map(apply_with_return_error, zip(repeat(func_a), range(5))):
- ... if isinstance(i, Error):
- ... i.reraise()
- ... else:
- ... print(i)
+ ... try:
+ ... for i in pool.map(apply_with_return_error, zip(repeat(func_a), range(5))):
+ ... if isinstance(i, Error):
+ ... i.reraise()
+ ... else:
+ ... print(i)
+ ... finally:
+ ... pool.close()
...
>>> def local_1():
... local_0()
@@ -576,7 +574,7 @@ What if we have a local call stack ?
local_1()
File "<doctest README.rst[...]>", line 2, in local_1
local_0()
- File "<doctest README.rst[...]>", line 5, in local_0
+ File "<doctest README.rst[...]>", line 6, in local_0
i.reraise()
File "...tblib...decorators.py", line 20, in reraise
reraise(self.exc_type, self.exc_value, self.traceback)
diff --git a/ci/appveyor-bootstrap.py b/ci/appveyor-bootstrap.py
deleted file mode 100644
index dd76230..0000000
--- a/ci/appveyor-bootstrap.py
+++ /dev/null
@@ -1,111 +0,0 @@
-"""
-AppVeyor will at least have few Pythons around so there's no point of implementing a bootstrapper in PowerShell.
-
-This is a port of https://github.com/pypa/python-packaging-user-guide/blob/master/source/code/install.ps1
-with various fixes and improvements that just weren't feasible to implement in PowerShell.
-"""
-from __future__ import print_function
-from os import environ
-from os.path import exists
-from subprocess import check_call
-
-try:
- from urllib.request import urlretrieve
-except ImportError:
- from urllib import urlretrieve
-
-BASE_URL = "https://www.python.org/ftp/python/"
-GET_PIP_URL = "https://bootstrap.pypa.io/get-pip.py"
-GET_PIP_PATH = "C:\get-pip.py"
-URLS = {
- ("2.7", "64"): BASE_URL + "2.7.13/python-2.7.13.amd64.msi",
- ("2.7", "32"): BASE_URL + "2.7.13/python-2.7.13.msi",
- ("3.4", "64"): BASE_URL + "3.4.4/python-3.4.4.amd64.msi",
- ("3.4", "32"): BASE_URL + "3.4.4/python-3.4.4.msi",
- ("3.5", "64"): BASE_URL + "3.5.4/python-3.5.4-amd64.exe",
- ("3.5", "32"): BASE_URL + "3.5.4/python-3.5.4.exe",
- ("3.6", "64"): BASE_URL + "3.6.2/python-3.6.2-amd64.exe",
- ("3.6", "32"): BASE_URL + "3.6.2/python-3.6.2.exe",
-}
-INSTALL_CMD = {
- # Commands are allowed to fail only if they are not the last command. Eg: uninstall (/x) allowed to fail.
- "2.7": [["msiexec.exe", "/L*+!", "install.log", "/qn", "/x", "{path}"],
- ["msiexec.exe", "/L*+!", "install.log", "/qn", "/i", "{path}", "TARGETDIR={home}"]],
- "3.4": [["msiexec.exe", "/L*+!", "install.log", "/qn", "/x", "{path}"],
- ["msiexec.exe", "/L*+!", "install.log", "/qn", "/i", "{path}", "TARGETDIR={home}"]],
- "3.5": [["{path}", "/quiet", "TargetDir={home}"]],
- "3.6": [["{path}", "/quiet", "TargetDir={home}"]],
-}
-
-
-def download_file(url, path):
- print("Downloading: {} (into {})".format(url, path))
- progress = [0, 0]
-
- def report(count, size, total):
- progress[0] = count * size
- if progress[0] - progress[1] > 1000000:
- progress[1] = progress[0]
- print("Downloaded {:,}/{:,} ...".format(progress[1], total))
-
- dest, _ = urlretrieve(url, path, reporthook=report)
- return dest
-
-
-def install_python(version, arch, home):
- print("Installing Python", version, "for", arch, "bit architecture to", home)
- if exists(home):
- return
-
- path = download_python(version, arch)
- print("Installing", path, "to", home)
- success = False
- for cmd in INSTALL_CMD[version]:
- cmd = [part.format(home=home, path=path) for part in cmd]
- print("Running:", " ".join(cmd))
- try:
- check_call(cmd)
- except Exception as exc:
- print("Failed command", cmd, "with:", exc)
- if exists("install.log"):
- with open("install.log") as fh:
- print(fh.read())
- else:
- success = True
- if success:
- print("Installation complete!")
- else:
- print("Installation failed")
-
-
-def download_python(version, arch):
- for _ in range(3):
- try:
- return download_file(URLS[version, arch], "installer.exe")
- except Exception as exc:
- print("Failed to download:", exc)
- print("Retrying ...")
-
-
-def install_pip(home):
- pip_path = home + "/Scripts/pip.exe"
- python_path = home + "/python.exe"
- if exists(pip_path):
- print("pip already installed.")
- else:
- print("Installing pip...")
- download_file(GET_PIP_URL, GET_PIP_PATH)
- print("Executing:", python_path, GET_PIP_PATH)
- check_call([python_path, GET_PIP_PATH])
-
-
-def install_packages(home, *packages):
- cmd = [home + "/Scripts/pip.exe", "install"]
- cmd.extend(packages)
- check_call(cmd)
-
-
-if __name__ == "__main__":
- install_python(environ['PYTHON_VERSION'], environ['PYTHON_ARCH'], environ['PYTHON_HOME'])
- install_pip(environ['PYTHON_HOME'])
- install_packages(environ['PYTHON_HOME'], "setuptools>=18.0.1", "wheel", "tox", "virtualenv>=13.1.0")
diff --git a/ci/appveyor-download.py b/ci/appveyor-download.py
index c6fb081..8373863 100755
--- a/ci/appveyor-download.py
+++ b/ci/appveyor-download.py
@@ -3,7 +3,7 @@
Use the AppVeyor API to download Windows artifacts.
Taken from: https://bitbucket.org/ned/coveragepy/src/tip/ci/download_appveyor.py
-# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
+# Licensed under the Apache License: https://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""
from __future__ import unicode_literals
diff --git a/ci/bootstrap.py b/ci/bootstrap.py
index e64a6c0..2597983 100755
--- a/ci/bootstrap.py
+++ b/ci/bootstrap.py
@@ -1,18 +1,26 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-from __future__ import absolute_import, print_function, unicode_literals
+from __future__ import absolute_import
+from __future__ import print_function
+from __future__ import unicode_literals
import os
+import subprocess
import sys
from os.path import abspath
from os.path import dirname
from os.path import exists
from os.path import join
+base_path = dirname(dirname(abspath(__file__)))
-if __name__ == "__main__":
- base_path = dirname(dirname(abspath(__file__)))
- print("Project path: {0}".format(base_path))
+
+def check_call(args):
+ print("+", *args)
+ subprocess.check_call(args)
+
+
+def exec_in_env():
env_path = join(base_path, ".tox", "bootstrap")
if sys.platform == "win32":
bin_path = join(env_path, "Scripts")
@@ -23,19 +31,26 @@ if __name__ == "__main__":
print("Making bootstrap env in: {0} ...".format(env_path))
try:
- subprocess.check_call(["virtualenv", env_path])
+ check_call([sys.executable, "-m", "venv", env_path])
except subprocess.CalledProcessError:
- subprocess.check_call([sys.executable, "-m", "virtualenv", env_path])
+ try:
+ check_call([sys.executable, "-m", "virtualenv", env_path])
+ except subprocess.CalledProcessError:
+ check_call(["virtualenv", env_path])
print("Installing `jinja2` into bootstrap environment...")
- subprocess.check_call([join(bin_path, "pip"), "install", "jinja2"])
+ check_call([join(bin_path, "pip"), "install", "jinja2", "tox"])
python_executable = join(bin_path, "python")
- if not os.path.samefile(python_executable, sys.executable):
- print("Re-executing with: {0}".format(python_executable))
- os.execv(python_executable, [python_executable, __file__])
+ if not os.path.exists(python_executable):
+ python_executable += '.exe'
+
+ print("Re-executing with: {0}".format(python_executable))
+ print("+ exec", python_executable, __file__, "--no-env")
+ os.execv(python_executable, [python_executable, __file__, "--no-env"])
+def main():
import jinja2
- import subprocess
+ print("Project path: {0}".format(base_path))
jinja = jinja2.Environment(
loader=jinja2.FileSystemLoader(join(base_path, "ci", "templates")),
@@ -46,13 +61,29 @@ if __name__ == "__main__":
tox_environments = [
line.strip()
- # WARNING: 'tox' must be installed globally or in the project's virtualenv
- for line in subprocess.check_output(['tox', '--listenvs'], universal_newlines=True).splitlines()
+ # 'tox' need not be installed globally, but must be importable
+ # by the Python that is running this script.
+ # This uses sys.executable the same way that the call in
+ # cookiecutter-pylibrary/hooks/post_gen_project.py
+ # invokes this bootstrap.py itself.
+ for line in subprocess.check_output([sys.executable, '-m', 'tox', '--listenvs'], universal_newlines=True).splitlines()
]
- tox_environments = [line for line in tox_environments if line not in ['clean', 'report', 'docs', 'check']]
+ tox_environments = [line for line in tox_environments if line.startswith('py')]
for name in os.listdir(join("ci", "templates")):
with open(join(base_path, name), "w") as fh:
fh.write(jinja.get_template(name).render(tox_environments=tox_environments))
print("Wrote {}".format(name))
print("DONE.")
+
+
+if __name__ == "__main__":
+ args = sys.argv[1:]
+ if args == ["--no-env"]:
+ main()
+ elif not args:
+ exec_in_env()
+ else:
+ print("Unexpected arguments {0}".format(args), file=sys.stderr)
+ sys.exit(1)
+
diff --git a/ci/requirements.txt b/ci/requirements.txt
new file mode 100644
index 0000000..1c8d385
--- /dev/null
+++ b/ci/requirements.txt
@@ -0,0 +1,3 @@
+virtualenv>=16.6.0
+pip>=19.1.1
+setuptools>=18.0.1
diff --git a/ci/templates/appveyor.yml b/ci/templates/.appveyor.yml
index 0006daa..bb4a055 100644
--- a/ci/templates/appveyor.yml
+++ b/ci/templates/.appveyor.yml
@@ -1,50 +1,48 @@
version: '{branch}-{build}'
build: off
-cache:
- - '%LOCALAPPDATA%\pip\Cache'
environment:
- global:
- WITH_COMPILER: 'cmd /E:ON /V:ON /C .\ci\appveyor-with-compiler.cmd'
matrix:
- TOXENV: check
TOXPYTHON: C:\Python36\python.exe
PYTHON_HOME: C:\Python36
PYTHON_VERSION: '3.6'
PYTHON_ARCH: '32'
-{% for env in tox_environments %}{{ '' }}{% if env.startswith(('py2', 'py3')) %}
- - TOXENV: '{{ env }},report,codecov'
+{% for env in tox_environments %}
+{% if env.startswith(('py2', 'py3')) %}
+ - TOXENV: {{ env }},codecov{{ "" }}
TOXPYTHON: C:\Python{{ env[2:4] }}\python.exe
PYTHON_HOME: C:\Python{{ env[2:4] }}
PYTHON_VERSION: '{{ env[2] }}.{{ env[3] }}'
PYTHON_ARCH: '32'
- - TOXENV: '{{ env }},report,codecov'
+{% if 'nocov' in env %}
+ WHEEL_PATH: .tox/dist
+{% endif %}
+ - TOXENV: {{ env }},codecov{{ "" }}
TOXPYTHON: C:\Python{{ env[2:4] }}-x64\python.exe
- {%- if env.startswith(('py2', 'py34')) %}
-
- WINDOWS_SDK_VERSION: v7.{{ '1' if env.startswith('py3') else '0' }}
- {%- endif %}
-
PYTHON_HOME: C:\Python{{ env[2:4] }}-x64
PYTHON_VERSION: '{{ env[2] }}.{{ env[3] }}'
PYTHON_ARCH: '64'
+{% if 'nocov' in env %}
+ WHEEL_PATH: .tox/dist
+{% endif %}
+{% if env.startswith('py2') %}
+ WINDOWS_SDK_VERSION: v7.0
+{% endif %}
{% endif %}{% endfor %}
init:
- ps: echo $env:TOXENV
- ps: ls C:\Python*
install:
- - python -u ci\appveyor-bootstrap.py
+ - '%PYTHON_HOME%\python -mpip install --progress-bar=off tox -rci/requirements.txt'
- '%PYTHON_HOME%\Scripts\virtualenv --version'
- '%PYTHON_HOME%\Scripts\easy_install --version'
- '%PYTHON_HOME%\Scripts\pip --version'
- '%PYTHON_HOME%\Scripts\tox --version'
test_script:
- - '%WITH_COMPILER% %PYTHON_HOME%\Scripts\tox'
-
+ - cmd /E:ON /V:ON /C .\ci\appveyor-with-compiler.cmd %PYTHON_HOME%\Scripts\tox
on_failure:
- ps: dir "env:"
- ps: get-content .tox\*\log\*
-artifacts:
- - path: dist\*
### To enable remote debugging uncomment this (also, see: http://www.appveyor.com/docs/how-to/rdp-to-build-worker):
# on_finish:
diff --git a/ci/templates/.travis.yml b/ci/templates/.travis.yml
index 63eec83..03110ef 100644
--- a/ci/templates/.travis.yml
+++ b/ci/templates/.travis.yml
@@ -1,5 +1,6 @@
language: python
dist: xenial
+cache: false
env:
global:
- LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so
@@ -13,22 +14,23 @@ matrix:
env:
- TOXENV=docs
{%- for env in tox_environments %}{{ '' }}
-{% if env.startswith("pypy3") %}
- - python: 'pypy3.5-6.0'
-{% elif env.startswith("pypy") %}
- - python: 'pypy2.7-6.0'
-{% else %}
- - python: '{{ "{0[2]}.{0[3]}".format(env) }}'
-{% endif %}
- env:
- - TOXENV={{ env }},report,coveralls,codecov
+ - env:
+ - TOXENV={{ env }},codecov
+{%- if env.startswith('pypy3') %}{{ '' }}
+ - TOXPYTHON=pypy3
+ python: 'pypy3'
+{%- elif env.startswith('pypy') %}{{ '' }}
+ python: 'pypy'
+{%- else %}{{ '' }}
+ python: '{{ '{0[2]}.{0[3]}'.format(env) }}'
+{%- endif %}
{%- endfor %}{{ '' }}
before_install:
- python --version
- uname -a
- - lsb_release -a
+ - lsb_release -a || true
install:
- - pip install tox
+ - python -mpip install --progress-bar=off tox -rci/requirements.txt
- virtualenv --version
- easy_install --version
- pip --version
diff --git a/debian/changelog b/debian/changelog
index 65f02b7..f55d9dd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+python-tblib (1.5.0-1) UNRELEASED; urgency=medium
+
+ * New upstream release.
+
+ -- Colin Watson <cjwatson@debian.org> Thu, 24 Oct 2019 13:40:43 +0100
+
python-tblib (1.4.0-2) unstable; urgency=medium
[ Ondřej Nový ]
diff --git a/docs/conf.py b/docs/conf.py
index 4e14afe..438c528 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -3,7 +3,6 @@ from __future__ import unicode_literals
import os
-
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
@@ -15,18 +14,13 @@ extensions = [
'sphinx.ext.todo',
'sphinx.ext.viewcode',
]
-if os.getenv('SPELLCHECK'):
- extensions += 'sphinxcontrib.spelling',
- spelling_show_suggestions = True
- spelling_lang = 'en_US'
-
source_suffix = '.rst'
master_doc = 'index'
project = 'tblib'
year = '2013-2019'
author = 'Ionel Cristian Mărieș'
copyright = '{0}, {1}'.format(year, author)
-version = release = '1.4.0'
+version = release = '1.5.0'
pygments_style = 'trac'
templates_path = ['.']
diff --git a/docs/requirements.txt b/docs/requirements.txt
index ef4a013..62bc14e 100644
--- a/docs/requirements.txt
+++ b/docs/requirements.txt
@@ -1,3 +1,2 @@
sphinx>=1.3
sphinx-py3doc-enhanced-theme
--e .
diff --git a/setup.cfg b/setup.cfg
index b2b4bfa..9780078 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -23,7 +23,7 @@ addopts =
--doctest-glob=\*.rst
--tb=short
-[isort]
+[tool:isort]
force_single_line = True
line_length = 120
known_first_party = tblib
diff --git a/setup.py b/setup.py
index d6f2fb2..467a486 100644
--- a/setup.py
+++ b/setup.py
@@ -25,8 +25,8 @@ def read(*names, **kwargs):
setup(
name='tblib',
- version='1.4.0',
- license='BSD 2-Clause License',
+ version='1.5.0',
+ license='BSD-2-Clause',
description='Traceback serialization library.',
long_description='%s\n%s' % (
re.compile('^.. start-badges.*^.. end-badges', re.M | re.S).sub('', read('README.rst')),
@@ -51,10 +51,10 @@ setup(
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
# uncomment if you test on these interpreters:
@@ -71,7 +71,7 @@ setup(
keywords=[
'traceback', 'debugging', 'exceptions',
],
- python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
+ python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*',
install_requires=[
# eg: 'aspectlib==1.1.1', 'six>=1.7',
],
diff --git a/src/tblib.egg-info/PKG-INFO b/src/tblib.egg-info/PKG-INFO
index e7e6fc9..672d955 100644
--- a/src/tblib.egg-info/PKG-INFO
+++ b/src/tblib.egg-info/PKG-INFO
@@ -1,11 +1,11 @@
Metadata-Version: 1.2
Name: tblib
-Version: 1.4.0
+Version: 1.5.0
Summary: Traceback serialization library.
Home-page: https://github.com/ionelmc/python-tblib
Author: Ionel Cristian Mărieș
Author-email: contact@ionelmc.ro
-License: BSD 2-Clause License
+License: BSD-2-Clause
Project-URL: Documentation, https://python-tblib.readthedocs.io/
Project-URL: Changelog, https://python-tblib.readthedocs.io/en/latest/changelog.html
Project-URL: Issue Tracker, https://github.com/ionelmc/python-tblib/issues
@@ -506,11 +506,14 @@ Description: ========
>>> def local_0():
... pool = Pool()
- ... for i in pool.map(apply_with_return_error, zip(repeat(func_a), range(5))):
- ... if isinstance(i, Error):
- ... i.reraise()
- ... else:
- ... print(i)
+ ... try:
+ ... for i in pool.map(apply_with_return_error, zip(repeat(func_a), range(5))):
+ ... if isinstance(i, Error):
+ ... i.reraise()
+ ... else:
+ ... print(i)
+ ... finally:
+ ... pool.close()
...
>>> def local_1():
... local_0()
@@ -529,7 +532,7 @@ Description: ========
local_1()
File "<doctest README.rst[...]>", line 2, in local_1
local_0()
- File "<doctest README.rst[...]>", line 5, in local_0
+ File "<doctest README.rst[...]>", line 6, in local_0
i.reraise()
File "...tblib...decorators.py", line 20, in reraise
reraise(self.exc_type, self.exc_value, self.traceback)
@@ -578,10 +581,18 @@ Description: ========
Changelog
=========
+ 1.5.0 (2019-10-23)
+ ~~~~~~~~~~~~~~~~~~
+
+ * Added support for Python 3.8. Contributed by Victor Stinner in
+ `#42 <HTTPS://GITHUB.COM/IONELMC/PYTHON-TBLIB/ISSUES/42>`_.
+ * Removed support for end of life Python 3.4.
+ * Few CI improvements and fixes.
+
1.4.0 (2019-05-02)
~~~~~~~~~~~~~~~~~~
- * Remove support for end of life Python 3.3.
+ * Removed support for end of life Python 3.3.
* Fixed tests for Python 3.7. Contributed by Elliott Sales de Andrade in
`#36 <https://github.com/ionelmc/python-tblib/issues/36>`_.
* Fixed compatibility issue with Twised (``twisted.python.failure.Failure`` expected a ``co_code`` attribute).
@@ -634,11 +645,11 @@ Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Utilities
-Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
+Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
diff --git a/src/tblib.egg-info/SOURCES.txt b/src/tblib.egg-info/SOURCES.txt
index 721e0c7..1bc1caa 100644
--- a/src/tblib.egg-info/SOURCES.txt
+++ b/src/tblib.egg-info/SOURCES.txt
@@ -1,7 +1,9 @@
+.appveyor.yml
.bumpversion.cfg
.cookiecutterrc
.coveragerc
.editorconfig
+.gitignore
.travis.yml
AUTHORS.rst
CHANGELOG.rst
@@ -9,16 +11,15 @@ CONTRIBUTING.rst
LICENSE
MANIFEST.in
README.rst
-appveyor.yml
setup.cfg
setup.py
tox.ini
-ci/appveyor-bootstrap.py
ci/appveyor-download.py
ci/appveyor-with-compiler.cmd
ci/bootstrap.py
+ci/requirements.txt
+ci/templates/.appveyor.yml
ci/templates/.travis.yml
-ci/templates/appveyor.yml
docs/authors.rst
docs/changelog.rst
docs/conf.py
diff --git a/src/tblib/__init__.py b/src/tblib/__init__.py
index 86dd677..db17dd8 100644
--- a/src/tblib/__init__.py
+++ b/src/tblib/__init__.py
@@ -15,7 +15,7 @@ except ImportError:
if not tb_set_next and not tproxy:
raise ImportError("Cannot use tblib. Runtime not supported.")
-__version__ = '1.4.0'
+__version__ = '1.5.0'
__all__ = 'Traceback',
PY3 = sys.version_info[0] == 3
@@ -95,7 +95,12 @@ class Traceback(object):
while current:
f_code = current.tb_frame.f_code
code = compile('\n' * (current.tb_lineno - 1) + 'raise __traceback_maker', current.tb_frame.f_code.co_filename, 'exec')
- if PY3:
+ if hasattr(code, "replace"):
+ # Python 3.8 and newer
+ code = code.replace(co_argcount=0,
+ co_filename=f_code.co_filename, co_name=f_code.co_name,
+ co_freevars=(), co_cellvars=())
+ elif PY3:
code = CodeType(
0, code.co_kwonlyargcount,
code.co_nlocals, code.co_stacksize, code.co_flags,
diff --git a/tests/test_issue30.py b/tests/test_issue30.py
index 6974ff1..270f146 100644
--- a/tests/test_issue30.py
+++ b/tests/test_issue30.py
@@ -1,13 +1,17 @@
import pickle
import sys
+import pytest
import six
-from twisted.python.failure import Failure
-from tblib import pickling_support
+from tblib import pickling_support # noqa: E402
+
+pytest.importorskip('twisted')
def test_30():
+ from twisted.python.failure import Failure
+
pickling_support.install()
try:
diff --git a/tox.ini b/tox.ini
index fba49d1..95b3075 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,3 +1,13 @@
+[testenv:bootstrap]
+deps =
+ jinja2
+ matrix
+ tox
+skip_install = true
+commands =
+ python ci/bootstrap.py --no-env
+passenv =
+ *
; a generative tox configuration, see: https://tox.readthedocs.io/en/latest/config.html#generative-envlist
[tox]
@@ -5,19 +15,20 @@ envlist =
clean,
check,
docs,
- {py27,py34,py35,py36,py37,pypy,pypy3},
+ {py27,py35,py36,py37,py38,pypy,pypy3},
report
+ignore_basepython_conflict = true
[testenv]
basepython =
pypy: {env:TOXPYTHON:pypy}
pypy3: {env:TOXPYTHON:pypy3}
py27: {env:TOXPYTHON:python2.7}
- py34: {env:TOXPYTHON:python3.4}
py35: {env:TOXPYTHON:python3.5}
- {py36,docs,spell}: {env:TOXPYTHON:python3.6}
+ {py36,docs}: {env:TOXPYTHON:python3.6}
py37: {env:TOXPYTHON:python3.7}
- {bootstrap,clean,check,report,codecov,coveralls}: {env:TOXPYTHON:python3}
+ py38: {env:TOXPYTHON:python3.8}
+ {bootstrap,clean,check,report,codecov}: {env:TOXPYTHON:python3}
setenv =
PYTHONPATH={toxinidir}/tests
PYTHONUNBUFFERED=yes
@@ -29,18 +40,10 @@ deps =
pytest-travis-fold
pytest-cov
six
- twisted
+ py{27,35,36,37,38,py,py3}: twisted
commands =
{posargs:py.test --cov=tblib --cov-report=term-missing -vv tests README.rst}
-[testenv:bootstrap]
-deps =
- jinja2
- matrix
-skip_install = true
-commands =
- python ci/bootstrap.py
-
[testenv:check]
deps =
docutils
@@ -56,37 +59,19 @@ commands =
flake8 src tests setup.py
isort --verbose --check-only --diff --recursive src tests setup.py
-[testenv:spell]
-setenv =
- SPELLCHECK=1
-commands =
- sphinx-build -b spelling docs dist/docs
-skip_install = true
-deps =
- -r{toxinidir}/docs/requirements.txt
- sphinxcontrib-spelling
- pyenchant
-
[testenv:docs]
+usedevelop = true
deps =
-r{toxinidir}/docs/requirements.txt
commands =
sphinx-build {posargs:-E} -b html docs dist/docs
sphinx-build -b linkcheck docs dist/docs
-[testenv:coveralls]
-deps =
- coveralls
-skip_install = true
-commands =
- coveralls []
-
[testenv:codecov]
deps =
codecov
skip_install = true
commands =
- coverage xml --ignore-errors
codecov []
[testenv:report]