Skip to content

Commit

Permalink
v0.7.0 (#47)
Browse files Browse the repository at this point in the history
* Use 3.11 everywhere (#38)

* v0.6.0 (#42) (#45)

* Bump version and add note to README

Prepare for release tomorrow and move forward for v0.7.0 and v0.8.0 release

* Steal pygments regexes (#34)

* test.py

* Move to server functions and set up proper tests

* Reformat

* Reformat

* Change to beartype typing

* Even more formatting

* Remove regex stealer test

Runs different locally than on gh runner and not worth the time or effort.

* Get docstring areas

* Make function work

* Add type annotation

* format

* Add lots of comments but don't remove private type

@leycec I tried using the idea you gave for private types but got Union type errors for some reason I couldn't really understand. Thank you so much for your time and thoughts and congrats on the bike ride, thats a long stretch!

* Fix a small bug

* Improve highlighting functions significantly

Now it ignores whitespace at the front of the line!

* Stop using private variable

* Format for black and ruff

* Move docstring tokens up

* Update tests

* Fix line number for docstring tokens

Was 1 behind

* Reformat

* Bump version

* Implement token overwriting (#49)

* Display the problem

* Get working test

* Better overlap checking

* Better tests

* Sort and remove duplicates

* Remove old vestige and format

* Move token merging to highlight file

* Format

* Use overwrite_and_merge_tokens

* Use caches (#53)

* Cache important functions

* Remove old file

* Format

* Explain python version requirement plans (#54)

* Tokens outside text range (#56)

* Use 3.11 everywhere (#38)

* v0.6.0 (#42) (#45)

* Bump version and add note to README

Prepare for release tomorrow and move forward for v0.7.0 and v0.8.0 release

* Steal pygments regexes (#34)

* test.py

* Move to server functions and set up proper tests

* Reformat

* Reformat

* Change to beartype typing

* Even more formatting

* Remove regex stealer test

Runs different locally than on gh runner and not worth the time or effort.

* Get docstring areas

* Make function work

* Add type annotation

* format

* Add lots of comments but don't remove private type

@leycec I tried using the idea you gave for private types but got Union type errors for some reason I couldn't really understand. Thank you so much for your time and thoughts and congrats on the bike ride, thats a long stretch!

* Fix a small bug

* Improve highlighting functions significantly

Now it ignores whitespace at the front of the line!

* Stop using private variable

* Format for black and ruff

* Move docstring tokens up

* Update tests

* Fix line number for docstring tokens

Was 1 behind

* Reformat

* Bump version

* Implement token overwriting (#49)

* Display the problem

* Get working test

* Better overlap checking

* Better tests

* Sort and remove duplicates

* Remove old vestige and format

* Move token merging to highlight file

* Format

* Use overwrite_and_merge_tokens

* Use caches (#53)

* Cache important functions

* Remove old file

* Format

* Explain python version requirement plans (#54)

* Check that all tokens are in text range

* Create Windows tests (#57)

* Start small

Use pathlib.Path() and change from ubuntu-latest to Windows-latest

* Format

* Handle different Windows import

* Fix server.py (same issue as last)

* Update names

* Try printing out returned tokens

* Give both outputs

* Update README to note the issue

* Try breaking up different lines

* Use bullet points

* Refactor highlight (#58)

* Change highlight code structure

Moved into multiple separate files (could become a submodule)

* Move to submodule
  • Loading branch information
Moosems authored Jul 8, 2024
1 parent 4644959 commit 47b55f2
Show file tree
Hide file tree
Showing 20 changed files with 686 additions and 411 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: 3.11.1
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
with:
python-version: 3.11.1

- name: Code Formatting (App)
- name: Run tests
run: |
pip install .
pip install pytest
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/windows-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Code Tests (On Windows)

on: push

jobs:
formatting:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.11.1

- name: Run tests
run: |
pip install .
pip install pytest
python3 -m pytest . -s
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1 align="center">Salve v0.6.0</h1>
<h1 align="center">Salve v0.7.0</h1>

# Installation

Expand All @@ -8,8 +8,10 @@ In the Command Line, paste the following: `pip install salve_ipc`

Salve is an IPC library that can be used by code editors to easily get autocompletions, replacements, editorconfig suggestions, definitions, and syntax highlighting.

> **Note**
> The first time that the system is loaded or a new server needs to be started it will take a fair bit longer. Additionally, any usage of IPC needs to eventually be called from an `if __name__ == "__main__":` block to prevent a multiproccesing error.
> **Notes:**
> - The first time that the system is loaded or a new server needs to be started it will take a fair bit longer.
> - Any usage of IPC needs to eventually be called from an `if __name__ == "__main__":` block to prevent a multiproccesing error.
> - Due to the way Windows handles chars the hidden character highlighter may not work properly. See [#57](https://github.com/Moosems/salve/pull/57). If anyone knows how to fix this, I would greatly appreciate you opening a PR :)
## Documentation

Expand Down Expand Up @@ -94,6 +96,11 @@ if __name__ == "__main__":

To contribute, fork the repository, make your changes, and then make a pull request. If you want to add a feature, please open an issue first so it can be discussed. Note that whenever and wherever possible you should try to use stdlib modules rather than external ones.

## Required Python Version: 3.11+

Salve IPC will use the three most recent versions (full releases) going forward and will drop any older versions as I hope to keep this package up to date with modern python versions.
Currently 3.11 is the minimum (instead of 3.10) as it what Salve IPC was developed under. However, after 3.14 is released, the minimum will be 3.12 as and will change accordingly in the future as is described above.

## License

This project is licensed under the MIT License - see the [LICENSE](./LISCENSE).
7 changes: 7 additions & 0 deletions salve_ipc/ipc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from multiprocessing.connection import Connection
from pathlib import Path
from random import randint
from sys import platform

from .misc import (
COMMAND,
Expand All @@ -15,6 +16,12 @@
)
from .server import Server

# Deal with Windows weirdness
if platform == "win32":
from multiprocessing.connection import (
PipeConnection as Connection, # type: ignore
)


class IPC:
"""The IPC class is used to talk to the server and run commands. The public API includes the following methods:
Expand Down
7 changes: 7 additions & 0 deletions salve_ipc/server.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from multiprocessing.connection import Connection
from multiprocessing.queues import Queue as GenericClassQueue
from sys import platform
from time import sleep

from pyeditorconfig import get_config
Expand All @@ -20,6 +21,12 @@
get_replacements,
)

# Deal with Windows weirdness
if platform == "win32":
from multiprocessing.connection import (
PipeConnection as Connection, # type: ignore
)


class Server:
"""Handles input from the user and returns output from special functions designed to make the job easy. Not an external API."""
Expand Down
3 changes: 2 additions & 1 deletion salve_ipc/server_functions/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from .autocompletions import find_autocompletions # noqa: F401
from .definitions import get_definition # noqa: F401
from .highlight import get_highlights # noqa: F401
from .misc import Token, generic_tokens, is_unicode_letter # noqa: F401
from .highlight import Token, generic_tokens # noqa: F401
from .misc import is_unicode_letter # noqa: F401
from .replacements import get_replacements # noqa: F401
3 changes: 2 additions & 1 deletion salve_ipc/server_functions/definitions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from re import Match, Pattern, compile

from .misc import Token, find_words
from .highlight import Token
from .misc import find_words


def get_definition(
Expand Down
1 change: 0 additions & 1 deletion salve_ipc/server_functions/find_words.py

This file was deleted.

Loading

0 comments on commit 47b55f2

Please sign in to comment.