Skip to content

chore: import ProofWidgets, so tests work#11350

Merged
kim-em merged 2 commits intomasterfrom
import_proof_widgets
Mar 22, 2024
Merged

chore: import ProofWidgets, so tests work#11350
kim-em merged 2 commits intomasterfrom
import_proof_widgets

Conversation

@kim-em
Copy link
Copy Markdown
Contributor

@kim-em kim-em commented Mar 13, 2024

Currently you need to run

lake build ProofWidgets
make tests

to reliably get tests to work.


Open in Gitpod

@kim-em kim-em added the CI Modifies the continuous integration setup or other automation label Mar 19, 2024
@kmill
Copy link
Copy Markdown
Contributor

kmill commented Mar 19, 2024

bors d+

@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Mar 19, 2024

✌️ semorrison can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@github-actions github-actions bot added delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). and removed awaiting-review labels Mar 19, 2024
-- Currently we don't need to import all of ProofWidgets,
-- but without this, if you don't run `lake build ProofWidgets` then `make test` will fail.
-- Hopefully `lake` will be able to handle tests later.
import ProofWidgets
Copy link
Copy Markdown
Member

@eric-wieser eric-wieser Mar 19, 2024

Choose a reason for hiding this comment

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

This adds an MIT-licensed dependency to Mathlib (threejs and recharts), which is otherwise Apache-licensed; can you use a more fine-grained import?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perhaps more pragmatically; do we really want to add dependencies to all mathlib users to save one line in a CI script?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What's the legal theory here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe I'm imagining the legal issue, certainly I misremembered the relative strength of the licenses.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm no lawyer so don't take what I'm saying very seriously, but MIT is extremely permissive, and it says it only requires that the license notice be included with the copy. It's even preserved when cloned by lake as .lake/packages/proofwidgets/LICENSE, in case that matters.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does replacing the middle line with lake build Mathlib ProofWidgets work?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, but that that's still a terrible user experience to need to know that!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@eric-wieser, did you want to minimize imports? If not I'll merge as is?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm curious what @digama0's thoughts are here (about adding the dependency, I think my license concerns are moot).

Is there a reason that adding lake build into make test is a bad option?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Adding at least lake build ProofWidgets seems sound. As for adding the dependency, shake is not in the business of prescribing Mathlib's policy toward intentionally broad imports, that's why noshake.json exists (esp. the ignoreImport list). I have no strong opinions regarding whether import Mathlib should imply import ProofWidgets, but I agree that we should make the tests work without this additional step, and the right place to put import ProofWidgets is in the make test target. (The actual right place is in lake but until lake test comes about we have to do it the hard way.)

@kim-em kim-em merged commit 1f7fece into master Mar 22, 2024
@mathlib-bors mathlib-bors bot deleted the import_proof_widgets branch March 22, 2024 01:57
@eric-wieser
Copy link
Copy Markdown
Member

This should have been a bors merge not a regular one, right?

dagurtomas pushed a commit that referenced this pull request Mar 22, 2024
Currently you need to run
```
lake build ProofWidgets
make tests
```
to reliably get tests to work.

---
<!-- The text above the `---` will become the commit message when your
PR is merged. Please leave a blank newline before the `---`, otherwise
GitHub will format the text above it as a title.

To indicate co-authors, include lines at the bottom of the commit
message
(that is, before the `---`) using the following format:

Co-authored-by: Author Name <author@email.com>

Any other comments you want to keep out of the PR commit should go
below the `---`, and placed outside this HTML comment, or else they
will be invisible to reviewers.

If this PR depends on other PRs, please list them below this comment,
using the following format:
- [ ] depends on: #abc [optional extra text]
- [ ] depends on: #xyz [optional extra text]
-->

