Skip to content

Commit

Permalink
Merge pull request #723 from bollwyvl/gh-718-ci-pythons
Browse files Browse the repository at this point in the history
Update Pythons in CI
  • Loading branch information
krassowski authored Dec 12, 2021
2 parents 7158551 + dbb7d23 commit 8d904f9
Show file tree
Hide file tree
Showing 13 changed files with 99 additions and 70 deletions.
96 changes: 56 additions & 40 deletions .github/workflows/job.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ on:
- 2.x
workflow_dispatch:

# TODO: might need to tweak `group`
concurrency:
group: ${{ github.head_ref }}
cancel-in-progress: true

defaults:
run:
shell: bash -l {0}
Expand All @@ -31,12 +36,13 @@ env:
jobs:
lint:
name: jstest/lint
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: [ubuntu-latest]
os: [ubuntu]
nodejs: ['>=14,<15.0.0a0']
lab: ['>=3.0.0,<4.0.0a0']
r: ['>=4']
steps:
- uses: actions/checkout@v2

Expand Down Expand Up @@ -77,7 +83,7 @@ jobs:
with:
path: '**/node_modules'
key: |
${{ env.CACHE_EPOCH }}-${{ runner.os }}-node-lint-${{ hashFiles('yarn.lock', 'requirements/github-actions.yml') }}
${{ env.CACHE_EPOCH }}-${{ runner.os }}-node-build-${{ hashFiles('yarn.lock', 'requirements/github-actions.yml') }}
- name: Cache yarn packages
id: cache-yarn-packages
Expand All @@ -104,6 +110,9 @@ jobs:
- name: Lint backend
run: python scripts/lint.py

- name: 'Revert templated file (TODO: remove)'
run: git checkout requirements/github-actions.yml

- name: Lint frontend
run: jlpm lint:check

Expand All @@ -112,12 +121,13 @@ jobs:

build:
name: build
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: [ubuntu-latest]
os: [ubuntu]
nodejs: ['>=14,<15.0.0a0']
lab: ['>=3.0.0,<4.0.0a0']
r: ['>=4']
steps:
- uses: actions/checkout@v2

Expand Down Expand Up @@ -203,35 +213,27 @@ jobs:
path: ./dist

acceptance:
runs-on: ${{ matrix.os }}
name: atest ${{ matrix.os }} py${{ matrix.python }}
runs-on: ${{ matrix.os }}-latest
name: atest ${{ matrix.os }} py${{ matrix.python }} r${{ matrix.r }}
needs: [build]
strategy:
# TODO: maybe turn back on
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-10.15', 'windows-latest']
python: [3.6, 3.7, 3.8]
lab: ['>=3.0.0,<4.0.0a0']
os: ['ubuntu', 'macos', 'windows']
python: ['3.7', '3.10']
include:
# if using 3.6, use an old node
- python: 3.6
# if using 3.7, use newer node, etc...
- python: '3.7'
# Node 12 end-of-life: April 2022
nodejs: '>=12,<13.0.0.a0'
# if using 3.7, use newer node, etc...
- python: 3.7
# Node 14 end-of-life: April 2023
nodejs: '>=14,<15.0.0.a0'
- python: 3.8
r: '<4'
lab: '>=3.0.0,<3.1'
- python: '3.10'
# Node 16 end-of-life: April 2024
nodejs: '>=16,<17.0.0.a0'
# TODO: remove when mambaforge just works on setup-miniconda
- os: 'ubuntu-latest'
mambaforge: Linux-x86_64.sh
- os: 'macos-10.15'
mambaforge: MacOSX-x86_64.sh
- os: 'windows-latest'
mambaforge: Windows-x86_64.exe
r: '>=4'
lab: '>=3.2.0,<4'

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -355,28 +357,38 @@ jobs:

