Skip to content

ci: Add python3.12 support #535

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
cache: 'pip'
python-version: 3.11
- name: install dependencies
run: pip install tox tox-gh-actions
run: python3 -m pip install tox tox-gh-actions
- name: checkqa
env:
TOXENV: 'checkqa,docs'
Expand All @@ -32,7 +32,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ['3.10', '3.11']
python: ['3.10', '3.11', '3.12-dev']
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
include:
- os: ubuntu-latest
Expand Down Expand Up @@ -71,11 +71,13 @@ jobs:
run: echo "$(pwd)/${{ matrix.NVIM_BIN_PATH }}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

- name: install dependencies
run: pip install tox tox-gh-actions
run: python3 -m pip install tox tox-gh-actions

- name: test
- name: test with tox
run: |
echo $PATH
which nvim
nvim --version
which -a python3
python3 --version
tox
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@

if platform.python_implementation() != 'PyPy':
# pypy already includes an implementation of the greenlet module
install_requires.append('greenlet')
if sys.version_info >= (3, 12):
install_requires.append('greenlet>=3.0.0rc3')
else:
install_requires.append('greenlet')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

greenlet has been a pain, I wish we could eliminate it :/


if sys.version_info < (3, 8):
install_requires.append('typing-extensions')
Expand Down
5 changes: 4 additions & 1 deletion test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ def vim() -> pynvim.Nvim:
child_argv = os.environ.get('NVIM_CHILD_ARGV')
listen_address = os.environ.get('NVIM_LISTEN_ADDRESS')
if child_argv is None and listen_address is None:
child_argv = '["nvim", "-u", "NONE", "--embed", "--headless"]'
child_argv = json.dumps([
"nvim", "-u", "NONE", "--embed", "--headless",
"-c", "let g:python3_host_prog='python3'", # workaround neovim/neovim#25316
])

if child_argv is not None:
editor = pynvim.attach('child', argv=json.loads(child_argv))
Expand Down
6 changes: 5 additions & 1 deletion test/test_vim.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,11 @@ def test_hash(vim: Nvim) -> None:
assert d[vim.current.buffer] == 'beta'


def test_cwd(vim: Nvim, tmpdir: Any) -> None:
def test_python3(vim: Nvim, tmpdir: Any) -> None:
python3_prog = vim.command_output('echom provider#python3#Prog()')
python3_err = vim.command_output('echom provider#python3#Error()')
assert python3_prog != "", python3_err

vim.command('python3 import os')
cwd_before = vim.command_output('python3 print(os.getcwd())')

Expand Down