Skip to content

Commit

Permalink
Change ypy-websocket to pycrdt-websocket
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart committed Dec 8, 2023
1 parent 4caf8aa commit ceeb014
Show file tree
Hide file tree
Showing 31 changed files with 49 additions and 51 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ jobs:
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: environment-dev.yml
environment-name: ypy-websocket
environment-name: pycrdt-websocket
extra-specs: python=${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install .[test]
cd tests; npm install
- name: Check types
run: |
mypy ypy_websocket tests
mypy pycrdt_websocket tests
- name: Run tests
run: |
pytest -v
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Ypy-websocket
# Pycrdt-websocket

Ypy-websocket is an async WebSocket connector for Ypy.
Pycrdt-websocket is an async WebSocket connector for pycrdt.

[![Build Status](https://github.com/y-crdt/ypy-websocket/workflows/CI/badge.svg)](https://github.com/y-crdt/ypy-websocket/actions)
[![Build Status](https://github.com/davidbrochart/pycrdt-websocket/workflows/CI/badge.svg)](https://github.com/davidbrochart/pycrdt-websocket/actions)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

---

**Documentation**: <a href="https://davidbrochart.github.io/ypy-websocket" target="_blank">https://davidbrochart.github.io/ypy-websocket</a>
**Documentation**: <a href="https://davidbrochart.github.io/pycrdt-websocket" target="_blank">https://davidbrochart.github.io/pycrdt-websocket</a>

**Source Code**: <a href="https://github.com/y-crdt/ypy-websocket" target="_blank">https://github.com/y-crdt/ypy-websocket</a>
**Source Code**: <a href="https://github.com/davidbrochart/pycrdt-websocket" target="_blank">https://github.com/davidbrochart/pycrdt-websocket</a>

---

Ypy-websocket is a Python library for building WebSocket servers and clients that connect and synchronize shared documents.
Pycrdt-websocket is a Python library for building WebSocket servers and clients that connect and synchronize shared documents.
It can be used to create collaborative web applications.

The following diagram illustrates a typical architecture. The goal is to share a document among several clients.
Expand Down
2 changes: 1 addition & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Making a ypy-websocket release
# Making a pycrdt-websocket release

## Using `jupyter_releaser`

Expand Down
6 changes: 3 additions & 3 deletions docs/install.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Ypy-websocket can be installed from [PyPI](https://pypi.org) using `pip` or from [conda-forge](https://conda-forge.org) using `micromamba`.
Pycrdt-websocket can be installed from [PyPI](https://pypi.org) using `pip` or from [conda-forge](https://conda-forge.org) using `micromamba`.

## With `pip`

```console
pip install ypy-websocket
pip install pycrdt-websocket
```

## With `micromamba`

```console
micromamba install -c conda-forge ypy-websocket
micromamba install -c conda-forge pycrdt-websocket
```
2 changes: 1 addition & 1 deletion docs/reference/ASGI_server.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
::: ypy_websocket.asgi_server.ASGIServer
::: pycrdt_websocket.asgi_server.ASGIServer
2 changes: 1 addition & 1 deletion docs/reference/Django_Channels_consumer.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
::: ypy_websocket.django_channels_consumer.YjsConsumer
::: pycrdt_websocket.django_channels_consumer.YjsConsumer
2 changes: 1 addition & 1 deletion docs/reference/Room.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
::: ypy_websocket.yroom.YRoom
::: pycrdt_websocket.yroom.YRoom
8 changes: 4 additions & 4 deletions docs/reference/Store.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
## BaseYStore

::: ypy_websocket.ystore.BaseYStore
::: pycrdt_websocket.ystore.BaseYStore

## FileYStore

::: ypy_websocket.ystore.FileYStore
::: pycrdt_websocket.ystore.FileYStore

## TempFileYStore

::: ypy_websocket.ystore.TempFileYStore
::: pycrdt_websocket.ystore.TempFileYStore

## SQLiteYStore

::: ypy_websocket.ystore.SQLiteYStore
::: pycrdt_websocket.ystore.SQLiteYStore
2 changes: 1 addition & 1 deletion docs/reference/WebSocket.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
::: ypy_websocket.websocket.Websocket
::: pycrdt_websocket.websocket.Websocket
2 changes: 1 addition & 1 deletion docs/reference/WebSocket_provider.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
::: ypy_websocket.websocket_provider.WebsocketProvider
::: pycrdt_websocket.websocket_provider.WebsocketProvider
2 changes: 1 addition & 1 deletion docs/reference/WebSocket_server.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
::: ypy_websocket.websocket_server.WebsocketServer
::: pycrdt_websocket.websocket_server.WebsocketServer
2 changes: 1 addition & 1 deletion docs/usage/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Here is a code example using the [websockets](https://websockets.readthedocs.io)
import asyncio
import y_py as Y
from websockets import connect
from ypy_websocket import WebsocketProvider
from pycrdt_websocket import WebsocketProvider

async def client():
ydoc = Y.YDoc()
Expand Down
6 changes: 3 additions & 3 deletions docs/usage/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Here is a code example using the [websockets](https://websockets.readthedocs.io)
```py
import asyncio
from websockets import serve
from ypy_websocket import WebsocketServer
from pycrdt_websocket import WebsocketServer

async def server():
async with (
Expand All @@ -15,12 +15,12 @@ async def server():

asyncio.run(server())
```
Ypy-websocket can also be used with an [ASGI](https://asgi.readthedocs.io) server. Here is a code example using [Uvicorn](https://www.uvicorn.org):
Pycrdt-websocket can also be used with an [ASGI](https://asgi.readthedocs.io) server. Here is a code example using [Uvicorn](https://www.uvicorn.org):
```py
# main.py
import asyncio
import uvicorn
from ypy_websocket import ASGIServer, WebsocketServer
from pycrdt_websocket import ASGIServer, WebsocketServer

websocket_server = WebsocketServer()
app = ASGIServer(websocket_server)
Expand Down
2 changes: 1 addition & 1 deletion environment-dev.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ypy-websocket
name: pycrdt-websocket
channels:
- conda-forge
dependencies:
Expand Down
6 changes: 3 additions & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
site_name: ypy-websocket
site_description: Async WebSocket connector for Ypy
repo_url: https://github.com/y-crdt/ypy-websocket
site_name: pycrdt-websocket
site_description: Async WebSocket connector for pycrdt
repo_url: https://github.com/davidbrochart/pycrdt-websocket

theme:
name: 'material'
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ class YjsConsumer(AsyncWebsocketConsumer):
from pycrdt import Doc
from asgiref.sync import async_to_sync
from channels.layers import get_channel_layer
from ypy_websocket.django_channels_consumer import YjsConsumer
from ypy_websocket.yutils import create_update_message
from pycrdt_websocket.django_channels_consumer import YjsConsumer
from pycrdt_websocket.yutils import create_update_message
class DocConsumer(YjsConsumer):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion ypy_websocket/yutils.py → pycrdt_websocket/yutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ async def process_sync_message(message: bytes, ydoc: Doc, websocket, log) -> Non
YSyncMessageType.SYNC_UPDATE,
):
update = read_message(msg)
# Ignore empty updates (see https://github.com/y-crdt/ypy/issues/98)
if update != b"\x00\x00":
ydoc.apply_update(update)

Expand Down
23 changes: 11 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "ypy-websocket"
name = "pycrdt-websocket"
dynamic = ["version"]
description = "WebSocket connector for Ypy"
description = "WebSocket connector for pycrdt"
license = { file = "LICENSE" }
readme = "README.md"
requires-python = ">=3.7"
requires-python = ">=3.8"
authors = [
{ name = "David Brochart", email = "[email protected]" },
]
Expand All @@ -21,17 +21,16 @@ classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = [
"anyio >=3.6.2,<5",
"aiosqlite >=0.18.0,<1",
"pycrdt >=0.4.1,<0.5.0",
"typing_extensions; python_version < '3.8'",
"pycrdt >=0.7.0,<0.8.0",
]

[project.optional-dependencies]
Expand All @@ -53,17 +52,17 @@ django = [
]

[project.urls]
Homepage = "https://github.com/y-crdt/ypy-websocket"
Source = "https://github.com/y-crdt/ypy-websocket"
Issues = "https://github.com/y-crdt/ypy-websocket/issues"
Pypi = "https://pypi.org/project/ypy-websocket"
Homepage = "https://github.com/davidbrochart/pycrdt-websocket"
Source = "https://github.com/davidbrochart/pycrdt-websocket"
Issues = "https://github.com/davidbrochart/pycrdt-websocket/issues"
Pypi = "https://pypi.org/project/pycrdt-websocket"

[tool.hatch.version]
path = "ypy_websocket/__init__.py"
path = "pycrdt_websocket/__init__.py"

[tool.hatch.build.targets.sdist]
include = [
"/ypy_websocket",
"/pycrdt_websocket",
"/tests",
]

Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from pycrdt import Array, Doc
from websockets import serve # type: ignore

from ypy_websocket import WebsocketServer
from pycrdt_websocket import WebsocketServer


class TestYDoc:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from pycrdt import Doc, Map
from websockets import connect # type: ignore

from ypy_websocket import ASGIServer, WebsocketProvider, WebsocketServer
from pycrdt_websocket import ASGIServer, WebsocketProvider, WebsocketServer

websocket_server = WebsocketServer(auto_clean_rooms=False)
app = ASGIServer(websocket_server)
Expand Down
6 changes: 3 additions & 3 deletions tests/test_ypy_yjs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from pycrdt import Array, Doc, Map
from websockets import connect # type: ignore

from ypy_websocket import WebsocketProvider
from pycrdt_websocket import WebsocketProvider


class YTest:
Expand Down Expand Up @@ -40,7 +40,7 @@ def callback(event):

@pytest.mark.anyio
@pytest.mark.parametrize("yjs_client", "0", indirect=True)
async def test_ypy_yjs_0(yws_server, yjs_client):
async def test_pycrdt_yjs_0(yws_server, yjs_client):
ydoc = Doc()
ytest = YTest(ydoc)
async with connect("ws://127.0.0.1:1234/my-roomname") as websocket, WebsocketProvider(
Expand All @@ -59,7 +59,7 @@ async def test_ypy_yjs_0(yws_server, yjs_client):

@pytest.mark.anyio
@pytest.mark.parametrize("yjs_client", "1", indirect=True)
async def test_ypy_yjs_1(yws_server, yjs_client):
async def test_pycrdt_yjs_1(yws_server, yjs_client):
# wait for the JS client to connect
tt, dt = 0, 0.1
while True:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_ystore.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import aiosqlite
import pytest

from ypy_websocket.ystore import SQLiteYStore, TempFileYStore
from pycrdt_websocket.ystore import SQLiteYStore, TempFileYStore


class MetadataCallback:
Expand Down

0 comments on commit ceeb014

Please sign in to comment.