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

Automatically download labvariables CSS instead of shipping them #1062

Merged
merged 1 commit into from
Jan 18, 2022

Conversation

martinRenou
Copy link
Member

@martinRenou martinRenou commented Jan 18, 2022

Remove labvariables.css and materialcolors.css files from the repo. Instead we download them automatically, similar to what nbconvert does: https://github.com/jupyter/nbconvert/blob/main/setup.py

Code changes

Automatically download CSS files on install

User-facing changes

None

Backwards-incompatible changes

None

@github-actions
Copy link
Contributor

github-actions bot commented Jan 18, 2022

Benchmark report

The execution time (in milliseconds) are grouped by test file, test type and browser.
For each case, the following values are computed: min <- [1st quartile - median - 3rd quartile] -> max.

Results table
Test file basics.ipynb bqplot.ipynb dashboard.ipynb gridspecLayout.ipynb interactive.ipynb ipympl.ipynb ipyvolume.ipynb multiple_widgets.ipynb query-strings.ipynb reveal.ipynb
Render
chromium
actual 3526 <- [3671 - 3921 - 4190] -> 5384 2889 <- [2948 - 2961 - 2976] -> 3418 3155 <- [3211 - 3213 - 3256] -> 3528 4161 <- [4190 - 4201 - 4381] -> 4541 2361 <- [2376 - 2382 - 2480] -> 2723 4782 <- [4838 - 4958 - 5173] -> 5553 8240 <- [11823 - 12077 - 13010] -> 13386 12915 <- [13096 - 13202 - 13248] -> 13316 1598 <- [1606 - 1681 - 1772] -> 2004 2547 <- [2553 - 2561 - 2568] -> 2798
expected 3379 <- [3442 - 3517 - 3701] -> 3876 2976 <- [3227 - 3321 - 3421] -> 3604 3608 <- [3623 - 3709 - 3793] -> 3825 4453 <- [4453 - 4523 - 4661] -> 4748 2559 <- [2655 - 2656 - 2660] -> 2674 3982 <- [4079 - 4213 - 4356] -> 4743 12183 <- [18509 - 19553 - 20811] -> 21515 15319 <- [15660 - 15796 - 15912] -> 16056 1517 <- [1920 - 1997 - 2103] -> 2113