smoke:
name: smoke ${{ matrix.os }} py${{ matrix.python }}
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.os }}-latest
needs: [build, lint]
strategy:
fail-fast: false
max-parallel: 3
matrix:
os: ['ubuntu-latest', 'macos-10.15', 'windows-latest']
python: ['3.6', '3.9', 'pypy3']
os: ['ubuntu', 'macos', 'windows']
python: ['3.7', '3.8', '3.9', '3.10', 'pypy-3.7']
exclude:
- os: windows
python: pypy3
python: pypy-3.7
include:
- python: '3.6'
dist: 'jupyter*lsp*.tar.gz'
- python: 'pypy3'
- python: '3.7'
dist: 'jupyter*lsp*.tar.gz'
lab: '>=3,<3.1'
- python: '3.8'
dist: 'jupyter*lsp*.whl'
lab: '>=3,<3.1'
- python: '3.9'
dist: 'jupyter*lsp*.tar.gz'
lab: '>=3.2,<3.3'
- python: '3.10'
dist: 'jupyter*lsp*.whl'
- os: 'windows-latest'
lab: '>=3.2,<4'
- python: 'pypy-3.7'
dist: 'jupyter*lsp*.tar.gz'
lab: '>=3.2,<3.3'
- os: 'windows'
py_cmd: python
- os: 'macos-10.15'
- os: 'macos'
py_cmd: python3
- os: 'ubuntu-latest'
- os: 'ubuntu'
py_cmd: python
steps:
- name: Install Python
Expand All @@ -391,7 +403,7 @@ jobs:
- name: Install the prerequisites
run: ${{ matrix.py_cmd }} -m pip install pip wheel
- name: Install the package
run: cd dist && ${{ matrix.py_cmd }} -m pip install -vv ${{ matrix.dist }}
run: cd dist && ${{ matrix.py_cmd }} -m pip install -vv ${{ matrix.dist }} 'jupyterlab${{ matrix.lab }}'
- name: Validate environment
run: |
set -eux
Expand All @@ -406,16 +418,20 @@ jobs:
jupyter server extension list 2>&1 | grep -ie "jupyter_lsp.*enabled" -
source:
name: smoke source install ${{ matrix.os }}
name: smoke source install ${{ matrix.os }} py${{ matrix.python }} lab${{ matrix.lab }}
runs-on: ${{ matrix.os }}-latest
needs: [build]
strategy:
fail-fast: false
matrix:
os: [ubuntu]
python: ['3.6']
python: ['3.7', '3.10']
nodejs: ['14']
lab: ['>=3.0.0,<4.0.0a0']
include:
- python: '3.7'
lab: '>=3,<3.1'
- python: '3.10'
lab: '>=3.2,<4'
steps:
- name: Install Python
uses: actions/setup-python@v2
Expand All @@ -425,13 +441,13 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: ${{matrix.nodejs}}
node-version: ${{ matrix.nodejs }}
- uses: actions/download-artifact@v2
with:
name: jupyterlab-lsp dist ${{ github.run_number }}
path: ./dist
- name: Install the prerequisites
run: python -m pip install pip wheel
run: python -m pip install --upgrade pip wheel setuptools
- name: Install JupyterLab
shell: bash -l {0}
run: python -m pip install 'jupyterlab${{ matrix.lab }}'
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,4 @@ _build
.idea/

# Built labextensions
python_packages/jupyterlab_lsp/jupyterlab_lsp/labextensions/
python_packages/*/*/labextensions/
5 changes: 5 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ version: 2
sphinx:
configuration: docs/conf.py

build:
os: ubuntu-20.04
tools:
python: mambaforge-4.10

conda:
environment: docs/rtd.yml

Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ Thank you for all your contributions :heart:

Development requires, at a minimum:

- `nodejs >=12,<15`
- `python >=3.6,<3.9.0a0`
- Python 3.7 and 3.8 are also tested on CI
- Python 3.6 has issues on Windows
- `nodejs >=12,!=13,!=15,<17`
- `python >=3.7,<3.11.0a0`
- Python 3.7 and 3.10 are fully tested on CI
- Python 3.7 to 3.10 and PyPy 3 are verified to at least install and import
- `jupyterlab >=3.0.0,<4.0.0a0`

It is recommended to use a virtual environment (e.g. `virtualenv` or `conda env`)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Use context menu on rows in the panel to filter out diagnostics or copy their me
You will need to have both of the following installed:

- JupyterLab >=3.0.0,<4.0.0a0
- Python 3.6+
- Python 3.7+

In addition, if you wish to use javascript, html, markdown or any other NodeJS-based language server you will need to have appropriate NodeJS version installed.

