Skip to content

Commit

Permalink
Merge pull request #91 from blink1073/clean-sdist
Browse files Browse the repository at this point in the history
Clean up packaging and CI
  • Loading branch information
Zsailer authored Mar 15, 2022
2 parents dd8a457 + 3f68d03 commit 30510b6
Show file tree
Hide file tree
Showing 9 changed files with 110 additions and 32 deletions.
1 change: 1 addition & 0 deletions .github/workflows/check-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
strategy:
matrix:
group: [check_release, link_check]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/downstream.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test JupyterLab
name: Test Downstream

on:
push:
Expand All @@ -7,7 +7,7 @@ on:
branches: "*"

jobs:
tests:
downstream:
runs-on: ubuntu-latest
timeout-minutes: 15

Expand All @@ -22,10 +22,12 @@ jobs:
uses: jupyterlab/maintainer-tools/.github/actions/downstream-test@v1
with:
package_name: jupyterlab_server
test_command: pytest --pyargs jupyterlab_server

- name: Test jupyterlab
uses: jupyterlab/maintainer-tools/.github/actions/downstream-test@v1
with:
package_name: jupyterlab
package_spec: "\".[test]\""
test_command: "python -m jupyterlab.browser_check --no-browser-test"

122 changes: 97 additions & 25 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
branches:
- master
pull_request:
branches: "*"

jobs:
build:
Expand All @@ -14,33 +13,15 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu, macos, windows]
python-version: ["3.7", "3.8", "3.9", "pypy-3.7-v7.3.5"]
python-version: ["3.7", "3.8", "3.9", "3.10", "pypy-3.7"]
exclude:
- os: windows
python-version: pypy-3.7-v7.3.5
python-version: pypy-3.7
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: "x64"
- name: Upgrade packaging dependencies
run: |
pip install --upgrade pip setuptools wheel --user
- 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-${{ matrix.python-version }}-${{ hashFiles('setup.cfg') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
${{ runner.os }}-pip-
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Install pip dependencies
run: |
pip install -v -e ".[test]" pytest-cov
Expand All @@ -51,6 +32,97 @@ jobs:
- name: Run the help command
run: |
jupyter nbclassic -h
- name: Test with pytest
- name: Test with pytest and coverage
if: ${{ matrix.python-version != 'pypy-3.7' }}
run: |
pytest -vv --cov=nbclassic --cov-report term-missing:skip-covered || pytest -vv --cov=nbclassic --cov-report term-missing:skip-covered
- name: Run the tests on pypy
if: ${{ matrix.python-version == 'pypy-3.7' }}
run: |
pytest -vv || pytest -vv -lf
- name: Test Running Server
if: startsWith(runner.os, 'Linux')
run: |
jupyter nbclassic --no-browser &
TASK_PID=$!
# Make sure the task is running
ps -p $TASK_PID || exit 1
sleep 5
kill $TASK_PID
wait $TASK_PID
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 -e .[test]
pip install pytest-github-actions-annotate-failures
- name: Run Test
run: |
pytest -vv --cov=nbclassic nbclassic --cov-report term-missing:skip-covered
cd sdist/test
pytest -vv || pytest -vv --lf
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ include LICENSE
include *.md
recursive-include docs *.md
recursive-include nbclassic *.py
recursive-include tests *.py
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ requires = ["jupyter_packaging~=0.9,<2"]
build-backend = "jupyter_packaging.build_api"

[tool.check-manifest]
ignore = ["tbump.toml", ".*", "conftest.py"]
ignore = ["tbump.toml", ".*"]

[tool.pytest.ini_options]
addopts = "--doctest-modules"
norecursedirs = ["confs"]
testpaths = [
"nbclassic/tests"
"tests"
]

[tool.jupyter-releaser]
Expand Down
8 changes: 5 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ 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
Expand All @@ -29,7 +29,7 @@ python_requires = >=3.7
install_requires =
notebook<7
notebook_shim>=0.1.0
jupyter_server~=1.8
jupyter_server>=1.8

[options.data_files]
etc/jupyter/jupyter_server_config.d =
Expand All @@ -47,7 +47,9 @@ console_scripts =
jupyter-nbclassic = nbclassic.notebookapp:main

[options.packages.find]
exclude = ['docs*']
exclude =
docs*,
tests*

[flake8]
ignore = E, C, W, F401, F403, F811, F841, E402, I100, I101, D400
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 30510b6

Please sign in to comment.