Skip to content

Commit

Permalink
Merge Python3 compatibility and major release 1 changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
nehpetsde committed Jun 6, 2019
2 parents a8c7b1b + 86cc728 commit a8023ba
Show file tree
Hide file tree
Showing 104 changed files with 2,917 additions and 6,787 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ __pycache__/
docs/_build/
htmlcov
dist
python-2
python-3
venv/
.idea/
.env/
.env/
20 changes: 14 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
dist: xenial
sudo: false

cache:
directories:
- $HOME/.cache/pip
Expand All @@ -9,16 +11,22 @@ language: python
matrix:
include:
- python: "2.7"
env: TOXENV=py27
env: TOXENV=py2
- python: "3.5"
env: TOXENV=py3
- python: "3.6"
env: TOXENV=py3
- python: "3.7"
env: TOXENV=py3

# Meta
- python: "2.7"
- python: "3.7"
env: TOXENV=flake8
- python: "2.7"
- python: "3.7"
env: TOXENV=manifest
# - python: "2.7"
# env: TOXENV=docs
- python: "2.7"
- python: "3.7"
env: TOXENV=docs
- python: "3.7"
env: TOXENV=readme


Expand Down
37 changes: 37 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,43 @@
Changelog for nfcpy
===================

1.0.0 (2019-06-06)
------------------

This is a major major release that brings Python3 compatibility but
also API changes that may break existing applications. Many thanks to
@mofe23 and @msnoigrs for their Python3 compatibility patches.

* The `nfc.ndef` package is removed. All NDEF decoding and encoding
now uses the https://github.com/nfcpy/ndeflib library.

* The `nfc.snep.SnepClient.put` is removed. Application code must use
either `put_records` or `put_octets`.

* The `nfc.snep.SnepClient.get` is removed. Application code must use
either `get_records` or `get_octets`.

* The `nfc.snep.SnepServer.put` method changed to `process_put_request`
and receives the ndef_message as a list of `ndef.Record` objects.

* The `nfc.snep.SnepServer.get` method changed to `process_get_request`
and receives the ndef_message as a list of `ndef.Record` objects.
The `acceptable_length` parameter is now handled by the SnepServer.

* The `nfc.handover.HandoverClient.send` method has changed to
`send_records` and expects a list of `ndef.Record` objects. The new
`send_octets` method allows to send a pre-encoded handover message.

* The `nfc.handover.HandoverClient.recv` method has changed to
`recv_records` and returns a list of `ndef.Record` objects. The new
`recv_octets` method returns the received encoded handover message.

* The `nfc.tag.Tag.NDEF.message` is removed. Application code must use
`records` or `octets`.

* The `examples/ndeftool.py` script is removed. Similar functionality
is provided by the https://github.com/nfcpy/ndeftool application.

0.13.6 (2019-06-05)
-------------------

Expand Down
14 changes: 12 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# -*- coding: latin-1 -*-
#
# nfcpy documentation build configuration file
#
Expand Down Expand Up @@ -74,7 +74,10 @@ def find_meta(meta):
'ndeflib': ('https://ndeflib.readthedocs.io/en/stable', None),
}
autodoc_member_order = 'bysource'
autodoc_default_flags = ['members', 'show-inheritance']
autodoc_default_options = {
'members': True,
'show-inheritance': True,
}

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down Expand Up @@ -154,7 +157,14 @@ def find_meta(meta):
import nfc
import sys
import mock
sys.modules['usb1'] = mock.Mock('usb1')
# Needed to fix udp doctests in getting started example when run on another
# platform. If not patched, doctest fails on osx or windows.
m = mock.Mock('platform')
m.uname = mock.Mock(return_value=('Linux', 'kali', '3.10.0-693.21.1.el7.x86_64', '#1 SMP Wed Mar 7 19:03:37 UTC 2018', 'x86_64', 'x86_64'))
sys.modules['platform'] = m
"""


Expand Down
4 changes: 3 additions & 1 deletion docs/examples/beam.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,11 @@ explicitly set with the options ``-t`` and ``-n``, respectively. ::

.. option:: -t STRING

Set the record type. See :doc:`/topics/ndef` for how to specify record
Set the record type. See the `ndeflib`_ for how to specify record
types in *nfcpy*.

.. _ndeflib: https://ndeflib.readthedocs.io/en/stable/ndef.html#record-class

.. option:: -n STRING

Set the record name (identifier).
Expand Down
4 changes: 0 additions & 4 deletions docs/examples/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ Example Programs
:doc:`tagtool`
Read or write or format tags for NDEF use.

:doc:`ndeftool`
Generate or inspect or reorganize NDEF data.

:doc:`beam`
Exchange NDEF data with a smartphone.

Expand All @@ -23,7 +20,6 @@ Example Programs
:hidden:

tagtool
ndeftool
beam
sense
listen
Expand Down

0 comments on commit a8023ba

Please sign in to comment.