Skip to content

Commit 819dce5

Browse files
authored
Include Tests in Sdist But Not Wheel (#239)
1 parent 655d8e9 commit 819dce5

File tree

38 files changed

+21
-24
lines changed

38 files changed

+21
-24
lines changed

.github/workflows/downstream.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches: "*"
88

99
jobs:
10-
tests:
10+
downstream:
1111
runs-on: ubuntu-latest
1212
timeout-minutes: 15
1313

@@ -22,4 +22,5 @@ jobs:
2222
uses: jupyterlab/maintainer-tools/.github/actions/downstream-test@v1
2323
with:
2424
package_name: jupyterlab
25+
package_spec: "\".[test]\""
2526
test_command: "python -m jupyterlab.browser_check --no-browser-test"

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
- name: Run python tests
6363
# See `setup.cfg` for full test options
6464
run: |
65-
pytest --pyargs jupyterlab_server
65+
pytest
6666
- name: Upload coverage
6767
run: |
6868
codecov

MANIFEST.in

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ include *.md
22
include LICENSE
33
include jupyterlab_server/rest-api.yml
44
include jupyterlab_server/templates/*.html
5-
recursive-include jupyterlab_server/tests *.json *.json.orig *.jupyterlab-workspace
5+
recursive-include tests *.*
66
recursive-include docs *.*
7+
78
include docs/Makefile
89

910
prune docs/build
10-
11-
# prune translation test data to avoid long path limits on Windows
12-
prune jupyterlab_server/tests/translations
11+
recursive-exclude tests/translations/**/build *.*
1312

1413
# Patterns to exclude from any directory
1514
global-exclude *~

jupyterlab_server/tests/conftest.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ skip = ["check-links"]
77

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

1212
[tool.tbump.version]
1313
current = "2.10.3"

setup.cfg

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,6 @@ install_requires =
4141
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
4242

4343
[options.packages.find]
44-
exclude = ['docs*']
44+
exclude =
45+
docs*
46+
tests*
File renamed without changes.
File renamed without changes.

jupyterlab_server/pytest_plugin.py renamed to tests/conftest.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ def mkdir(tmp_path, *parts):
1919
path.mkdir(parents=True)
2020
return path
2121

22+
HERE = os.path.abspath(os.path.dirname(__file__))
23+
2224
app_settings_dir = pytest.fixture(lambda tmp_path: mkdir(tmp_path, 'app_settings'))
2325
user_settings_dir = pytest.fixture(lambda tmp_path: mkdir(tmp_path, 'user_settings'))
2426
schemas_dir = pytest.fixture(lambda tmp_path: mkdir(tmp_path, 'schemas'))
@@ -85,8 +87,7 @@ def _make_labserver_extension_app(**kwargs):
8587

8688
# Copy the schema files.
8789
src = pjoin(
88-
os.path.abspath(os.path.dirname(__file__)),
89-
'tests',
90+
HERE,
9091
'schemas',
9192
'@jupyterlab')
9293
dst = pjoin(str(schemas_dir), '@jupyterlab')
@@ -99,8 +100,7 @@ def _make_labserver_extension_app(**kwargs):
99100
target_name = name + '-federated'
100101
target = pjoin(str(labextensions_dir), '@jupyterlab', target_name)
101102
src = pjoin(
102-
os.path.abspath(os.path.dirname(__file__)),
103-
'tests',
103+
HERE,
104104
'schemas',
105105
'@jupyterlab',
106106
name)
@@ -114,8 +114,7 @@ def _make_labserver_extension_app(**kwargs):
114114

115115
# Copy the overrides file.
116116
src = pjoin(
117-
os.path.abspath(os.path.dirname(__file__)),
118-
'tests',
117+
HERE,
119118
'app-settings',
120119
'overrides.json')
121120
dst = pjoin(str(app_settings_dir), 'overrides.json')
@@ -125,8 +124,7 @@ def _make_labserver_extension_app(**kwargs):
125124

126125
# Copy workspaces.
127126
data = pjoin(
128-
os.path.abspath(os.path.dirname(__file__)),
129-
'tests',
127+
HERE,
130128
'workspaces')
131129
for item in os.listdir(data):
132130
src = pjoin(data, item)
File renamed without changes.

0 commit comments

Comments
 (0)