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

Include Tests in Sdist But Not Wheel #239

Merged
merged 5 commits into from Mar 15, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/downstream.yml
Expand Up @@ -7,7 +7,7 @@ on:
branches: "*"

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

Expand All @@ -22,4 +22,5 @@ jobs:
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"
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Expand Up @@ -62,7 +62,7 @@ jobs:
- name: Run python tests
# See `setup.cfg` for full test options
run: |
pytest --pyargs jupyterlab_server
pytest
- name: Upload coverage
run: |
codecov
Expand Down
7 changes: 3 additions & 4 deletions MANIFEST.in
Expand Up @@ -2,14 +2,13 @@ include *.md
include LICENSE
include jupyterlab_server/rest-api.yml
include jupyterlab_server/templates/*.html
recursive-include jupyterlab_server/tests *.json *.json.orig *.jupyterlab-workspace
recursive-include tests *.*
recursive-include docs *.*

include docs/Makefile

prune docs/build

# prune translation test data to avoid long path limits on Windows
prune jupyterlab_server/tests/translations
recursive-exclude tests/translations/**/build *.*

# Patterns to exclude from any directory
global-exclude *~
Expand Down
4 changes: 0 additions & 4 deletions jupyterlab_server/tests/conftest.py

This file was deleted.

2 changes: 1 addition & 1 deletion pyproject.toml
Expand Up @@ -7,7 +7,7 @@ skip = ["check-links"]

[tool.check-manifest]
ignore = ["tbump.toml", ".*", "*.yml", "docs/source/api/app-config.rst", "docs/source/changelog.md"]
ignore-bad-ideas = ["jupyterlab_server/tests/translations/**/*.mo"]
ignore-bad-ideas = ["tests/translations/**/*.mo"]

[tool.tbump.version]
current = "2.10.3"
Expand Down
4 changes: 3 additions & 1 deletion setup.cfg
Expand Up @@ -41,4 +41,6 @@ install_requires =
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 = ['docs*']
exclude =
docs*
tests*

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@blink1073 I think this is responsible for this error:

ImportError: Error importing plugin "jupyterlab_server.pytest_plugin": No module named 'jupyterlab_server.pytest_plugin'

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I'll make a fix

File renamed without changes.
14 changes: 6 additions & 8 deletions jupyterlab_server/pytest_plugin.py → tests/conftest.py
Expand Up @@ -19,6 +19,8 @@ def mkdir(tmp_path, *parts):
path.mkdir(parents=True)
return path

HERE = os.path.abspath(os.path.dirname(__file__))

app_settings_dir = pytest.fixture(lambda tmp_path: mkdir(tmp_path, 'app_settings'))
user_settings_dir = pytest.fixture(lambda tmp_path: mkdir(tmp_path, 'user_settings'))
schemas_dir = pytest.fixture(lambda tmp_path: mkdir(tmp_path, 'schemas'))
Expand Down Expand Up @@ -85,8 +87,7 @@ def _make_labserver_extension_app(**kwargs):

# Copy the schema files.
src = pjoin(
os.path.abspath(os.path.dirname(__file__)),
'tests',
HERE,
'schemas',
'@jupyterlab')
dst = pjoin(str(schemas_dir), '@jupyterlab')
Expand All @@ -99,8 +100,7 @@ def _make_labserver_extension_app(**kwargs):
target_name = name + '-federated'
target = pjoin(str(labextensions_dir), '@jupyterlab', target_name)
src = pjoin(
os.path.abspath(os.path.dirname(__file__)),
'tests',
HERE,
'schemas',
'@jupyterlab',
name)
Expand All @@ -114,8 +114,7 @@ def _make_labserver_extension_app(**kwargs):

# Copy the overrides file.
src = pjoin(
os.path.abspath(os.path.dirname(__file__)),
'tests',
HERE,
'app-settings',
'overrides.json')
dst = pjoin(str(app_settings_dir), 'overrides.json')
Expand All @@ -125,8 +124,7 @@ def _make_labserver_extension_app(**kwargs):

# Copy workspaces.
data = pjoin(
os.path.abspath(os.path.dirname(__file__)),
'tests',
HERE,
'workspaces')
for item in os.listdir(data):
src = pjoin(data, item)
Expand Down
File renamed without changes.
Expand Up @@ -8,8 +8,9 @@
import pytest
import mistune

from .. import LicensesApp
from ..licenses_handler import DEFAULT_THIRD_PARTY_LICENSE_FILE, LicensesManager
from jupyterlab_server import LicensesApp
from jupyterlab_server.licenses_handler import DEFAULT_THIRD_PARTY_LICENSE_FILE, LicensesManager


# utilities

Expand Down
File renamed without changes.
Expand Up @@ -8,7 +8,7 @@
import sys

from .utils import expected_http_error
from ..translation_utils import (_get_installed_language_pack_locales,
from jupyterlab_server.translation_utils import (_get_installed_language_pack_locales,
_get_installed_package_locales,
get_display_name,
get_installed_packages_locale,
Expand Down
2 changes: 1 addition & 1 deletion jupyterlab_server/tests/utils.py → tests/utils.py
Expand Up @@ -96,7 +96,7 @@ def wrap_response(response):

def validate_request(response):
"""Validate an API request"""
path = (Path(__file__) / '../../rest-api.yml').resolve()
path = (Path(here) / '../jupyterlab_server/rest-api.yml').resolve()
yaml = YAML(typ='safe')
spec_dict = yaml.load(path.read_text(encoding='utf-8'))
spec = create_spec(spec_dict)
Expand Down