Skip to content

Commit f5f6c63

Browse files
authored
Preflight 1.3.0 (QuantStack#114)
1 parent 3765c72 commit f5f6c63

File tree

16 files changed

+150
-129
lines changed

16 files changed

+150
-129
lines changed

.binder/environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ dependencies:
102102
- ssort
103103
# unit testing
104104
- pytest
105+
- pytest-cov
105106
- pytest-console-scripts
106107
- pytest-html
107108
- pytest-jupyter-server

.github/environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ dependencies:
5050
- ssort
5151
# unit testing
5252
- pytest
53+
- pytest-cov
5354
- pytest-console-scripts
5455
- pytest-html
5556
- pytest-jupyter-server

.github/pull_request_template.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<!--
2+
Thanks for contributing to ipydrawio!
3+
Please fill out the following items to submit a pull request.
4+
See the contributing guidelines for more information:
5+
https://github.com/deathbeds/ipydrawio/blob/master/CONTRIBUTING.md
6+
-->
7+
8+
## References
9+
10+
<!-- Note issue numbers this pull request addresses (should be at least one, see contributing guidelines above). -->
11+
12+
<!-- Note any other pull requests that address this issue and how this pull request is different. -->
13+
14+
## Code changes
15+
16+
<!-- Describe the code changes and how they address the issue. -->
17+
18+
## User-facing changes
19+
20+
<!-- Describe any visual or user interaction changes and how they address the issue. -->
21+
22+
<!-- For visual changes, include before and after screenshots here. -->
23+
24+
## Backwards-incompatible changes
25+
26+
<!-- Describe any backwards-incompatible changes to IPyDrawio public APIs. -->
27+
28+
## Chores
29+
30+
- [ ] ran `doit lint`
31+
- [ ] updated `CHANGELOG.md`
32+
- [ ] validated on binder
33+
- [ ] validated on ReadTheDocs
34+
35+
<!--
36+
# Copyright 2023 ipydrawio contributors
37+
#
38+
# Licensed under the Apache License, Version 2.0 (the "License");
39+
# you may not use this file except in compliance with the License.
40+
# You may obtain a copy of the License at
41+
#
42+
# http://www.apache.org/licenses/LICENSE-2.0
43+
#
44+
# Unless required by applicable law or agreed to in writing, software
45+
# distributed under the License is distributed on an "AS IS" BASIS,
46+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
47+
# See the License for the specific language governing permissions and
48+
# limitations under the License.
49+
-->

.github/workflows/badges.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ jobs:
4545
issue_number: context.issue.number,
4646
owner: context.repo.owner,
4747
repo: context.repo.repo,
48-
body: `Try this PR on [![](${LITE})](${RTD}) :arrow_left: ReadTheDocs or Binder :arrow_right: [![](${BND})](${BH})`,
48+
body: `Try this PR on [![RTD](${LITE})](${RTD}) :arrow_left: ReadTheDocs or Binder :arrow_right: [![Binder](${BND})](${BH})`,
4949
});

.github/workflows/ci.yml

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
if: steps.cache-node-modules.outputs.cache-hit != 'true'
9292
id: cache-yarn-packages
9393
with:
94-
path: .yarn-packages
94+
path: ./build/.cache/.yarn-packages
9595
key: |
9696
${{ env.CACHE_EPOCH }}-yarn-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
9797
restore-keys: |
@@ -296,21 +296,13 @@ jobs:
296296
cd ../ipydrawio-mathjax
297297
codecov --root ../..
298298
299-
- name: upload (utest)
299+
- name: upload (reports)
300300
if: always()
301301
uses: actions/upload-artifact@v3
302302
with:
303303
name: |-
304-
ipydrawio-${{ github.run_number }}-utest-${{ matrix.os }}-${{ matrix.python-version }}
305-
path: ./build/pytest
306-
307-
- name: upload (atest)
308-
if: always()
309-
uses: actions/upload-artifact@v3
310-
with:
311-
name: |-
312-
ipydrawio-${{ github.run_number }}-atest-${{ matrix.os }}-${{matrix.python-version }}
313-
path: ./build/atest
304+
ipydrawio-${{ github.run_number }}-reports-${{ matrix.os }}-${{matrix.python-version }}
305+
path: ./build/reports
314306

