- version-not-tagged
actions:
- run: "sudo pip install -e .[build]"
- - run: "sudo python setup.py sdist bdist_wheel"
- run: "twine upload -u carthorse-mock -p $PYPI_PASS dist/*"
- create-tag
version: 2.1
orbs:
- python: cjw296/python-ci@1.3
+ python: cjw296/python-ci@2
jobs:
- docs:
+ check-package:
+ parameters:
+ image:
+ type: string
+ python:
+ type: string
+ default: "python"
docker:
- - image: circleci/python:3.7
+ - image: << parameters.image >>
steps:
- - checkout
- - run:
- name: "Install Project"
- command: "sudo pip install -e .[docs]"
- - run:
- name: "Build Docs"
- command: |
- python setup.py build_sphinx
- rst2html.py --strict README.rst README.html
+ - python/check-package:
+ package: "mock"
+ test:
+ - run:
+ name: "Import package"
+ command: << parameters.python >> -c "import mock"
common: &common
- python/pip-run-tests:
name: pypy27
image: pypy:2.7
- sudo: false
- python/pip-run-tests:
name: pypy36
image: pypy:3.6
- sudo: false
- python/coverage:
name: coverage
- pypy27
- pypy36
- - docs:
+ - python/pip-docs:
+ name: docs
requires:
- coverage
- - python/release:
- name: release
- config: .carthorse.yml
+ - python/pip-setuptools-build-package:
+ name: package
requires:
- docs
filters:
branches:
only: master
+ - check-package:
+ name: check-package-python27
+ image: circleci/python:2.7
+ requires:
+ - package
+
+ - check-package:
+ name: check-package-python37
+ image: circleci/python:3.7
+ requires:
+ - package
+
+ - check-package:
+ name: check-package-pypy27
+ image: pypy:2.7
+ python: pypy
+ requires:
+ - package
+
+ - check-package:
+ name: check-package-pypy36
+ image: pypy:3.6
+ python: pypy3
+ requires:
+ - package
+
+ - python/release:
+ name: release
+ config: .carthorse.yml
+ requires:
+ - check-package-python27
+ - check-package-python37
+ - check-package-pypy27
+ - check-package-pypy36
+
workflows:
push:
<<: *common
-3.0.2
+3.0.4
+-----
+
+- Include the license, readme and changelog in the source distribution.
+
+3.0.3
-----
+- Fixed patching of dictionaries, when specifying the target with a
+ unicode on Python 2.
+3.0.2
+-----
- Add missing ``funcsigs`` dependency on Python 2.
--- /dev/null
+include LICENSE.txt
+include *.rst
-Changelog from Python's News
-============================
+Changelog
+=========
.. include:: ../CHANGELOG.rst
.. index:: python changes
-Python Changes
-++++++++++++++
+Changelog
++++++++++
See the :doc:`change log <changelog>`.
place in cPython, the backport process is as lightweight as we can make it.
mock is CI tested using Travis-CI on Python versions 2.7, 3.4,
-3.5, 3.6, nightly Python 3 builds, pypy, pypy3.
+3.5, 3.6, pypy, pypy3.
+
+If you end up fixing anything backport-specific, please add an entry
+to the top of ``CHANGELOG.rst`` so it shows up in the next release
+notes.
Releasing
---------
import six
from six import wraps
-__version__ = '3.0.2'
+__version__ = '3.0.4'
version_info = tuple(int(p) for p in __version__.split('.'))
import mock
def _patch_dict(self):
values = self.values
- if isinstance(self.in_dict, str):
+ if isinstance(self.in_dict, basestring):
self.in_dict = _importer(self.in_dict)
in_dict = self.in_dict
clear = self.clear
test()
+ def test_patch_dict_with_unicode(self):
+ @patch.dict(u'os.environ', {'konrad_delong': 'some value'})
+ def test():
+ self.assertIn('konrad_delong', os.environ)
+
+ test()
+
+
def test_patch_dict_decorator_resolution(self):
# bpo-35512: Ensure that patch with a string target resolves to
# the new dictionary during function call