briangoins opened a new pull request, #4584:
URL: https://github.com/apache/cassandra/pull/4584
Fixes macOS compatibility for `cqlsh HELP` command by bundling `CQL.html` as
a Python package resource. This is meant to be a second attempt of the approach
in #2592.
On macOS, `/usr/share` is not writable, and `/usr/local/share` is the
preferred location instead. This PR:
- adds `/usr/local/share` path as a fallback for macOS, and
- bundles the documentation as a Python package resource, allowing it to
work regardless of installation method
## Changes
- `pylib/cqlshlib/resources/__init__.py`: New subpackage for bundled
resources
- `pylib/setup.py`: Added `package_data` to include CQL.html/CSS
- `pylib/cqlshlib/cqlshmain.py`: Updated `get_docspath()` with updated
retrieval logic/priority of docs path (ordered by priority):
- Local dev/tarball path
- Linux package path (`/usr/share/doc/cassandra/`)
- macOS path (`/usr/local/share/doc/cassandra/`)
- Bundled package resource via `importlib.resources`
- Online documentation URL (fallback) *[Note: the current default CQLDOCS
URL 404s]*
- `build.xml`: Added target to copy CQL docs to pylib during build
- `.gitignore`: Ignore generated resource files
- `pylib/cqlshlib/test/test_docspath.py`: Unit tests for the new
functionality
## Testing
- Unit tests pass
- `ant build` creates `pylib/cqlshlib/resources/CQL.{html,css}`
- `bin/cqlsh -e "HELP select”` opens appropiate path given different install
locations of `CQL.{html,css}`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]