315307
- name: Rename uncached conda packages
316308
shell: bash
@@ -343,7 +335,7 @@ jobs:
343335
if: steps.cache-node-modules.outputs.cache-hit != 'true'
344336
id: cache-yarn-packages
345337
with:
346-
path: .yarn-packages
338+
path: ./build/.cache/.yarn-packages
347339
key: |
348340
${{ env.CACHE_EPOCH }}-yarn-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
349341
restore-keys: |
@@ -399,7 +391,7 @@ jobs:
399391
if: steps.cache-node-modules.outputs.cache-hit != 'true'
400392
id: cache-yarn-packages
401393
with:
402-
path: .yarn-packages
394+
path: ./build/.cache/.yarn-packages
403395
key: |
404396
${{ env.CACHE_EPOCH }}-yarn-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
405397
restore-keys: |
@@ -430,12 +422,12 @@ jobs:
430422
shell: bash -l {0}
431423
run: doit test:robot
432424

433-
- name: upload (atest)
425+
- name: upload (reports)
434426
if: always()
435427
uses: actions/upload-artifact@v3
436428
with:
437429
name: |-
438-
ipydrawio-${{ github.run_number }}-atest-${{ matrix.os }}${{ matrix.python-version }}
430+
ipydrawio-${{ github.run_number }}-reports-${{ matrix.os }}${{ matrix.python-version }}
439431
path: ./build/atest
440432

441433
- name: upload (docs)

.yarnrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ ignore-scripts true
33
network-timeout "300000"
44
prefer-offline true
55
registry "https://registry.npmjs.org/"
6-
yarn-offline-mirror "./.yarn-packages"
6+
yarn-offline-mirror "./build/.cache/.yarn-packages"
77
yarn-offline-mirror-pruning true

CONTRIBUTING.md

Lines changed: 10 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@
1414

1515
## Prerequisites
1616

17-
- `jupyterlab >=3,<4`
18-
- `nodejs >=12`
1917
- `doit >=0.32`
18+
- `jupyterlab >=3,<4`
19+
- `nodejs >=18,<19`
20+
- `python >=3.8`
2021

21-
### Recommended: conda
22+
### Recommended: `mamba`
2223

