Skip to content
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

Clean up CI #241

Merged
merged 11 commits into from
Mar 16, 2022
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
3 changes: 1 addition & 2 deletions .github/workflows/downstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ name: Test downstream projects

on:
push:
branches: "main"
branches: ["main"]
pull_request:
branches: "*"

jobs:
downstream:
Expand Down
187 changes: 111 additions & 76 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,80 +2,65 @@ name: Tests

on:
push:
branches: 'master'
branches: ['main']
pull_request:
branches: '*'

defaults:
run:
shell: bash -l {0}
schedule:
- cron: "0 8 * * *"

jobs:
test:
name: ${{ matrix.PLATFORM }} py${{ matrix.PYTHON_VERSION }}
runs-on: ${{ matrix.PLATFORM }}-latest
name: ${{ matrix.platform }} ${{ 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.6', '3.9', 'pypy3']
PLATFORM: ['ubuntu', 'macos', 'windows']
python_version: ['3.7', '3.10', 'pypy-3.7']
platform: ['ubuntu', 'macos', 'windows']
exclude:
- PLATFORM: windows
PYTHON_VERSION: pypy3
- platform: windows
python_version: pypy3
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: |
pytest
- name: Upload coverage
run: |
codecov

docs:
name: Docs Build
runs-on: ubuntu-latest
steps:
- 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
activate-environment: jupyterlab_server_documentation
environment-file: docs/environment.yml
- name: Install lib
shell: bash -l {0}
run: |
pip install .
- name: Build docs
shell: bash -l {0}
run: |
set -eux
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
Expand All @@ -85,34 +70,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 .
Expand All @@ -124,3 +83,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
3 changes: 2 additions & 1 deletion docs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions docs/source/api/handlers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ Module: :mod:`jupyterlab_server.translations_handler`
.. autoclass:: TranslationsHandler
:members:

.. autofunction:: get_current_locale


Module: :mod:`jupyterlab_server.workspaces_handler`
=====================================================
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
11 changes: 5 additions & 6 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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.2; pytest-console-scripts; strict-rfc3339; ruamel.yaml; wheel; openapi-spec-validator<0.5

[options.packages.find]
exclude =
Expand Down