diff --git a/.github/workflows/job.test.yml b/.github/workflows/job.test.yml index c6070313c..7505dc054 100644 --- a/.github/workflows/job.test.yml +++ b/.github/workflows/job.test.yml @@ -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} @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 }}' diff --git a/.gitignore b/.gitignore index 110bd567c..995b52c06 100644 --- a/.gitignore +++ b/.gitignore @@ -120,4 +120,4 @@ _build .idea/ # Built labextensions -python_packages/jupyterlab_lsp/jupyterlab_lsp/labextensions/ +python_packages/*/*/labextensions/ diff --git a/.readthedocs.yml b/.readthedocs.yml index 71f48d501..dad7858cd 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -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 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3a329ef82..a65564105 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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`) diff --git a/README.md b/README.md index 1b952372f..7be4232eb 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/binder/environment.yml b/binder/environment.yml index cb7f4eab2..548fa4c72 100644 --- a/binder/environment.yml +++ b/binder/environment.yml @@ -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 diff --git a/docs/rtd.yml b/docs/rtd.yml index 9bb446ad1..1d4bc54b2 100644 --- a/docs/rtd.yml +++ b/docs/rtd.yml @@ -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 diff --git a/python_packages/jupyter_lsp/jupyter_lsp/tests/conftest.py b/python_packages/jupyter_lsp/jupyter_lsp/tests/conftest.py index 26b61803a..0a4bcd6f4 100644 --- a/python_packages/jupyter_lsp/jupyter_lsp/tests/conftest.py +++ b/python_packages/jupyter_lsp/jupyter_lsp/tests/conftest.py @@ -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, diff --git a/python_packages/jupyter_lsp/jupyter_lsp/tests/test_paths.py b/python_packages/jupyter_lsp/jupyter_lsp/tests/test_paths.py index f395b334a..9455fd89f 100644 --- a/python_packages/jupyter_lsp/jupyter_lsp/tests/test_paths.py +++ b/python_packages/jupyter_lsp/jupyter_lsp/tests/test_paths.py @@ -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") diff --git a/python_packages/jupyter_lsp/setup.cfg b/python_packages/jupyter_lsp/setup.cfg index 816f53255..aaa398f94 100644 --- a/python_packages/jupyter_lsp/setup.cfg +++ b/python_packages/jupyter_lsp/setup.cfg @@ -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 diff --git a/python_packages/jupyterlab_lsp/setup.cfg b/python_packages/jupyterlab_lsp/setup.cfg index 651237297..05800bfe3 100644 --- a/python_packages/jupyterlab_lsp/setup.cfg +++ b/python_packages/jupyterlab_lsp/setup.cfg @@ -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 diff --git a/requirements/github-actions.yml b/requirements/github-actions.yml index 6ffa82834..8e8ef2eaa 100644 --- a/requirements/github-actions.yml +++ b/requirements/github-actions.yml @@ -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 diff --git a/versions.py b/versions.py index 9f182129c..b13b4cad9 100644 --- a/versions.py +++ b/versions.py @@ -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'