Expand Down
6 changes: 3 additions & 3 deletions binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ channels:

dependencies:
# runtime dependencies
- python >=3.6,<3.9.0a0
- python >=3.7,<3.11.0a0
- jupyterlab >=3.0.0,<4.0.0a0
- jupyter_server >=1.1.2
- retrolab >=0.2.0,<0.3
- retrolab >=0.3.0,<0.4
# build dependencies
- nodejs >=12,<15
- nodejs >=12,!=13,!=15,<17
# for python language server (and development)
- flake8 >=3.5
- pip
Expand Down
28 changes: 14 additions & 14 deletions docs/rtd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ name: jupyterlab-lsp-docs

channels:
- conda-forge
- nodefaults

dependencies:
- nodejs >=12,<13
- importlib_metadata
- jupyterlab >=3.0.0,<4.0.0a0
- myst-nb
- nodejs >=12,!=13,!=15,<17
- pandas
- pip
- python >=3.8,<3.9.0a0
- pytest-check-links
- python >=3.7,<3.11.0a0
- python-graphviz
- python-lsp-server
- sphinx
- sphinx-autodoc-typehints
- sphinx-book-theme
- sphinx-copybutton
- pip:
- -e ../python_packages/jupyter_lsp/
- graphviz
- importlib_metadata
- jupyterlab >=3.0.0,<4.0.0a0
- nbsphinx >=0.5.0,<0.5.1a0
- pandas
- pytest-check-links
- myst-nb
- python-lsp-server
- sphinx
- sphinx-autodoc-typehints
- sphinx-copybutton
- sphinx-book-theme
2 changes: 1 addition & 1 deletion python_packages/jupyter_lsp/jupyter_lsp/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def jsonrpc_init_msg():
# LanguageServer.jl assumes that it is not missing
"workspace": {"didChangeConfiguration": {}},
# LanguageServer.jl assumes that it is not missing
"textDocument": {}
"textDocument": {},
},
"initializationOptions": None,
"processId": None,
Expand Down
11 changes: 10 additions & 1 deletion python_packages/jupyter_lsp/jupyter_lsp/tests/test_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,16 @@ def test_normalize_posix_path_home_subdir(
],
)
def test_normalize_windows_path_case(root_dir, expected_root_uri): # pragma: no cover
assert normalized_uri(root_dir) == expected_root_uri

try:
normalized = normalized_uri(root_dir)
except FileNotFoundError as err:
if sys.version_info >= (3, 10):
# apparently, this triggers resolving the path on win/py3.10
return
raise err

assert normalized == expected_root_uri


@pytest.mark.skipif(WIN, reason="can't test POSIX paths on Windows")
Expand Down
2 changes: 1 addition & 1 deletion python_packages/jupyter_lsp/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ classifiers =
packages = find:
include_package_data = True
zip_safe = False
python_requires = >=3.6
python_requires = >=3.7

install_requires =
jupyter_server >=1.1.2
Expand Down
2 changes: 1 addition & 1 deletion python_packages/jupyterlab_lsp/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ classifiers =
packages = find:
include_package_data = True
zip_safe = False
python_requires = >=3.6
python_requires = >=3.7

install_requires =
jupyter_lsp >=1.4.0
Expand Down
3 changes: 1 addition & 2 deletions requirements/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ dependencies:
# temporarily pin autopep8
- autopep8 <1.6.0
# for R language server and kernel
# TODO: try r 4.0 soon
- r <4
- r {r}
- r-irkernel
- r-languageserver
- r-stringi >=1.4.6
Expand Down
2 changes: 1 addition & 1 deletion versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
JUPYTERLAB_NEXT_MAJOR_VERSION = int(JUPYTERLAB_VERSION.split('.')[0]) + 1
REQUIRED_JUPYTERLAB = f'>={JUPYTERLAB_VERSION},<{JUPYTERLAB_NEXT_MAJOR_VERSION}.0.0a0'
REQUIRED_JUPYTER_SERVER = '>=1.1.2'
REQUIRED_PYTHON = '>=3.6,<3.9.0a0'
REQUIRED_PYTHON = '>=3.7,<3.11.0a0'

0 comments on commit 8d904f9

Please sign in to comment.