diff --git a/.travis.yml b/.travis.yml index b45e17d95..bcd18033a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -88,6 +88,8 @@ jobs: - stage: deploy name: "PyPi Deployment" python: "3.7" + before_install: + - travis_retry pip install -U wheel setuptools deploy: provider: pypi user: hardbyte diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 2f50dca8d..8d15e2170 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,13 @@ -Version 3.2.0 +Version 3.3.0 ==== +* Adding CAN FD 64 frame support to blf reader +* Updates to installation instructions +* Clean up bits generator in PCAN interface #588 +* Minor fix to use latest tools when building wheels on travis. + +Version 3.2.0 +==== Major features -------------- diff --git a/can/__init__.py b/can/__init__.py index a612363ae..10245b220 100644 --- a/can/__init__.py +++ b/can/__init__.py @@ -8,7 +8,7 @@ import logging -__version__ = "3.2.0" +__version__ = "3.3.0" log = logging.getLogger('can') diff --git a/can/interfaces/pcan/pcan.py b/can/interfaces/pcan/pcan.py index e3d70eadf..864308bab 100644 --- a/can/interfaces/pcan/pcan.py +++ b/can/interfaces/pcan/pcan.py @@ -216,11 +216,17 @@ def _get_formatted_error(self, error): """ def bits(n): - """TODO: document""" + """ + Iterate over all the set bits in `n`, returning the masked bits at + the set indices + """ while n: - b = n & (~n+1) - yield b - n ^= b + # Create a mask to mask the lowest set bit in n + mask = (~n + 1) + masked_value = n & mask + yield masked_value + # Toggle the lowest set bit + n ^= masked_value stsReturn = self.m_objPCANBasic.GetErrorText(error, 0) if stsReturn[0] != PCAN_ERROR_OK: diff --git a/can/io/blf.py b/can/io/blf.py index 059da5ec9..d162fdebc 100644 --- a/can/io/blf.py +++ b/can/io/blf.py @@ -66,6 +66,13 @@ class BLFParseError(Exception): # valid data bytes, data CAN_FD_MSG_STRUCT = struct.Struct("`__. @@ -84,8 +86,9 @@ Creating a new Release - For larger changes update ``doc/history.rst``. - Sanity check that documentation has stayed inline with code. - Create a temporary virtual environment. Run ``python setup.py install`` and ``python setup.py test``. +- Ensure the ``setuptools`` and ``wheel`` tools are up to date: ``pip install -U setuptools wheel``. - Create and upload the distribution: ``python setup.py sdist bdist_wheel``. -- Sign the packages with gpg ``gpg --detach-sign -a dist/python_can-X.Y.Z-py3-none-any.whl``. +- [Optionally] Sign the packages with gpg ``gpg --detach-sign -a dist/python_can-X.Y.Z-py3-none-any.whl``. - Upload with twine ``twine upload dist/python-can-X.Y.Z*``. - In a new virtual env check that the package can be installed with pip: ``pip install python-can==X.Y.Z``. - Create a new tag in the repository. diff --git a/doc/installation.rst b/doc/installation.rst index add0f5cec..147b27b74 100644 --- a/doc/installation.rst +++ b/doc/installation.rst @@ -50,7 +50,7 @@ available, the times are returned as number of seconds from system startup. To install the uptime library, run ``pip install uptime``. This library can take advantage of the `Python for Windows Extensions -`__ library if installed. +`__ library if installed. It will be used to get notified of new messages instead of the CPU intensive polling that will otherwise have be used. @@ -83,7 +83,7 @@ Installing python-can in development mode ----------------------------------------- A "development" install of this package allows you to make changes locally -or pull updates from the Mercurial repository and use them without having to +or pull updates from the Git repository and use them without having to reinstall. Download or clone the source repository then: ::