diff options
Diffstat (limited to 'python-pygls.spec')
| -rw-r--r-- | python-pygls.spec | 293 |
1 files changed, 293 insertions, 0 deletions
diff --git a/python-pygls.spec b/python-pygls.spec new file mode 100644 index 0000000..9fcd59e --- /dev/null +++ b/python-pygls.spec @@ -0,0 +1,293 @@ +%global _empty_manifest_terminate_build 0 +Name: python-pygls +Version: 1.0.1 +Release: 1 +Summary: a pythonic generic language server (pronounced like "pie glass"). +License: Apache 2.0 +URL: https://github.com/openlawlibrary/pygls/tree/master/ +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/8e/27/58ff0f76b379fc11a1d03e8d4b4e96fd0abb463d27709a7fb4193bcdbbc4/pygls-1.0.1.tar.gz +BuildArch: noarch + +Requires: python3-lsprotocol +Requires: python3-typeguard +Requires: python3-bandit +Requires: python3-flake8 +Requires: python3-mypy +Requires: python3-sphinx +Requires: python3-sphinx-rtd-theme +Requires: python3-mock +Requires: python3-pytest +Requires: python3-pytest-asyncio +Requires: python3-websockets + +%description +[](https://pypi.org/project/pygls/)   [](https://pygls.readthedocs.io/en/latest/) + +# pygls: The Generic Language Server Framework + +_pygls_ (pronounced like "pie glass") is a pythonic generic implementation of the [Language Server Protocol](https://microsoft.github.io/language-server-protocol/specification) for use as a foundation for writing your own [Language Servers](https://langserver.org/) in just a few lines of code. + +## Quickstart +```python +from pygls.server import LanguageServer +from lsprotocol.types import ( + TEXT_DOCUMENT_COMPLETION, + CompletionItem, + CompletionList, + CompletionParams, +) + +server = LanguageServer("example-server", "v0.1") + +@server.feature(TEXT_DOCUMENT_COMPLETION) +def completions(params: CompletionParams): + items = [] + document = server.workspace.get_document(params.text_document.uri) + current_line = document.lines[params.position.line].strip() + if current_line.endswith("hello."): + items = [ + CompletionItem(label="world"), + CompletionItem(label="friend"), + ] + return CompletionList(is_incomplete=False, items=items) + +server.start_io() +``` + +Which might look something like this when you trigger autocompletion in your editor: + + + +## Docs and Tutorial + +The full documentation and a tutorial are available at <https://pygls.readthedocs.io/en/latest/>. + +## Projects based on _pygls_ + +We keep a table of all known _pygls_ [implementations](https://github.com/openlawlibrary/pygls/blob/master/Implementations.md). Please submit a Pull Request with your own or any that you find are missing. + +## Alternatives + +The main alternative to _pygls_ is Microsoft's [NodeJS-based Generic Language Server Framework](https://github.com/microsoft/vscode-languageserver-node). Being from Microsoft it is focussed on extending VSCode, although in theory it could be used to support any editor. So this is where pygls might be a better choice if you want to support more editors, as pygls is not focussed around VSCode. + +There are also other Language Servers with "general" in their descriptons, or at least intentions. They are however only general in the sense of having powerful _configuration_. They achieve generality in so much as configuration is able to, as opposed to what programming (in _pygls'_ case) can achieve. + * https://github.com/iamcco/diagnostic-languageserver + * https://github.com/mattn/efm-langserver + * https://github.com/jose-elias-alvarez/null-ls.nvim (Neovim only) + +## Contributing + +Your contributions to _pygls_ are most welcome ❤️ Please review the [Contributing](https://github.com/openlawlibrary/pygls/blob/master/CONTRIBUTING.md) and [Code of Conduct](https://github.com/openlawlibrary/pygls/blob/master/CODE_OF_CONDUCT.md) documents for how to get started. + +## Donating + +[Open Law Library](http://www.openlawlib.org/) is a 501(c)(3) tax exempt organization. Help us maintain our open source projects and open the law to all with [sponsorship](https://github.com/sponsors/openlawlibrary). + +### Supporters + +We would like to give special thanks to the following supporters: +* [mpourmpoulis](https://github.com/mpourmpoulis) + +## License + +Apache-2.0 + + +%package -n python3-pygls +Summary: a pythonic generic language server (pronounced like "pie glass"). +Provides: python-pygls +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-pygls +[](https://pypi.org/project/pygls/)   [](https://pygls.readthedocs.io/en/latest/) + +# pygls: The Generic Language Server Framework + +_pygls_ (pronounced like "pie glass") is a pythonic generic implementation of the [Language Server Protocol](https://microsoft.github.io/language-server-protocol/specification) for use as a foundation for writing your own [Language Servers](https://langserver.org/) in just a few lines of code. + +## Quickstart +```python +from pygls.server import LanguageServer +from lsprotocol.types import ( + TEXT_DOCUMENT_COMPLETION, + CompletionItem, + CompletionList, + CompletionParams, +) + +server = LanguageServer("example-server", "v0.1") + +@server.feature(TEXT_DOCUMENT_COMPLETION) +def completions(params: CompletionParams): + items = [] + document = server.workspace.get_document(params.text_document.uri) + current_line = document.lines[params.position.line].strip() + if current_line.endswith("hello."): + items = [ + CompletionItem(label="world"), + CompletionItem(label="friend"), + ] + return CompletionList(is_incomplete=False, items=items) + +server.start_io() +``` + +Which might look something like this when you trigger autocompletion in your editor: + + + +## Docs and Tutorial + +The full documentation and a tutorial are available at <https://pygls.readthedocs.io/en/latest/>. + +## Projects based on _pygls_ + +We keep a table of all known _pygls_ [implementations](https://github.com/openlawlibrary/pygls/blob/master/Implementations.md). Please submit a Pull Request with your own or any that you find are missing. + +## Alternatives + +The main alternative to _pygls_ is Microsoft's [NodeJS-based Generic Language Server Framework](https://github.com/microsoft/vscode-languageserver-node). Being from Microsoft it is focussed on extending VSCode, although in theory it could be used to support any editor. So this is where pygls might be a better choice if you want to support more editors, as pygls is not focussed around VSCode. + +There are also other Language Servers with "general" in their descriptons, or at least intentions. They are however only general in the sense of having powerful _configuration_. They achieve generality in so much as configuration is able to, as opposed to what programming (in _pygls'_ case) can achieve. + * https://github.com/iamcco/diagnostic-languageserver + * https://github.com/mattn/efm-langserver + * https://github.com/jose-elias-alvarez/null-ls.nvim (Neovim only) + +## Contributing + +Your contributions to _pygls_ are most welcome ❤️ Please review the [Contributing](https://github.com/openlawlibrary/pygls/blob/master/CONTRIBUTING.md) and [Code of Conduct](https://github.com/openlawlibrary/pygls/blob/master/CODE_OF_CONDUCT.md) documents for how to get started. + +## Donating + +[Open Law Library](http://www.openlawlib.org/) is a 501(c)(3) tax exempt organization. Help us maintain our open source projects and open the law to all with [sponsorship](https://github.com/sponsors/openlawlibrary). + +### Supporters + +We would like to give special thanks to the following supporters: +* [mpourmpoulis](https://github.com/mpourmpoulis) + +## License + +Apache-2.0 + + +%package help +Summary: Development documents and examples for pygls +Provides: python3-pygls-doc +%description help +[](https://pypi.org/project/pygls/)   [](https://pygls.readthedocs.io/en/latest/) + +# pygls: The Generic Language Server Framework + +_pygls_ (pronounced like "pie glass") is a pythonic generic implementation of the [Language Server Protocol](https://microsoft.github.io/language-server-protocol/specification) for use as a foundation for writing your own [Language Servers](https://langserver.org/) in just a few lines of code. + +## Quickstart +```python +from pygls.server import LanguageServer +from lsprotocol.types import ( + TEXT_DOCUMENT_COMPLETION, + CompletionItem, + CompletionList, + CompletionParams, +) + +server = LanguageServer("example-server", "v0.1") + +@server.feature(TEXT_DOCUMENT_COMPLETION) +def completions(params: CompletionParams): + items = [] + document = server.workspace.get_document(params.text_document.uri) + current_line = document.lines[params.position.line].strip() + if current_line.endswith("hello."): + items = [ + CompletionItem(label="world"), + CompletionItem(label="friend"), + ] + return CompletionList(is_incomplete=False, items=items) + +server.start_io() +``` + +Which might look something like this when you trigger autocompletion in your editor: + + + +## Docs and Tutorial + +The full documentation and a tutorial are available at <https://pygls.readthedocs.io/en/latest/>. + +## Projects based on _pygls_ + +We keep a table of all known _pygls_ [implementations](https://github.com/openlawlibrary/pygls/blob/master/Implementations.md). Please submit a Pull Request with your own or any that you find are missing. + +## Alternatives + +The main alternative to _pygls_ is Microsoft's [NodeJS-based Generic Language Server Framework](https://github.com/microsoft/vscode-languageserver-node). Being from Microsoft it is focussed on extending VSCode, although in theory it could be used to support any editor. So this is where pygls might be a better choice if you want to support more editors, as pygls is not focussed around VSCode. + +There are also other Language Servers with "general" in their descriptons, or at least intentions. They are however only general in the sense of having powerful _configuration_. They achieve generality in so much as configuration is able to, as opposed to what programming (in _pygls'_ case) can achieve. + * https://github.com/iamcco/diagnostic-languageserver + * https://github.com/mattn/efm-langserver + * https://github.com/jose-elias-alvarez/null-ls.nvim (Neovim only) + +## Contributing + +Your contributions to _pygls_ are most welcome ❤️ Please review the [Contributing](https://github.com/openlawlibrary/pygls/blob/master/CONTRIBUTING.md) and [Code of Conduct](https://github.com/openlawlibrary/pygls/blob/master/CODE_OF_CONDUCT.md) documents for how to get started. + +## Donating + +[Open Law Library](http://www.openlawlib.org/) is a 501(c)(3) tax exempt organization. Help us maintain our open source projects and open the law to all with [sponsorship](https://github.com/sponsors/openlawlibrary). + +### Supporters + +We would like to give special thanks to the following supporters: +* [mpourmpoulis](https://github.com/mpourmpoulis) + +## License + +Apache-2.0 + + +%prep +%autosetup -n pygls-1.0.1 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-pygls -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Tue Apr 11 2023 Python_Bot <Python_Bot@openeuler.org> - 1.0.1-1 +- Package Spec generated |
