File python-neovim.spec of Package python-neovim

#
# spec file for package python-neovim
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%define modname pynvim
%{?sle15_python_module_pythons}
Name:           python-neovim
Version:        0.5.2
Release:        lp156.2.1
Summary:        Python client to Neovim
License:        Apache-2.0
Group:          Productivity/Text/Editors
URL:            https://github.com/neovim/pynvim
Source:         https://github.com/neovim/%{modname}/archive/%{version}/%{modname}-%{version}.tar.gz
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module pytest-timeout}
BuildRequires:  %{python_module pytest}
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module typing_extensions}
BuildRequires:  %{python_module wheel}
BuildRequires:  fdupes
BuildRequires:  neovim >= 0.9.0
BuildRequires:  python-rpm-macros
Requires:       neovim
Requires:       python-greenlet
Requires:       python-msgpack
Requires:       python-typing_extensions
Provides:       python-nvim
BuildArch:      noarch
# SECTION test requirements
BuildRequires:  %{python_module greenlet}
BuildRequires:  %{python_module msgpack}
# /SECTION
%python_subpackages

%description
Library for scripting Nvim processes through its msgpack-rpc API.

%prep
%autosetup -p1 -n %{modname}-%{version}

%build
%pyproject_wheel

%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}

%files %{python_files}
%license LICENSE
%doc README.md
%{python_sitelib}/neovim
%{python_sitelib}/%{modname}
%{python_sitelib}/%{modname}-%{version}*-info

%changelog
* Tue Nov 26 2024 Richard Rahl <rrahl0@opensuse.org>
- update to 0.5.2:
  * build: fix conditional install_requires
- update to 0.5.1:
  * Several refactoring on asyncio eventloop implementations
  * test: add tests for attaching through socket, tcp, and stdio
  * refactor: remove the use of forward references
  * fix(tests): "provider#python3#Prog" was removed upstream
  * Revert "fix: vim.eval('v:true') should return python bool
  * fix: UpdateRemotePlugins not finding specs on windows
  * fix(tests): broadcast test fails
  * fix: Remove deprecated alias of logger.warn
  * fix(tests): remove reference to pytest-runner
  * fix(tests): failing tests on python3.13 about stacktrace messages