2324
- Get [Miniforge/Mambaforge](https://github.com/conda-forge/miniforge/releases)
2425

@@ -76,38 +77,12 @@ doit dist
7677

7778
## Releasing
7879

79-
- [ ] start a release issue with a checklist (maybe like this one)
80-
- [ ] merge all outstanding PRs
81-
- [ ] ensure the versions have been bumped (check with `doit test:integrity`)
82-
- [ ] ensure the CHANGELOG is up-to-date
83-
- [ ] move the new release to the top of the stack
84-
- [ ] validate on binder
85-
- [ ] validate on ReadTheDocs
86-
- [ ] wait for a successful build of `master`
87-
- [ ] download the `dist` archive and unpack somewhere (maybe a fresh `dist`)
88-
- [ ] create a new release through the GitHub UI
89-
- [ ] paste in the relevant CHANGELOG entries
90-
- [ ] upload the artifacts
91-
- [ ] actually upload to npm.com, pypi.org
92-
```bash
93-
cd dist
94-
twine upload ipydrawio*
95-
npm login
96-
npm publish deathbeds-ipydrawio-$VERSION.tgz
97-
npm publish deathbeds-ipydrawio-jupyter-templates-$VERSION.tgz
98-
npm publish deathbeds-ipydrawio-notebook-$VERSION.tgz
99-
npm publish deathbeds-ipydrawio-pdf-$VERSION.tgz
100-
npm publish deathbeds-ipydrawio-webpack-$OTHER_VERSION.tgz
101-
npm logout
102-
```
103-
- [ ] postmortem
104-
- [ ] handle `conda-forge` feedstock tasks
105-
- [ ] validate on binder via simplest-possible gists
106-
- [ ] activate the version on ReadTheDocs
107-
- [ ] bump to next development version
108-
- [ ] update release procedures
80+
- Start a [release] issue on GitHub
81+
- Follow the checklist
10982

110-
```
83+
[release]: https://github.com/deathbeds/ipydrawio/issues/new?template=release.md
84+
85+
<!--
11186
Copyright 2023 ipydrawio contributors
11287
11388
Licensed under the Apache License, Version 2.0 (the "License");
@@ -121,4 +96,4 @@ distributed under the License is distributed on an "AS IS" BASIS,
12196
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12297
See the License for the specific language governing permissions and
12398
limitations under the License.
124-
```
99+
-->

demo/jupyter_lite_config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"ignore_sys_prefix": true,
1313
"lite_dir": ".",
1414
"output_archive": "../build/demo/ipydrawio-lite-1.3.0.tgz",
15-
"output_dir": "../build/demo"
15+
"output_dir": "../build/demo",
16+
"cache_dir": "../build/.cache/.lite"
1617
},
1718
"PipliteAddon": {
1819
"piplite_urls": [

docs/environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ dependencies:
7373
- ssort
7474
# unit testing
7575
- pytest
76+
- pytest-cov
7677
- pytest-console-scripts
7778
- pytest-html
7879
- pytest-jupyter-server

dodo.py

Lines changed: 24 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -942,14 +942,10 @@ def task_provision():
942942
)
943943

944944

945-
def _pytest(setup_py, pycov_args, pytest_args):
945+
def _pytest(setup_py, pytest_args):
946946
return CmdAction(
947947
[
948948
*P.PYM,
949-
"coverage",
950-
"run",
951-
*pycov_args,
952-
"-m",
953949
"pytest",
954950
*P.PYTEST_ARGS,
955951
*pytest_args,
@@ -963,30 +959,6 @@ def _pytest(setup_py, pycov_args, pytest_args):
963959
)
964960

965961

966-
def _pycov_combine(setup_py):
967-
return CmdAction(
968-
[*P.PYM, "coverage", "combine"],
969-
shell=False,
970-
cwd=str(setup_py.parent),
971-
)
972-
973-
974-
def _pycov_report(setup_py):
975-
return CmdAction(
976-
[*P.PYM, "coverage", "report", "--skip-covered", "--show-missing"],
977-
shell=False,
978-
cwd=str(setup_py.parent),
979-
)
980-
981-
982-
def _pycov_html(setup_py, *pycov_html_args):
983-
return CmdAction(
984-
[*P.PYM, "coverage", "html", *pycov_html_args],
985-
shell=False,
986-
cwd=str(setup_py.parent),
987-
)
988-
989-
990962
def task_test():
991963
"""Run tests."""
992964
if not P.TESTING_IN_CI:
@@ -1006,24 +978,39 @@ def task_test():
1006978
P.SCRIPTS / "integrity.py",
1007979
],
1008980
"actions": [
1009-
["python", "-m", "pytest", "--pyargs", "scripts.integrity", "-vv"],
981+
[
982+
*P.PYM,
983+
"pytest",
984+
"--pyargs",
985+
"scripts.integrity",
986+
"-vv",
987+
*("-o", f"""cache_dir={P.CACHE / ".pytest.integrity"}"""),
988+
],
1010989
],
1011990
},
1012991
P.OK_INTEGRITY,
1013992
)
1014993

1015994
for pkg, setup in P.PY_SETUP.items():
1016-
html = P.BUILD / f"pytest/{pkg}/test.html"
1017-
htmlcov = P.BUILD / f"pytest/{pkg}/htmlcov"
995+
report_dir = P.REPORTS / "pytest" / pkg
996+
html = report_dir / "pytest.html"
997+
cov_index = report_dir / "htmlcov" / "index.html"
998+
cache_dir = P.CACHE / f".pytest.{pkg}"
1018999
pytest_args = [
10191000
"-vv",
10201001
"--tb=long",
1002+
*("-o", f"cache_dir={cache_dir}"),
1003+
# subs
1004+
"--script-launch-mode=subprocess",
1005+
# report
10211006
f"--html={html}",
10221007
"--self-contained-html",
1023-
"--script-launch-mode=subprocess",
1008+
# cov
1009+
"--cov-context=test",
1010+
f"""--cov={pkg.replace("-", "_")}""",
1011+
f"--cov-report=html:{cov_index.parent}",
1012+
"--cov-branch",
10241013
]
1025-
pycov_args = []
1026-
pycov_html_args = [f"--directory={htmlcov.parent}"]
10271014

10281015
if pkg == P.IPD.name:
10291016
pytest_args += ["-n", "auto"]
@@ -1041,12 +1028,9 @@ def task_test():
10411028
],
10421029
"actions": [
10431030
(P.delete_some, [html]),
1044-
_pytest(setup, pycov_args, pytest_args),
1045-
_pycov_combine(setup),
1046-
_pycov_html(setup, *pycov_html_args),
1047-
_pycov_report(setup),
1031+
_pytest(setup, pytest_args),
10481032
],
1049-
"targets": [html],
1033+
"targets": [html, cov_index],
10501034
},
10511035
P.OK_PYTEST[pkg],
10521036
)

py_packages/ipydrawio-export/setup.cfg

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ classifiers =
3939
License :: OSI Approved :: Apache Software License
4040
Programming Language :: Python
4141
Programming Language :: Python :: 3 :: Only
42-
Programming Language :: Python :: 3.7
4342
Programming Language :: Python :: 3.8
4443
Programming Language :: Python :: 3.9
4544
Programming Language :: Python :: 3.10
@@ -85,3 +84,6 @@ source_pkgs =
8584
ipydrawio_export
8685
concurrency = multiprocessing
8786
parallel = True
87+
88+
[coverage:html]
89+
show_contexts = True

py_packages/ipydrawio-mathjax/setup.cfg

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ classifiers =
3939
License :: OSI Approved :: Apache Software License
4040
Programming Language :: Python
4141
Programming Language :: Python :: 3 :: Only
42-
Programming Language :: Python :: 3.7
4342
Programming Language :: Python :: 3.8
4443
Programming Language :: Python :: 3.9
4544
Programming Language :: Python :: 3.10
@@ -73,3 +72,6 @@ source_pkgs =
7372
ipydrawio_mathjax
7473
concurrency = multiprocessing
7574
parallel = True
75+
76+
[coverage:html]
77+
show_contexts = True

py_packages/ipydrawio-widgets/setup.cfg

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ classifiers =
3737
License :: OSI Approved :: Apache Software License
3838
Programming Language :: Python
3939
Programming Language :: Python :: 3 :: Only
40-
Programming Language :: Python :: 3.7
4140
Programming Language :: Python :: 3.8
4241
Programming Language :: Python :: 3.9
4342
Programming Language :: Python :: 3.10
@@ -72,3 +71,6 @@ source_pkgs =
7271
ipydrawio_widgets
7372
concurrency = multiprocessing
7473
parallel = True
74+
75+
[coverage:html]
76+
show_contexts = True

py_packages/ipydrawio/setup.cfg

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ classifiers =
4040
License :: OSI Approved :: Apache Software License
4141
Programming Language :: Python
4242
Programming Language :: Python :: 3 :: Only
43-
Programming Language :: Python :: 3.7
4443
Programming Language :: Python :: 3.8
4544
Programming Language :: Python :: 3.9
4645
Programming Language :: Python :: 3.10
@@ -91,3 +90,6 @@ source_pkgs =
9190
ipydrawio
9291
concurrency = multiprocessing
9392
parallel = True
93+
94+
[coverage:html]
95+
show_contexts = True

0 commit comments

Comments
 (0)