[![Open in
Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/from-referrer/)
utensil pushed a commit that referenced this pull request Mar 26, 2024
Currently you need to run
```
lake build ProofWidgets
make tests
```
to reliably get tests to work.

---
<!-- The text above the `---` will become the commit message when your
PR is merged. Please leave a blank newline before the `---`, otherwise
GitHub will format the text above it as a title.

To indicate co-authors, include lines at the bottom of the commit
message
(that is, before the `---`) using the following format:

Co-authored-by: Author Name <author@email.com>

Any other comments you want to keep out of the PR commit should go
below the `---`, and placed outside this HTML comment, or else they
will be invisible to reviewers.

If this PR depends on other PRs, please list them below this comment,
using the following format:
- [ ] depends on: #abc [optional extra text]
- [ ] depends on: #xyz [optional extra text]
-->

[![Open in
Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/from-referrer/)
mathlib-bors bot pushed a commit that referenced this pull request Apr 4, 2024
This follows on from #11350, following an alternative suggestion by @digama0.

One argument for this pattern is that it also works for tests that import `ProofWidgets.Demos.*`, and any other auxiliary content in upstream packages that is not part of the top-level package.
xgenereux pushed a commit that referenced this pull request Apr 15, 2024
Currently you need to run
```
lake build ProofWidgets
make tests
```
to reliably get tests to work.

---
<!-- The text above the `---` will become the commit message when your
PR is merged. Please leave a blank newline before the `---`, otherwise
GitHub will format the text above it as a title.

To indicate co-authors, include lines at the bottom of the commit
message
(that is, before the `---`) using the following format:

Co-authored-by: Author Name <author@email.com>

Any other comments you want to keep out of the PR commit should go
below the `---`, and placed outside this HTML comment, or else they
will be invisible to reviewers.

If this PR depends on other PRs, please list them below this comment,
using the following format:
- [ ] depends on: #abc [optional extra text]
- [ ] depends on: #xyz [optional extra text]
-->

[![Open in
Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/from-referrer/)
xgenereux pushed a commit that referenced this pull request Apr 15, 2024
This follows on from #11350, following an alternative suggestion by @digama0.

One argument for this pattern is that it also works for tests that import `ProofWidgets.Demos.*`, and any other auxiliary content in upstream packages that is not part of the top-level package.
atarnoam pushed a commit that referenced this pull request Apr 16, 2024
Currently you need to run
```
lake build ProofWidgets
make tests
```
to reliably get tests to work.

---
<!-- The text above the `---` will become the commit message when your
PR is merged. Please leave a blank newline before the `---`, otherwise
GitHub will format the text above it as a title.

To indicate co-authors, include lines at the bottom of the commit
message
(that is, before the `---`) using the following format:

Co-authored-by: Author Name <author@email.com>

Any other comments you want to keep out of the PR commit should go
below the `---`, and placed outside this HTML comment, or else they
will be invisible to reviewers.

If this PR depends on other PRs, please list them below this comment,
using the following format:
- [ ] depends on: #abc [optional extra text]
- [ ] depends on: #xyz [optional extra text]
-->

[![Open in
Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/from-referrer/)
atarnoam pushed a commit that referenced this pull request Apr 16, 2024
This follows on from #11350, following an alternative suggestion by @digama0.

One argument for this pattern is that it also works for tests that import `ProofWidgets.Demos.*`, and any other auxiliary content in upstream packages that is not part of the top-level package.
uniwuni pushed a commit that referenced this pull request Apr 19, 2024
Currently you need to run
```
lake build ProofWidgets
make tests
```
to reliably get tests to work.

---
<!-- The text above the `---` will become the commit message when your
PR is merged. Please leave a blank newline before the `---`, otherwise
GitHub will format the text above it as a title.

To indicate co-authors, include lines at the bottom of the commit
message
(that is, before the `---`) using the following format:

Co-authored-by: Author Name <author@email.com>

Any other comments you want to keep out of the PR commit should go
below the `---`, and placed outside this HTML comment, or else they
will be invisible to reviewers.

If this PR depends on other PRs, please list them below this comment,
using the following format:
- [ ] depends on: #abc [optional extra text]
- [ ] depends on: #xyz [optional extra text]
-->

[![Open in
Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/from-referrer/)
uniwuni pushed a commit that referenced this pull request Apr 19, 2024
This follows on from #11350, following an alternative suggestion by @digama0.

One argument for this pattern is that it also works for tests that import `ProofWidgets.Demos.*`, and any other auxiliary content in upstream packages that is not part of the top-level package.
callesonne pushed a commit that referenced this pull request Apr 22, 2024
Currently you need to run
```
lake build ProofWidgets
make tests
```
to reliably get tests to work.

---
<!-- The text above the `---` will become the commit message when your
PR is merged. Please leave a blank newline before the `---`, otherwise
GitHub will format the text above it as a title.

To indicate co-authors, include lines at the bottom of the commit
message
(that is, before the `---`) using the following format:

Co-authored-by: Author Name <author@email.com>

Any other comments you want to keep out of the PR commit should go
below the `---`, and placed outside this HTML comment, or else they
will be invisible to reviewers.

If this PR depends on other PRs, please list them below this comment,
using the following format:
- [ ] depends on: #abc [optional extra text]
- [ ] depends on: #xyz [optional extra text]
-->

[![Open in
Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/from-referrer/)
callesonne pushed a commit that referenced this pull request Apr 22, 2024
This follows on from #11350, following an alternative suggestion by @digama0.

One argument for this pattern is that it also works for tests that import `ProofWidgets.Demos.*`, and any other auxiliary content in upstream packages that is not part of the top-level package.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Modifies the continuous integration setup or other automation delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants