Skip to content

Conversation

@rob-smallshire
Copy link
Collaborator

It doesn't look like namespace packages are going to work with pySerial. :-(

This is because pySerial exports names from its root package serial.__init__.py which is not permitted in namespace packages.

This change simply makes the pyserial-asyncio distribution into a separate, regular package which depends on pyserial. It uses a distinct top-level package name of serial_asyncio following a broadly used convention for extension package naming.

I'll put together a companion pull request for core pyserial to remove the namespace packaging from there too.

The core serial module exports names, such as serial_for_url, which interferes with the Python's namespace package mechanism. Unfortunately, this means we can't use namespace packages without severely breaking compatibility with existing pyserial clients. We need to take an alternative approach of making pyserial-asyncio provide its functionality as a regular package alongside pyserial.

I've followed a common convention of naming the package pyserial_asyncio.
This allows tests to be run with

  python -m test.test_asyncio <port>

without running into conflicts with Python's built-in unit tests which also have a test.test_asyncio with runs the Python Standard Library tests.
This allows tests to be run with

  python -m test.test_asyncio <port>

without running into conflicts with Python's built-in unit tests which also have a test.test_asyncio with runs the Python Standard Library tests.
@rob-smallshire
Copy link
Collaborator Author

Note that the Travis build still fails, but now with a serial timeout error rather than an import error, so progress of a sort.

@zsquareplusc zsquareplusc merged commit 81cfab4 into master Jun 16, 2016
@rob-smallshire rob-smallshire deleted the regular_package branch June 16, 2016 13:08
mvn23 pushed a commit to mvn23/pyserial-asyncio that referenced this pull request Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants