Skip to content

Commit

Permalink
Preflight 1.3.0 (QuantStack#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
bollwyvl authored Apr 10, 2023
1 parent 3765c72 commit f5f6c63
Show file tree
Hide file tree
Showing 16 changed files with 150 additions and 129 deletions.
1 change: 1 addition & 0 deletions .binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ dependencies:
- ssort
# unit testing
- pytest
- pytest-cov
- pytest-console-scripts
- pytest-html
- pytest-jupyter-server
Expand Down
1 change: 1 addition & 0 deletions .github/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ dependencies:
- ssort
# unit testing
- pytest
- pytest-cov
- pytest-console-scripts
- pytest-html
- pytest-jupyter-server
Expand Down
49 changes: 49 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!--
Thanks for contributing to ipydrawio!
Please fill out the following items to submit a pull request.
See the contributing guidelines for more information:
https://github.com/deathbeds/ipydrawio/blob/master/CONTRIBUTING.md
-->

## References

<!-- Note issue numbers this pull request addresses (should be at least one, see contributing guidelines above). -->

<!-- Note any other pull requests that address this issue and how this pull request is different. -->

## Code changes

<!-- Describe the code changes and how they address the issue. -->

## User-facing changes

<!-- Describe any visual or user interaction changes and how they address the issue. -->

<!-- For visual changes, include before and after screenshots here. -->

## Backwards-incompatible changes

<!-- Describe any backwards-incompatible changes to IPyDrawio public APIs. -->

## Chores

- [ ] ran `doit lint`
- [ ] updated `CHANGELOG.md`
- [ ] validated on binder
- [ ] validated on ReadTheDocs

<!--
# Copyright 2023 ipydrawio contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-->
2 changes: 1 addition & 1 deletion .github/workflows/badges.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ jobs:
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Try this PR on [![](${LITE})](${RTD}) :arrow_left: ReadTheDocs or Binder :arrow_right: [![](${BND})](${BH})`,
body: `Try this PR on [![RTD](${LITE})](${RTD}) :arrow_left: ReadTheDocs or Binder :arrow_right: [![Binder](${BND})](${BH})`,
});
24 changes: 8 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
if: steps.cache-node-modules.outputs.cache-hit != 'true'
id: cache-yarn-packages
with:
path: .yarn-packages
path: ./build/.cache/.yarn-packages
key: |
${{ env.CACHE_EPOCH }}-yarn-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
restore-keys: |
Expand Down Expand Up @@ -296,21 +296,13 @@ jobs:
cd ../ipydrawio-mathjax
codecov --root ../..
- name: upload (utest)
- name: upload (reports)
if: always()
uses: actions/upload-artifact@v3
with:
name: |-
ipydrawio-${{ github.run_number }}-utest-${{ matrix.os }}-${{ matrix.python-version }}
path: ./build/pytest

- name: upload (atest)
if: always()
uses: actions/upload-artifact@v3
with:
name: |-
ipydrawio-${{ github.run_number }}-atest-${{ matrix.os }}-${{matrix.python-version }}
path: ./build/atest
ipydrawio-${{ github.run_number }}-reports-${{ matrix.os }}-${{matrix.python-version }}
path: ./build/reports

- name: Rename uncached conda packages
shell: bash
Expand Down Expand Up @@ -343,7 +335,7 @@ jobs:
if: steps.cache-node-modules.outputs.cache-hit != 'true'
id: cache-yarn-packages
with:
path: .yarn-packages
path: ./build/.cache/.yarn-packages
key: |
${{ env.CACHE_EPOCH }}-yarn-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
restore-keys: |
Expand Down Expand Up @@ -399,7 +391,7 @@ jobs:
if: steps.cache-node-modules.outputs.cache-hit != 'true'
id: cache-yarn-packages
with:
path: .yarn-packages
path: ./build/.cache/.yarn-packages
key: |
${{ env.CACHE_EPOCH }}-yarn-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
restore-keys: |
Expand Down Expand Up @@ -430,12 +422,12 @@ jobs:
shell: bash -l {0}
run: doit test:robot

- name: upload (atest)
- name: upload (reports)
if: always()
uses: actions/upload-artifact@v3
with:
name: |-
ipydrawio-${{ github.run_number }}-atest-${{ matrix.os }}${{ matrix.python-version }}
ipydrawio-${{ github.run_number }}-reports-${{ matrix.os }}${{ matrix.python-version }}
path: ./build/atest

- name: upload (docs)
Expand Down
2 changes: 1 addition & 1 deletion .yarnrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ ignore-scripts true
network-timeout "300000"
prefer-offline true
registry "https://registry.npmjs.org/"
yarn-offline-mirror "./.yarn-packages"
yarn-offline-mirror "./build/.cache/.yarn-packages"
yarn-offline-mirror-pruning true
45 changes: 10 additions & 35 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@

## Prerequisites

- `jupyterlab >=3,<4`
- `nodejs >=12`
- `doit >=0.32`
- `jupyterlab >=3,<4`
- `nodejs >=18,<19`
- `python >=3.8`

### Recommended: conda
### Recommended: `mamba`

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

Expand Down Expand Up @@ -76,38 +77,12 @@ doit dist

## Releasing

- [ ] start a release issue with a checklist (maybe like this one)
- [ ] merge all outstanding PRs
- [ ] ensure the versions have been bumped (check with `doit test:integrity`)
- [ ] ensure the CHANGELOG is up-to-date
- [ ] move the new release to the top of the stack
- [ ] validate on binder
- [ ] validate on ReadTheDocs
- [ ] wait for a successful build of `master`
- [ ] download the `dist` archive and unpack somewhere (maybe a fresh `dist`)
- [ ] create a new release through the GitHub UI
- [ ] paste in the relevant CHANGELOG entries
- [ ] upload the artifacts
- [ ] actually upload to npm.com, pypi.org
```bash
cd dist
twine upload ipydrawio*
npm login
npm publish deathbeds-ipydrawio-$VERSION.tgz
npm publish deathbeds-ipydrawio-jupyter-templates-$VERSION.tgz
npm publish deathbeds-ipydrawio-notebook-$VERSION.tgz
npm publish deathbeds-ipydrawio-pdf-$VERSION.tgz
npm publish deathbeds-ipydrawio-webpack-$OTHER_VERSION.tgz
npm logout
```
- [ ] postmortem
- [ ] handle `conda-forge` feedstock tasks
- [ ] validate on binder via simplest-possible gists
- [ ] activate the version on ReadTheDocs
- [ ] bump to next development version
- [ ] update release procedures
- Start a [release] issue on GitHub
- Follow the checklist

```
[release]: https://github.com/deathbeds/ipydrawio/issues/new?template=release.md

<!--
Copyright 2023 ipydrawio contributors
Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -121,4 +96,4 @@ distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```
-->
3 changes: 2 additions & 1 deletion demo/jupyter_lite_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"ignore_sys_prefix": true,
"lite_dir": ".",
"output_archive": "../build/demo/ipydrawio-lite-1.3.0.tgz",
"output_dir": "../build/demo"
"output_dir": "../build/demo",
"cache_dir": "../build/.cache/.lite"
},
"PipliteAddon": {
"piplite_urls": [
Expand Down
1 change: 1 addition & 0 deletions docs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ dependencies:
- ssort
# unit testing
- pytest
- pytest-cov
- pytest-console-scripts
- pytest-html
- pytest-jupyter-server
Expand Down
64 changes: 24 additions & 40 deletions dodo.py
Original file line number Diff line number Diff line change
Expand Up @@ -942,14 +942,10 @@ def task_provision():
)


def _pytest(setup_py, pycov_args, pytest_args):
def _pytest(setup_py, pytest_args):
return CmdAction(
[
*P.PYM,
"coverage",
"run",
*pycov_args,
"-m",
"pytest",
*P.PYTEST_ARGS,
*pytest_args,
Expand All @@ -963,30 +959,6 @@ def _pytest(setup_py, pycov_args, pytest_args):
)


def _pycov_combine(setup_py):
return CmdAction(
[*P.PYM, "coverage", "combine"],
shell=False,
cwd=str(setup_py.parent),
)


def _pycov_report(setup_py):
return CmdAction(
[*P.PYM, "coverage", "report", "--skip-covered", "--show-missing"],
shell=False,
cwd=str(setup_py.parent),
)


def _pycov_html(setup_py, *pycov_html_args):
return CmdAction(
[*P.PYM, "coverage", "html", *pycov_html_args],
shell=False,
cwd=str(setup_py.parent),
)


def task_test():
"""Run tests."""
if not P.TESTING_IN_CI:
Expand All @@ -1006,24 +978,39 @@ def task_test():
P.SCRIPTS / "integrity.py",
],
"actions": [
["python", "-m", "pytest", "--pyargs", "scripts.integrity", "-vv"],
[
*P.PYM,
"pytest",
"--pyargs",
"scripts.integrity",
"-vv",
*("-o", f"""cache_dir={P.CACHE / ".pytest.integrity"}"""),
],
],
},
P.OK_INTEGRITY,
)

for pkg, setup in P.PY_SETUP.items():
html = P.BUILD / f"pytest/{pkg}/test.html"
htmlcov = P.BUILD / f"pytest/{pkg}/htmlcov"
report_dir = P.REPORTS / "pytest" / pkg
html = report_dir / "pytest.html"
cov_index = report_dir / "htmlcov" / "index.html"
cache_dir = P.CACHE / f".pytest.{pkg}"
pytest_args = [
"-vv",
"--tb=long",
*("-o", f"cache_dir={cache_dir}"),
# subs
"--script-launch-mode=subprocess",
# report
f"--html={html}",
"--self-contained-html",
"--script-launch-mode=subprocess",
# cov
"--cov-context=test",
f"""--cov={pkg.replace("-", "_")}""",
f"--cov-report=html:{cov_index.parent}",
"--cov-branch",
]
pycov_args = []
pycov_html_args = [f"--directory={htmlcov.parent}"]

if pkg == P.IPD.name:
pytest_args += ["-n", "auto"]
Expand All @@ -1041,12 +1028,9 @@ def task_test():
],
"actions": [
(P.delete_some, [html]),
_pytest(setup, pycov_args, pytest_args),
_pycov_combine(setup),
_pycov_html(setup, *pycov_html_args),
_pycov_report(setup),
_pytest(setup, pytest_args),
],
"targets": [html],
"targets": [html, cov_index],
},
P.OK_PYTEST[pkg],
)
Expand Down
4 changes: 3 additions & 1 deletion py_packages/ipydrawio-export/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ classifiers =
License :: OSI Approved :: Apache Software License
Programming Language :: Python
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Expand Down Expand Up @@ -85,3 +84,6 @@ source_pkgs =
ipydrawio_export
concurrency = multiprocessing
parallel = True

[coverage:html]
show_contexts = True
4 changes: 3 additions & 1 deletion py_packages/ipydrawio-mathjax/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ classifiers =
License :: OSI Approved :: Apache Software License
Programming Language :: Python
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Expand Down Expand Up @@ -73,3 +72,6 @@ source_pkgs =
ipydrawio_mathjax
concurrency = multiprocessing
parallel = True

[coverage:html]
show_contexts = True
4 changes: 3 additions & 1 deletion py_packages/ipydrawio-widgets/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ classifiers =
License :: OSI Approved :: Apache Software License
Programming Language :: Python
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Expand Down Expand Up @@ -72,3 +71,6 @@ source_pkgs =
ipydrawio_widgets
concurrency = multiprocessing
parallel = True

[coverage:html]
show_contexts = True
4 changes: 3 additions & 1 deletion py_packages/ipydrawio/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ classifiers =
License :: OSI Approved :: Apache Software License
Programming Language :: Python
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Expand Down Expand Up @@ -91,3 +90,6 @@ source_pkgs =
ipydrawio
concurrency = multiprocessing
parallel = True

[coverage:html]
show_contexts = True
Loading

0 comments on commit f5f6c63

Please sign in to comment.