- disable tests, as they time out
- fix leap by using the newer python stack
* Fri Feb 16 2024 Matej Cepl <mcepl@cepl.eu>
- "Do not use %%python_module for Requires"
  (from https://en.opensuse.org/openSUSE:Packaging_Python#Requires,_Provides_and_similar)
  Fixes bsc#1220005
- Also, clean up the SPEC file a bit.
* Thu Dec 28 2023 Soc Virnyl Estela <uncomfy+openbuildservice@uncomfyhalomacro.pl>
- Remove deprecated python-rpm-macro definitions
- Update to version 0.5.0:
  * feat: Ex command ":py=" evaluate and print expression
  * test: always use the same python regardless of $PATH
  * packaging: Add pynvim.version attribute
  * fix: ignore flaky OSError on windows
  * fix: EOF error on piped stderr being closed on Windows
  * fix: do not leak resources across tests so as to prevent side effects
  * deps: Require greenlet >= 3.0 since it supports Python 3.12
  * fix: broken dynamic import of rplugin modules
  * fix: sphinx "invalid language code"
  * fix: mypy type annotation warnings
  * fix: sphinx "Unexpected indentation" warning
  * fix: PEP 484 prohibits implicit Optional
  * fix: undefined name 'original_find_module'
  * fix(test): Unknown config option: timeout warning
  * test_buffer: don't depend on version-dependent default values
  * fix: imp module is deprecated
  * Drop old python versions, add type annotations
  * docs: python 2 is not supported
  * test: update 'define' option default
  * refactor: remove usage of imp
  * packaging: conform to PEP 517 guidelines
  * fix: vim.eval('v:true') should return python bool
  * fix the first call to sync functions returning null
* Thu Mar 18 2021 Matej Cepl <mcepl@suse.com>
- Update to 0.4.3:
  - Detect encoding correctly on non-standard locales
* Thu Nov  5 2020 Matej Cepl <mcepl@suse.com>
- Update to 0.4.2:
  - Refactor: IOError was deprecated. Replace with OSError
  - refactor: Reduce usage of deprecated imp module
  - Modify all imports in the repository to absolute imports
  - Set unicode_errors in Unpacker
  - import vim module by default
- Remove setup_version.patch which has been included upstream.
* Thu Apr 23 2020 Matej Cepl <mcepl@suse.com>
- Rewrite the package into proper single-spec style.
* Fri Feb 21 2020 Matej Cepl <mcepl@suse.com>
- Update to 0.4.1:
  - Logging will be disabled on release tarballs and pip packages
    for performance reasons. use scripts/enable_log_statements.sh
    and scripts/disable_log_statements.sh to toggle the
    availability of logging.
  - 09bba08 remove scrutinizer
  - f048531 make pytest_runner an optional dependency
  - 5b50ce9 fix missing self.name for nvim_error_event
  - 175a2cc Test with python 3.8
  - 5a2b552 fix the disable logging script.
  - 2a31195 Update docs/tests to use --headless when needed
  - 1d121e0 Update tests for new global/local option behavior
  - 6310063 session: set client info (not only for host)
  - 58ff62f python2 compat: fix buffer inequality
  - a63cddb ci: fix coverage reporting
  - f4f3bf5 api: key deletion; use KeyError for maps (if_python
    compat)
  - d3c389f host: do not run __init__ in plugin until the plugin
    is invoked
- Add temporary patch setup_version.patch setting the version
  number in setup.py correctly. gh#neovim/pynvim#431
* Sun Jan 20 2019 mcepl@suse.com
- Update to 0.3.2:
  * Cleanup after the pynvim rename, as well as a few bugfixes
    and improvements.
  * support del vim.current.line
  * Handle nvim_error_event (errors from async requests)
  * Don't crash when subprocesses write to stdout
  * 22e5919 Continue pynvim rename
  * test with Python 3.7 in Travis.
* Mon Jan  7 2019 Matej Cepl <mcepl@suse.com>
- Make package buildable on EPEL7, while we give up on Fedora
* Sun Nov 25 2018 mcepl@suse.com
- Update to 0.3.1:
  * This release renames the the package name (for PyPI and
    importing) to pynvim.
    import neovim is still supported as an alias for backwards
    compatibility, but new API users should use import pynvim.
  * More informative error message for usage from non-main thread
  * script host: Use the correct interface for a path entry
    finder
  * api: implement Remote.__repr__
  * event loop: Enable asyncio on windows again
  * host: Add client info (for nvim_list_chans())
  * host: make imports thread-safe
* Sat May 26 2018 mcepl@suse.com
- Upgrade to 0.2.6
  * Some minor fixes
  * Supported for communication with neovim in-process lua interpreter
- Clean-up SPEC file
* Mon Mar 26 2018 ronisbr@gmail.com
- Run spec-cleaner.
- Version bump to 0.2.4.
  Upstream changelog:
  Version 0.2.4
    Temporarily disable asyncio on windows again, as stdio is not
    functional with asyncio yet.
    The new nvim.loop attribute is for the moment only available on
    POSIX systems.
  Version 0.2.3
    In this release support of python3.3 is dropped. Henceforth we
    want python3 rplugins to be able to assume the usage of
    asyncio, so they can use the asyncio event loop and libraries
    that build on it.
    Furthermore, a close() method is added on nvim session objects.
    When used as a library for externally connecting to a nvim
    instance (i e not rplugins), it is recommended to call the
    close() method on the session object when it is not needed
    anymore. Alternatively, sessions can be used as a context
    manager:
    with neovim.attach('socket', path=thepath) as nvim:
    [#] do stuff with nvim session in this block:
    print(nvim.funcs.getpid())
    print(nvim.current.line)
  * 2689ddc add tests for plugin decorators #298
  * 63f257f allow library users to properly cleanup the event
    loop #303
  * 59c184f expose the asyncio event loop as nvim.loop (python
    3.4+ only) #294
  Version 0.2.1
    Adds compability with msgpack 0.5.2.
  * e800c64 discover_runtime_directories refactor (#287)
  * 9cf971f Travis lint refactor (#288)
  * 93e6b5b msgpack-python was renamed to msgpack (#293)
  * 6fc0343 fix for msgpack 0.5.2 (#301)
* Mon Nov 13 2017 ronisbr@gmail.com
- Run spec-cleaner.
- Version bump to 0.2.0.
  Upstream changelog:
  * a2e1169 Fix tests on windows (#201)
  * 9a0e729 Fix an indexing bug when setting lines in a Range
    object (#270)
  * 4abd5d0 Documentation update (#272)
  * a703b47 Make sure logging always uses UTF-8 regardless of
    locale (#276)
  * 68aa352 Add argument to allow nested notification handlers
    (#262)
* Thu Sep  7 2017 toddrme2178@gmail.com
- Implement single-spec version
* Tue May  9 2017 ronisbr@gmail.com
- Run spec-cleaner.
- Version bump to 0.1.13.
  Upstream changelog:
  Version 0.1.13
  * 549f721 Fix spawning a child on python 3.6
  * 171d137 Conform to pyuv 1.0 API
  * 99a2150 use tox for testing and add python 3.6 to test matrix
* Fri Dec  2 2016 ronisbr@gmail.com
- Version bump to 0.1.12.
  Upstream changelog:
  Version 0.1.12
  * 317abda export Object.handle and make Buffer.number
    non-blocking
* Thu Nov 17 2016 ronisbr@gmail.com
- Add neovim as a runtime dependency, since there is no reason to
  install this package without neovim and the new version will only
  work with neovim >= 0.1.6.
- Version bump to 0.1.11.
  Upstream changelog:
  Version 0.1.11
  * ce840cb Add number attribute to Window and Tabpage objects
  * 111bc07 Use api level 1, as released with nvim 0.1.6.
  * ba1fcd4 add neovim.VERSION (python module version) and
    nvim.version attributes.
  * 6eb75a3 show full tracebacks for errors in handlers and
    callbacks
* Sat Oct  8 2016 ronisbr@gmail.com
- Version bump to 0.1.10.
  Upstream changelog:
  Version 0.1.10
  * 861b0ba Report errors in handlers on stderr when used as
    external client
  * 36b2732 Don't rely on sys.stderr when it is not used
  * 1954384 Allow Buffer.append to take bytes (b'...') as
    argument
  * cb23953 Use predictable log file names
* Wed Aug 10 2016 ronisbr@gmail.com
- Version bump to 0.1.9.
  Upstream changelog:
  Version 0.1.9
  * 8eb6ba7 fix vim.buffers interface
  * deecb3e Hide irrelevant parts of tracebacks from plugin
    errors
* Thu May 26 2016 ronisbr@gmail.com
- Remove unneeded dependencies since the GUI was moved to another
  package.
* Sun May 15 2016 ronisbr@gmail.com
- Version bump to 0.1.8.
  Upstream changelog:
  Version 0.1.8
  * 44fb250 vim compatible behavior for vim.eval("[1, 2]")
  * 16cdbc5 fix bang and register command modifiers
  * d6669ab better handling of invalid utf-8 in python3
  * 96c721a Don't error out on :UpdateRemotePlugins when there is
    no plugins.
  * 5f80a55 Use pyuv instead of asyncio on Windows to support
    stdio.
- Fix `python-neovim.changes` and `python3-neovim.changes`
  indentation.
* Sat Apr  9 2016 ronisbr@gmail.com
- Version bump to 0.1.7.
  Upstream changelog:
  Version 0.1.7
    Add back compatibility for nvim.session.threadsafe_call which
    is quite common.
  Version 0.1.6
    This release contains some breaking changes, primarily for
    using this package as a client to remote nvim instances. Most
    python plugins (both legacy and rplugins) are expected to be
    unaffected.
    This version requires recent master version of neovim (or 0.1.3
    when it gets released).
    nvim.session is unexported. Upgrade clients as follows:
    nvim.session.threadsafe_call -> nvim.async_call
    nvim.session.next_message -> nvim.next_message
    nvim.session.run -> nvim.run_loop
    nvim.session.stop -> nvim.stop_loop
    nvim.session.request -> nvim.request (or nvim.api.method )
    nvim.with_hook is gone. This was mostly used by clients to
    configure decoding on python3. With this release, neovim.attach
    will activate decoding for python3, so str is returned by
    default on both python2 and python3. attach takes an optional
    boolean keyword argument decode, to force decoding on or off.
    Decoding behavior can be changed with nvim2 =
    nvim.with_decode(True/False)
  * b192bae make nvim.current.range.start/end behave like in Vim
  * 9498b38 more robust way to find the script host
  * 6655ced remove SessionHook and move public session api to the
    nvim object
  * 22537a2 introduce nvim.api.some_method and
    buffer.api.some_method to call the msgpack API directly
  * 69d6d0f allow nosetests without needing to set envirionment
    varibles to find nvim
  * 0886e84 remove DecodeHook
  * 02e28e7 change neovim.attach to setup decoding for python3
    Also some bugs regarding line indexing are fixed in neovim
    master (not the python-client), for instance
    buffer.append("line", i), when the line is inserted after the
    last existing line, is no longer an error.
  Version 0.1.5
    Previously, when implementing an rplugin as a package, an empty
    dummy file was needed like this:
    rplugin/python3/mypackage.py # empty file
    rplugin/python3/mypackage/__init__.py # contains spec
    rplugin/python3/mypackage/helpers.py
    rplugin/python3/mypackage/...
    This is no longer neccessary and mypackage.py can be deleted.
  * df0f428 fix missing files in source distribution
  * 3f86eb0 add more info to README.md
  * 0d5b388 fix formatting of README.md
  * 5744bbe search for package dirs
  * c960e32 be more verbose about import errors
  Version 0.1.4
    This release introduces no new features or bugfixes, and is a
    compatibility release. Neovim master will soon require this
    version (or later) being installed.
  * 79721e6 move script_host.py to this repository.
* Tue Mar  8 2016 ronisbr@gmail.com
- Version bump to 0.1.3.
  Upstream changelog:
  Version 0.1.3
    The gui was removed in this release, and is now available at
    neovim/python-gui and as the pip package neovim_gui
  * c3789fb move test/common.py to test/test_common.py to include
    it in release tarballs
  * 1020b45 remove the gui
  * 4be9207 better handling of exceptions in async (notification)
    handlers
  * 57747f6 allow $NVIM_PYTHON_LOG_FILE also when running the
    nosetests
  Version 0.1.2
  * I published 0.1.1 incorrectly.
  Version 0.1.1
  * dea5427 don't use deprecated logging.warn() method
  * 94c4240 fix typos in the gtk gui key definitions
  * 2cc7314 support attaching on windows
  * 62e347a add wrappers for add_highlight/clear_highlight buffer
    methods
  * 2db6bee don't use BaseException.message which is removed in
    python3
* Tue Jan 12 2016 ronisbr@gmail.com
- Version bump to 0.1.0.
  Upstream changelog:
  * 66617ca doc: Add embedding example to readme.
  * 0dce6a8 Change supported python3 versions to 3.3-3.5
  * d6f2c7a Don't override the encoding of msgpack strings
  * e94201f ui: convert byte strings in python3. Fixes #145
* Wed Dec  2 2015 ronisbr@gmail.com
- Initial version based on home:gmg137:neovim/python-neovim
openSUSE Build Service is sponsored by