Skip to content

Commit

Permalink
Fixing CI issues (#9)
Browse files Browse the repository at this point in the history
* Pin websockets to v13 until I can properly migrate in a minor version

* Pin pylint script websockets to 13

* fixed mkdocs fn signatures

* Removed unused imports

* Updated the readme for v0.2.1
  • Loading branch information
EddyLuten authored Dec 15, 2024
1 parent ee88eb8 commit fc18fbf
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint mkdocs websockets
pip install pylint mkdocs websockets==13
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py')
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ A similar mechanism is in place for other operations like renaming and deleting.

## Changelog

### 0.2.1

**Bug fix:** fixes a compatibility issue reported in [#5](https://github.com/EddyLuten/mkdocs-live-edit-plugin/issues/5). This version also pins the websocket dependency to version 13 for the time being since upgrading would be an undertaking outside the scope of a small patch.

### 0.2.0

**New Feature:** Creating pages. The plugin now exposes a button that allows you to create a brand new page from any other page.
Expand Down
11 changes: 6 additions & 5 deletions live/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import threading
from logging import Logger, getLogger
from pathlib import Path
from typing import Any, Callable, Literal, Optional
from typing import Literal, Optional

import websockets.client
import websockets.server
Expand Down Expand Up @@ -275,7 +275,7 @@ def server_thread_main(self):
def on_startup(self, *, command: Literal['build', 'gh-deploy', 'serve'], dirty: bool) -> None:
self.is_serving = command == 'serve'

def on_pre_page(self, page: Page, *, config: MkDocsConfig, files: Files) -> Page | None:
def on_pre_page(self, page: Page, /, *, config: MkDocsConfig, files: Files) -> Page | None:
"""Here we try to discern the new URL of a page that was just created."""
if self.new_page["created_file"] is None or (self.new_page["new_url"] is not None):
return page
Expand All @@ -300,9 +300,10 @@ def error_handler(self, server: LiveReloadServer, code: int) -> bytes | None:
def on_serve(
self,
server: LiveReloadServer,
/,
*,
config: MkDocsConfig,
builder: Callable[..., Any]
**_
) -> LiveReloadServer | None:
"""Starts the websocket server thread."""
self.log.info('live-edit websocket server starting')
Expand All @@ -320,10 +321,10 @@ def on_serve(
def on_page_content(
self,
html: str,
/,
*,
page: Page,
config: MkDocsConfig,
files: Files
**_
) -> str | None:
"""Injects the live-edit script into the page."""
if not self.is_serving:
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name='mkdocs-live-edit-plugin',
version='0.2.0',
version='0.2.1',
description='An MkDocs plugin that allows editing pages directly from the browser.',
long_description=long_description,
long_description_content_type='text/markdown',
Expand All @@ -19,7 +19,7 @@
python_requires='>=3.10',
install_requires=[
'mkdocs',
'websockets',
'websockets>=13,<14',
],
classifiers=[
'License :: OSI Approved :: MIT License',
Expand Down

0 comments on commit fc18fbf

Please sign in to comment.