❗ Test metadata have changed
--- /dev/fd/63	2022-01-18 14:41:00.313419431 +0000
+++ /dev/fd/62	2022-01-18 14:41:00.313419431 +0000
@@ -4,37 +4,37 @@
     "BENCHMARK_REFERENCE": "actual"
   },
   "browsers": {
-    "chromium": "97.0.4666.0"
+    "chromium": "94.0.4595.0"
   },
   "systemInformation": {
     "cpu": {
-      "brand": "Xeon® E5-2673 v4",
+      "brand": "Xeon® E5-2673 v3",
       "cache": {
         "l1d": 65536,
         "l1i": 65536,
         "l2": 524288,
-        "l3": 52428800
+        "l3": 31457280
       },
       "cores": 2,
       "family": "6",
-      "flags": "fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase bmi1 hle avx2 smep bmi2 erms invpcid rtm rdseed adx smap xsaveopt md_clear",
+      "flags": "fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm invpcid_single pti fsgsbase bmi1 avx2 smep bmi2 erms invpcid xsaveopt md_clear",
       "governor": "",
       "manufacturer": "Intel®",
-      "model": "79",
+      "model": "63",
       "physicalCores": 2,
       "processors": 1,
       "revision": "",
       "socket": "",
-      "speed": 2.3,
+      "speed": 2.4,
       "speedMax": null,
       "speedMin": null,
-      "stepping": "1",
+      "stepping": "2",
       "vendor": "GenuineIntel",
       "virtualization": false,
       "voltage": ""
     },
     "mem": {
-      "total": 7289610240
+      "total": 7291699200
     },
     "osInfo": {
       "arch": "x64",
@@ -42,11 +42,11 @@
       "codename": "Focal Fossa",
       "codepage": "UTF-8",
       "distro": "Ubuntu",
-      "kernel": "5.11.0-1025-azure",
+      "kernel": "5.8.0-1040-azure",
       "logofile": "ubuntu",
       "platform": "linux",
       "release": "20.04.3 LTS",
-      "serial": "bfb5cc16a13d479a868c817b847bcf8f",
+      "serial": "cfc067bfcb844f35865e279a1b0e66c5",
       "servicepack": "",
       "uefi": false
     }

@martinRenou martinRenou force-pushed the cleanup_css_variables branch 5 times, most recently from 13c0905 to 62083ba Compare January 18, 2022 11:55
@martinRenou
Copy link
Member Author

I don't get the UI test failure. It looks like a font-size difference but the font-size has not been changed using this PR.

This CSS variables are still properly discovered by the reveal template.

I will update the reference screenshots.

@trungleduc
Copy link
Member

trungleduc commented Jan 18, 2022

Hi @martinRenou, by fetching CSS files from the internet on installation, users who install Voila in an offline environment (e.g directly via tar.gz file or via local pypi repository) will not be able to do it anymore.
Should we instead download the CSS files at build time via CI script to keep them up-to-date with upstream?

My bad, this PR actually downloads CSS files at build time, which is great!

@martinRenou
Copy link
Member Author

martinRenou commented Jan 18, 2022

users who install Voila in an offline environment (e.g directly via tar.gz file or via local pypi repository) will not be able to do it anymore.

I am not sure this is a use-case we actually support right now? Those users would also need to install nbconvert in some way, and nbconvert does the same as this PR proposes. (EDIT: this is not true, see #1062 (comment))

Should we instead download the CSS files at build time via CI script to keep them up-to-date with upstream?

Another idea could be to include those CSS files in the sdist when publishing on pypi?

@martinRenou
Copy link
Member Author

My bad, this PR actually downloads CSS files at build time, which is great!

No I think you had a point. This CSS, not being in the sdist, will not be part of the tar.gz published on Pypi.

@trungleduc
Copy link
Member

My bad, this PR actually downloads CSS files at build time, which is great!

No I think you had a point. This CSS, not being in the sdist, will not be part of the tar.gz published on Pypi.

I looked at nbconvert, both the tag.gz and .whl have the downloaded CSS files.

@martinRenou
Copy link
Member Author

I looked at nbconvert, both the tag.gz and .whl have the downloaded CSS files.

With this PR in voila, it's not included in the tar.gz, it is included in the whl though.

It's not included in the tar.gz because I added an exclude in the MANIFEST.IN (which nbconvert does not do). We could remove this exclude and ship the CSS with the tar.gz (I am personally totally ok with this, it would fix the "non internet connection" setup), but the check-manifest CI check is complaining if there are files included in the sdist that are not tracked by git.

@trungleduc
Copy link
Member

Can we update tool.check-manifest ignore list?

@martinRenou
Copy link
Member Author

Yes, we can do that. I wonder if that could be considered bad practice?

@martinRenou martinRenou force-pushed the cleanup_css_variables branch 2 times, most recently from 1b539d4 to 03e5429 Compare January 18, 2022 13:56
@trungleduc
Copy link
Member

Yes, we can do that. I wonder if that could be considered bad practice?

I don't know, but we had the same pattern for ignoring js files in check-manifest.

@martinRenou
Copy link
Member Author

Ok, thanks :) I updated my PR

setup.cfg Outdated Show resolved Hide resolved
@martinRenou martinRenou force-pushed the cleanup_css_variables branch 3 times, most recently from 1ffd800 to fa5a79b Compare January 18, 2022 14:03
@martinRenou martinRenou reopened this Jan 18, 2022
@martinRenou
Copy link
Member Author

I accidentally canceled the CI, retriggering it

@trungleduc
Copy link
Member

Thanks @martinRenou !

@trungleduc trungleduc merged commit 79a126a into voila-dashboards:main Jan 18, 2022
@martinRenou martinRenou deleted the cleanup_css_variables branch January 19, 2022 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants