From 48afeb566c753f28014bc4ba4686ba1107bba4ac Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 15 Mar 2022 10:10:03 -0500 Subject: [PATCH 01/11] clean up ci --- .github/workflows/downstream.yml | 3 +- .github/workflows/tests.yml | 144 ++++++++++++++++++------------- setup.cfg | 11 ++- 3 files changed, 91 insertions(+), 67 deletions(-) diff --git a/.github/workflows/downstream.yml b/.github/workflows/downstream.yml index 87f8a758..43563062 100644 --- a/.github/workflows/downstream.yml +++ b/.github/workflows/downstream.yml @@ -2,9 +2,8 @@ name: Test downstream projects on: push: - branches: "main" + branches: ["main"] pull_request: - branches: "*" jobs: downstream: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4c51c1e1..9e3b28dd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,9 +2,10 @@ name: Tests on: push: - branches: 'master' + branches: ['main'] pull_request: - branches: '*' + schedule: + - cron: "0 8 * * *" defaults: run: @@ -21,7 +22,7 @@ jobs: strategy: fail-fast: false matrix: - PYTHON_VERSION: ['3.6', '3.9', 'pypy3'] + PYTHON_VERSION: ['3.7', '3.10', 'pypy3'] PLATFORM: ['ubuntu', 'macos', 'windows'] exclude: - PLATFORM: windows @@ -29,36 +30,11 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - - name: Cache pip - uses: actions/cache@v2 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-py-${{ matrix.PYTHON_VERSION }}-pip-${{ hashFiles('**/setup.py') }} - - name: Cache conda - uses: actions/cache@v2 - with: - path: ~/conda_pkgs_dir - key: - ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ - hashFiles('docs/environment.yml') }} - - name: Setup conda ${{ matrix.PYTHON_VERSION }} - uses: conda-incubator/setup-miniconda@v2 - with: - auto-update-conda: true - python-version: ${{ matrix.python-version }} - - name: Install python dependencies - run: | - conda install setuptools pip wheel - - name: Install pywin32 on Windows - if: ${{ runner.os == 'Windows' }} - run: conda install pywin32 + - name: Base Setup + uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - name: Install project dependencies run: | - pip install -v -e ".[test]" --cache-dir ~/.cache/pip - - run: conda info - - run: conda list - - run: conda config --show - - run: pip check + pip install -e ".[test]" - name: Run python tests # See `setup.cfg` for full test options run: | @@ -85,34 +61,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - - name: Install Python - uses: actions/setup-python@v2 - with: - python-version: 3.9 - architecture: "x64" - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - name: Cache pip - uses: actions/cache@v2 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('setup.cfg') }} - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}-pip- - - name: Cache checked links - if: ${{ matrix.group == 'link_check' }} - uses: actions/cache@v2 - with: - path: ~/.cache/pytest-link-check - key: ${{ runner.os }}-linkcheck-${{ hashFiles('**/*.md', '**/*.rst') }}-md-links - restore-keys: | - ${{ runner.os }}-linkcheck- - - name: Upgrade packaging dependencies - run: | - pip install --upgrade pip setuptools wheel --user + - name: Base Setup + uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - name: Install Dependencies run: | pip install -e . @@ -124,3 +74,79 @@ jobs: - name: Run Link Check if: ${{ matrix.group == 'link_check' }} uses: jupyter-server/jupyter_releaser/.github/actions/check-links@v1 + + test_miniumum_verisons: + name: Test Minimum Versions + timeout-minutes: 20 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Base Setup + uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 + with: + python_version: "3.7" + - name: Install miniumum versions + uses: jupyterlab/maintainer-tools/.github/actions/install-minimums@v1 + - name: Run the unit tests + run: pytest -vv|| pytest -vv --lf + + test_prereleases: + name: Test Prereleases + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Base Setup + uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 + - name: Install the Python dependencies + run: | + pip install --pre -e ".[test]" + - name: List installed packages + run: | + pip freeze + pip check + - name: Run the tests + run: | + pytest -vv || pytest -vv --lf + + make_sdist: + name: Make SDist + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - uses: actions/checkout@v2 + - name: Base Setup + uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 + - name: Build SDist + run: | + pip install build + python -m build --sdist + - uses: actions/upload-artifact@v2 + with: + name: "sdist" + path: dist/*.tar.gz + + test_sdist: + runs-on: ubuntu-latest + needs: [make_sdist] + name: Install from SDist and Test + timeout-minutes: 20 + steps: + - name: Base Setup + uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 + - name: Download sdist + uses: actions/download-artifact@v2 + - name: Install From SDist + run: | + set -ex + cd sdist + mkdir test + tar --strip-components=1 -zxvf *.tar.gz -C ./test + cd test + pip install .[test] + pip install pytest-github-actions-annotate-failures + - name: Run Test + run: | + cd sdist/test + pytest -vv || pytest -vv --lf diff --git a/setup.cfg b/setup.cfg index acde9326..e920d294 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,29 +16,28 @@ classifiers = Intended Audience :: Science/Research License :: OSI Approved :: BSD License Programming Language :: Python - Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 [options] zip_safe = False include_package_data = True packages = find: -python_requires = >=3.6 +python_requires = >=3.7 install_requires = babel entrypoints>=0.2.2 - jinja2>=2.10 + jinja2>=3.0.3 json5 jsonschema>=3.0.1 packaging requests - jupyter_server~=1.4 - + jupyter_server~=1.8 [options.extras_require] -test = codecov; ipykernel; pytest>=5.3.2; pytest-cov; jupyter_server[test]; openapi_core~=0.14.0; pytest-console-scripts; strict-rfc3339; ruamel.yaml; wheel +test = codecov; ipykernel; pytest>=5.3.2; pytest-cov; jupyter_server[test]; openapi_core>=0.14.0; pytest-console-scripts; strict-rfc3339; ruamel.yaml; wheel [options.packages.find] exclude = From 82a4bcb3b54b53f48b446a51c1b0b5700cfc3aa5 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 15 Mar 2022 12:04:24 -0500 Subject: [PATCH 02/11] more cleanup --- .github/workflows/tests.yml | 18 +++++++----------- jupyterlab_server/rest-api.yml | 2 +- pyproject.toml | 2 +- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9e3b28dd..fcd38fb5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,26 +7,22 @@ on: schedule: - cron: "0 8 * * *" -defaults: - run: - shell: bash -l {0} - jobs: test: - name: ${{ matrix.PLATFORM }} py${{ matrix.PYTHON_VERSION }} - runs-on: ${{ matrix.PLATFORM }}-latest + name: ${{ matrix.platform }} py${{ matrix.python_version }} + runs-on: ${{ matrix.platform }}-latest env: CI: True - PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }} + PYTHON_VERSION: ${{ matrix.python_version }} CODECOV_TOKEN: e025254a-fe54-4914-8890-0c26e7aa0d07 strategy: fail-fast: false matrix: - PYTHON_VERSION: ['3.7', '3.10', 'pypy3'] - PLATFORM: ['ubuntu', 'macos', 'windows'] + python_version: ['3.7', '3.10', 'pypy3'] + platform: ['ubuntu', 'macos', 'windows'] exclude: - - PLATFORM: windows - PYTHON_VERSION: pypy3 + - platform: windows + python_version: pypy3 steps: - name: Checkout uses: actions/checkout@v2 diff --git a/jupyterlab_server/rest-api.yml b/jupyterlab_server/rest-api.yml index b30ae0f6..07fc8947 100644 --- a/jupyterlab_server/rest-api.yml +++ b/jupyterlab_server/rest-api.yml @@ -1,5 +1,5 @@ # see me at: http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyterlab/jupyterlab_server/master/docs/rest-api.yml#/default -openapi: "3.0.3" +openapi: "3.1.3" info: title: JupyterLab Server description: The REST API for JupyterLab Server diff --git a/pyproject.toml b/pyproject.toml index 35ec7726..05cf9d5c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["jupyter_packaging>0.9,<2", "jupyter_server"] +requires = ["jupyter_packaging=>0.9", "jupyter_server"] build-backend = "setuptools.build_meta" [tool.jupyter-releaser] From d0b884f9737e38a9b71862ddf00076c6cdfd6e59 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 15 Mar 2022 12:06:19 -0500 Subject: [PATCH 03/11] fix version spec --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 05cf9d5c..5688d158 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["jupyter_packaging=>0.9", "jupyter_server"] +requires = ["jupyter_packaging>=0.9", "jupyter_server"] build-backend = "setuptools.build_meta" [tool.jupyter-releaser] From 0813aad1406128d9f23fe0657896e83121a08997 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 15 Mar 2022 12:08:09 -0500 Subject: [PATCH 04/11] fix pypy version --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fcd38fb5..3fef3b80 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: false matrix: - python_version: ['3.7', '3.10', 'pypy3'] + python_version: ['3.7', '3.10', 'pypy-3.7'] platform: ['ubuntu', 'macos', 'windows'] exclude: - platform: windows From 6c15f8b1b4e18ce935ebc45253f09508a5873935 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 15 Mar 2022 12:21:25 -0500 Subject: [PATCH 05/11] update openapi version --- jupyterlab_server/rest-api.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jupyterlab_server/rest-api.yml b/jupyterlab_server/rest-api.yml index 07fc8947..b30ae0f6 100644 --- a/jupyterlab_server/rest-api.yml +++ b/jupyterlab_server/rest-api.yml @@ -1,5 +1,5 @@ # see me at: http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyterlab/jupyterlab_server/master/docs/rest-api.yml#/default -openapi: "3.1.3" +openapi: "3.0.3" info: title: JupyterLab Server description: The REST API for JupyterLab Server From ea0d8cf9bc86c7fc005e3d00a247fe100816f86a Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 15 Mar 2022 12:54:16 -0500 Subject: [PATCH 06/11] bump openapi_core and fix docs build --- .github/workflows/tests.yml | 1 + setup.cfg | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3fef3b80..b56cf0ae 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,6 +39,7 @@ jobs: run: | codecov - name: Build docs + shell: bash -l {0} run: | set -eux pushd docs diff --git a/setup.cfg b/setup.cfg index e920d294..8a9d3ab4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -37,7 +37,7 @@ install_requires = jupyter_server~=1.8 [options.extras_require] -test = codecov; ipykernel; pytest>=5.3.2; pytest-cov; jupyter_server[test]; openapi_core>=0.14.0; pytest-console-scripts; strict-rfc3339; ruamel.yaml; wheel +test = codecov; ipykernel; pytest>=5.3.2; pytest-cov; jupyter_server[test]; openapi_core>=0.14.2; pytest-console-scripts; strict-rfc3339; ruamel.yaml; wheel [options.packages.find] exclude = From e5545857b633102607fe3babe9f357e42020fc98 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 15 Mar 2022 13:26:44 -0500 Subject: [PATCH 07/11] clean up docs build --- .github/workflows/tests.yml | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b56cf0ae..dbea7c24 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -38,17 +38,30 @@ jobs: - name: Upload coverage run: | codecov + + docs: + name: Docs Build + runs-on: ubuntu-latest + strategy: + matrix: + python_version: ['3.10'] + setps: + - name: Checkout + uses: actions/checkout@v2 + - name: Base Setup + uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 + - uses: conda-incubator/setup-miniconda@v2 + with: + auto-update-conda: true + python-version: ${{ matrix.python-version }} + activate-environment: jupyterlab_server_documentation + environment-file: docs/environment.yml - name: Build docs shell: bash -l {0} run: | - set -eux + pip install . pushd docs - conda env create -f environment.yml - conda activate jupyterlab_server_documentation - pip install .. - make html - conda deactivate - popd + make html SPHINXOPTS="-W" check_release: runs-on: ubuntu-latest From ca29b3611d3c03072ef9fcb5fcad8182813c7c7e Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 15 Mar 2022 13:30:18 -0500 Subject: [PATCH 08/11] spelling --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index dbea7c24..250f4e11 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -45,7 +45,7 @@ jobs: strategy: matrix: python_version: ['3.10'] - setps: + steps: - name: Checkout uses: actions/checkout@v2 - name: Base Setup From 3bdf99361e9b820dc16fe06527ccc317c773d1f7 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 15 Mar 2022 14:44:20 -0500 Subject: [PATCH 09/11] fix docs and pin openapi_core --- .github/workflows/tests.yml | 9 ++++----- docs/environment.yml | 3 ++- docs/source/api/handlers.rst | 2 -- setup.cfg | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 250f4e11..a17de15f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -42,9 +42,6 @@ jobs: docs: name: Docs Build runs-on: ubuntu-latest - strategy: - matrix: - python_version: ['3.10'] steps: - name: Checkout uses: actions/checkout@v2 @@ -53,13 +50,15 @@ jobs: - uses: conda-incubator/setup-miniconda@v2 with: auto-update-conda: true - python-version: ${{ matrix.python-version }} activate-environment: jupyterlab_server_documentation environment-file: docs/environment.yml - - name: Build docs + - name: Install lib shell: bash -l {0} run: | pip install . + - name: Build docs + shell: bash -l {0} + run: | pushd docs make html SPHINXOPTS="-W" diff --git a/docs/environment.yml b/docs/environment.yml index a9befbda..a4b2cf17 100644 --- a/docs/environment.yml +++ b/docs/environment.yml @@ -3,11 +3,12 @@ name: jupyterlab_server_documentation channels: - conda-forge dependencies: -- python=3.8 +- python=3.9 - sphinx<4.0 - sphinx-copybutton - pip - myst-parser +- mistune<1 - pip: - autodoc-traits - pydata_sphinx_theme diff --git a/docs/source/api/handlers.rst b/docs/source/api/handlers.rst index 4483655f..f3e13d02 100644 --- a/docs/source/api/handlers.rst +++ b/docs/source/api/handlers.rst @@ -64,8 +64,6 @@ Module: :mod:`jupyterlab_server.translations_handler` .. autoclass:: TranslationsHandler :members: -.. autofunction:: get_current_locale - Module: :mod:`jupyterlab_server.workspaces_handler` ===================================================== diff --git a/setup.cfg b/setup.cfg index 8a9d3ab4..50fa37f8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -37,7 +37,7 @@ install_requires = jupyter_server~=1.8 [options.extras_require] -test = codecov; ipykernel; pytest>=5.3.2; pytest-cov; jupyter_server[test]; openapi_core>=0.14.2; pytest-console-scripts; strict-rfc3339; ruamel.yaml; wheel +test = codecov; ipykernel; pytest>=5.3.2; pytest-cov; jupyter_server[test]; openapi_core>=0.14.2<0.16.0; pytest-console-scripts; strict-rfc3339; ruamel.yaml; wheel [options.packages.find] exclude = From 5d01f92a0f09b6fe5b494f578f4f049b11054c66 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 15 Mar 2022 14:55:06 -0500 Subject: [PATCH 10/11] fix versions --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 50fa37f8..1b3952a4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -37,7 +37,7 @@ install_requires = jupyter_server~=1.8 [options.extras_require] -test = codecov; ipykernel; pytest>=5.3.2; pytest-cov; jupyter_server[test]; openapi_core>=0.14.2<0.16.0; pytest-console-scripts; strict-rfc3339; ruamel.yaml; wheel +test = codecov; ipykernel; pytest>=5.3.2; pytest-cov; jupyter_server[test]; openapi_core>=0.14.2; pytest-console-scripts; strict-rfc3339; ruamel.yaml; wheel; openapi-spec-validator<0.5 [options.packages.find] exclude = From b4d8720687f769681c098df36f455ea47a4a42b6 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 15 Mar 2022 15:00:24 -0500 Subject: [PATCH 11/11] clean up test names --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a17de15f..11c006db 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,7 +9,7 @@ on: jobs: test: - name: ${{ matrix.platform }} py${{ matrix.python_version }} + name: ${{ matrix.platform }} ${{ matrix.python_version }} runs-on: ${{ matrix.platform }}-latest env: CI: True