fxcss 0.16.0__tar.gz → 0.16.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. {fxcss-0.16.0 → fxcss-0.16.2}/PKG-INFO +3 -3
  2. {fxcss-0.16.0 → fxcss-0.16.2}/README.md +2 -2
  3. {fxcss-0.16.0 → fxcss-0.16.2}/fxcss/__init__.py +1 -1
  4. {fxcss-0.16.0 → fxcss-0.16.2}/fxcss/core.py +10 -4
  5. {fxcss-0.16.0 → fxcss-0.16.2}/fxcss/templates/firefox-watch.yml +14 -7
  6. {fxcss-0.16.0 → fxcss-0.16.2}/fxcss/templates/pr-preview-cleanup.yml +1 -1
  7. {fxcss-0.16.0 → fxcss-0.16.2}/fxcss/templates/pr-preview-publish.yml +4 -4
  8. {fxcss-0.16.0 → fxcss-0.16.2}/fxcss/templates/pr-preview.yml +4 -4
  9. {fxcss-0.16.0 → fxcss-0.16.2}/fxcss/templates/readme-previews.yml +2 -2
  10. {fxcss-0.16.0 → fxcss-0.16.2}/fxcss/templates/showcase.yml +3 -3
  11. {fxcss-0.16.0 → fxcss-0.16.2}/fxcss.egg-info/PKG-INFO +3 -3
  12. {fxcss-0.16.0 → fxcss-0.16.2}/tests/test_units.py +83 -0
  13. {fxcss-0.16.0 → fxcss-0.16.2}/LICENSE +0 -0
  14. {fxcss-0.16.0 → fxcss-0.16.2}/fxcss/__main__.py +0 -0
  15. {fxcss-0.16.0 → fxcss-0.16.2}/fxcss/adopt.py +0 -0
  16. {fxcss-0.16.0 → fxcss-0.16.2}/fxcss/audit.py +0 -0
  17. {fxcss-0.16.0 → fxcss-0.16.2}/fxcss/catalogue.py +0 -0
  18. {fxcss-0.16.0 → fxcss-0.16.2}/fxcss/cli.py +0 -0
  19. {fxcss-0.16.0 → fxcss-0.16.2}/fxcss/compare.py +0 -0
  20. {fxcss-0.16.0 → fxcss-0.16.2}/fxcss/complete.py +0 -0
  21. {fxcss-0.16.0 → fxcss-0.16.2}/fxcss/fetch.py +0 -0
  22. {fxcss-0.16.0 → fxcss-0.16.2}/fxcss/install.py +0 -0
  23. {fxcss-0.16.0 → fxcss-0.16.2}/fxcss/probe.py +0 -0
  24. {fxcss-0.16.0 → fxcss-0.16.2}/fxcss/scaffold.py +0 -0
  25. {fxcss-0.16.0 → fxcss-0.16.2}/fxcss/sheets.py +0 -0
  26. {fxcss-0.16.0 → fxcss-0.16.2}/fxcss/templates/starter/chrome/userChrome.css +0 -0
  27. {fxcss-0.16.0 → fxcss-0.16.2}/fxcss/templates/starter/custom/accent-red.css +0 -0
  28. {fxcss-0.16.0 → fxcss-0.16.2}/fxcss/tweaks.py +0 -0
  29. {fxcss-0.16.0 → fxcss-0.16.2}/fxcss.egg-info/SOURCES.txt +0 -0
  30. {fxcss-0.16.0 → fxcss-0.16.2}/fxcss.egg-info/dependency_links.txt +0 -0
  31. {fxcss-0.16.0 → fxcss-0.16.2}/fxcss.egg-info/entry_points.txt +0 -0
  32. {fxcss-0.16.0 → fxcss-0.16.2}/fxcss.egg-info/requires.txt +0 -0
  33. {fxcss-0.16.0 → fxcss-0.16.2}/fxcss.egg-info/top_level.txt +0 -0
  34. {fxcss-0.16.0 → fxcss-0.16.2}/pyproject.toml +0 -0
  35. {fxcss-0.16.0 → fxcss-0.16.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fxcss
3
- Version: 0.16.0
3
+ Version: 0.16.2
4
4
  Summary: Live-reload, inspect and screenshot-test Firefox userChrome.css themes
5
5
  Author: AdamXweb
6
6
  License: MIT
@@ -122,7 +122,7 @@ the [releases page](https://github.com/AdamXweb/fxcss/releases) has the latest.
122
122
  CI runners' Pythons are not externally managed, so plain pip is fine there:
123
123
 
124
124
  ```bash
125
- pip install "fxcss[images]==0.16.0"
125
+ pip install "fxcss[images]==0.16.2"
126
126
  ```
127
127
 
128
128
  Either gives you an `fxcss` command. To hack on it, clone and install editable:
@@ -1013,7 +1013,7 @@ check out the base revision and the pull request revision, render both, compare,
1013
1013
  and publish the result.
1014
1014
 
1015
1015
  ```yaml
1016
- - run: pip install "fxcss[images]==0.16.0" # pin: your CI, your upgrades
1016
+ - run: pip install "fxcss[images]==0.16.2" # pin: your CI, your upgrades
1017
1017
  - run: fxcss shot --theme base --out shots/base
1018
1018
  - run: fxcss shot --theme head --out shots/head
1019
1019
  - run: fxcss compare --base shots/base --head shots/head --out out/ --platform ${{ runner.os }}
@@ -99,7 +99,7 @@ the [releases page](https://github.com/AdamXweb/fxcss/releases) has the latest.
99
99
  CI runners' Pythons are not externally managed, so plain pip is fine there:
100
100
 
101
101
  ```bash
102
- pip install "fxcss[images]==0.16.0"
102
+ pip install "fxcss[images]==0.16.2"
103
103
  ```
104
104
 
105
105
  Either gives you an `fxcss` command. To hack on it, clone and install editable:
@@ -990,7 +990,7 @@ check out the base revision and the pull request revision, render both, compare,
990
990
  and publish the result.
991
991
 
992
992
  ```yaml
993
- - run: pip install "fxcss[images]==0.16.0" # pin: your CI, your upgrades
993
+ - run: pip install "fxcss[images]==0.16.2" # pin: your CI, your upgrades
994
994
  - run: fxcss shot --theme base --out shots/base
995
995
  - run: fxcss shot --theme head --out shots/head
996
996
  - run: fxcss compare --base shots/base --head shots/head --out out/ --platform ${{ runner.os }}
@@ -1,3 +1,3 @@
1
1
  """fxcss — a testing toolkit for Firefox userChrome.css themes."""
2
2
 
3
- __version__ = "0.16.0"
3
+ __version__ = "0.16.2"
@@ -584,8 +584,8 @@ SEED_BOOKMARKS = """
584
584
  const done = arguments[arguments.length - 1];
585
585
  (async () => {
586
586
  try {
587
- const {PlacesUtils} = ChromeUtils.importESModule(
588
- "resource://gre/modules/PlacesUtils.sys.mjs");
587
+ const {PlacesUtils} =
588
+ Services.wm.getMostRecentWindow("navigator:browser");
589
589
  for (const [title, url] of [["GitHub", "https://github.com/"],
590
590
  ["Mozilla", "https://www.mozilla.org/"],
591
591
  ["Example", "https://example.com/"]]) {
@@ -946,13 +946,19 @@ for (let i = 0; i < count; i++) {
946
946
  return win.gBrowser.tabs.length;
947
947
  """
948
948
 
949
+ # Off the window, for the same reason APPLY_TOOLBAR takes CustomizableUI that
950
+ # way: Firefox 154 moved this module from resource://gre/modules/ to
951
+ # moz-src:///toolkit/components/contextualidentity/, and importing either URL
952
+ # hard fails on the build that does not have it -- which is how it broke, in
953
+ # the field, the day 154 shipped. browser.js declares it with
954
+ # ChromeUtils.defineESModuleGetters(this, ...) on both, so the window property
955
+ # is the same object either side and names no URL to go stale.
949
956
  CONTAINER_TABS = """
950
957
  const [url] = arguments;
951
958
  const win = Services.wm.getMostRecentWindow("navigator:browser");
952
959
  const sp = Services.scriptSecurityManager.getSystemPrincipal();
953
960
  Services.prefs.setBoolPref("privacy.userContext.enabled", true);
954
- const {ContextualIdentityService} = ChromeUtils.importESModule(
955
- "resource://gre/modules/ContextualIdentityService.sys.mjs");
961
+ const {ContextualIdentityService} = win;
956
962
  const ids = ContextualIdentityService.getPublicIdentities().slice(0, 3);
957
963
  for (const identity of ids) {
958
964
  win.gBrowser.addTab(url, {triggeringPrincipal: sp, userContextId: identity.userContextId});
@@ -41,9 +41,9 @@ jobs:
41
41
  channel: [release, beta, nightly]
42
42
 
43
43
  steps:
44
- - uses: actions/checkout@v4
44
+ - uses: actions/checkout@v7
45
45
 
46
- - uses: actions/setup-python@v5
46
+ - uses: actions/setup-python@v7
47
47
  with:
48
48
  python-version: '3.12'
49
49
 
@@ -63,9 +63,13 @@ jobs:
63
63
  esr) product=firefox-esr-latest-ssl ;;
64
64
  *) echo "unknown channel"; exit 1 ;;
65
65
  esac
66
- curl -sSL -o firefox.dmg \
66
+ # Into $RUNNER_TEMP, not the checkout: the fix step below commits
67
+ # from this tree, and a 150 MB dmg sitting in it was being swept
68
+ # into the commit, which GitHub's 100 MB limit then rejected --
69
+ # silently killing the watch on every channel.
70
+ curl -sSL -o "$RUNNER_TEMP/firefox.dmg" \
67
71
  "https://download.mozilla.org/?product=${product}&os=osx&lang=en-US"
68
- hdiutil attach -nobrowse -quiet -mountpoint /Volumes/ffwatch firefox.dmg
72
+ hdiutil attach -nobrowse -quiet -mountpoint /Volumes/ffwatch "$RUNNER_TEMP/firefox.dmg"
69
73
  cp -R /Volumes/ffwatch/*.app "$RUNNER_TEMP/Firefox.app"
70
74
  hdiutil detach /Volumes/ffwatch -quiet
71
75
  echo "FIREFOX_BIN=$RUNNER_TEMP/Firefox.app/Contents/MacOS/firefox" >> "$GITHUB_ENV"
@@ -103,8 +107,11 @@ jobs:
103
107
  git config user.name 'github-actions[bot]'
104
108
  git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
105
109
  git checkout -b "$branch"
106
- git apply fxcss-fix.patch
107
- git add -A ':!audit.txt' ':!fxcss-fix.patch'
110
+ # --index applies the patch and stages exactly the files it
111
+ # touches, nothing else. `git add -A` with a couple of exclusions is
112
+ # how a 150 MB dmg got committed; anything else a step leaves in the
113
+ # tree would have gone the same way.
114
+ git apply --index fxcss-fix.patch
108
115
  git commit -m "fix(css): update selectors renamed in Firefox ${VERSION}"
109
116
  git push origin "$branch"
110
117
  {
@@ -169,7 +176,7 @@ jobs:
169
176
  --comment "Firefox ${CHANNEL} audits clean again — closing."
170
177
  fi
171
178
 
172
- - uses: actions/upload-artifact@v4
179
+ - uses: actions/upload-artifact@v7
173
180
  if: always()
174
181
  with:
175
182
  name: audit-${{ matrix.channel }}
@@ -19,7 +19,7 @@ jobs:
19
19
  runs-on: ubuntu-latest
20
20
  timeout-minutes: 10
21
21
  steps:
22
- - uses: actions/checkout@v4
22
+ - uses: actions/checkout@v7
23
23
  with:
24
24
  ref: ${{ github.event.repository.default_branch }}
25
25
 
@@ -39,7 +39,7 @@ jobs:
39
39
 
40
40
  steps:
41
41
  - name: Check out default branch
42
- uses: actions/checkout@v4
42
+ uses: actions/checkout@v7
43
43
 
44
44
  - name: Resolve source run
45
45
  id: src
@@ -51,7 +51,7 @@ jobs:
51
51
  fi
52
52
 
53
53
  - name: Download preview artifacts
54
- uses: actions/download-artifact@v4
54
+ uses: actions/download-artifact@v8
55
55
  with:
56
56
  run-id: ${{ steps.src.outputs.run_id }}
57
57
  github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -61,7 +61,7 @@ jobs:
61
61
 
62
62
  - name: Validate artifact and resolve pull request
63
63
  id: check
64
- uses: actions/github-script@v7
64
+ uses: actions/github-script@v9
65
65
  with:
66
66
  script: |
67
67
  const fs = require('fs');
@@ -221,7 +221,7 @@ jobs:
221
221
 
222
222
  - name: Upsert pull request comment
223
223
  if: steps.check.outputs.skip == 'false'
224
- uses: actions/github-script@v7
224
+ uses: actions/github-script@v9
225
225
  env:
226
226
  PR: ${{ steps.check.outputs.pr }}
227
227
  SHA: ${{ steps.check.outputs.sha }}
@@ -52,20 +52,20 @@ jobs:
52
52
 
53
53
  steps:
54
54
  - name: Check out base revision
55
- uses: actions/checkout@v4
55
+ uses: actions/checkout@v7
56
56
  with:
57
57
  ref: ${{ github.event.pull_request.base.sha }}
58
58
  path: base
59
59
  persist-credentials: false
60
60
 
61
61
  - name: Check out pull request revision
62
- uses: actions/checkout@v4
62
+ uses: actions/checkout@v7
63
63
  with:
64
64
  ref: ${{ github.event.pull_request.head.sha }}
65
65
  path: head
66
66
  persist-credentials: false
67
67
 
68
- - uses: actions/setup-python@v5
68
+ - uses: actions/setup-python@v7
69
69
  with:
70
70
  python-version: '3.12'
71
71
 
@@ -140,7 +140,7 @@ jobs:
140
140
  echo "${{ github.event.pull_request.head.sha }}" > out/head-sha.txt
141
141
 
142
142
  - name: Upload preview
143
- uses: actions/upload-artifact@v4
143
+ uses: actions/upload-artifact@v7
144
144
  with:
145
145
  name: preview-${{ matrix.label }}
146
146
  path: out/
@@ -47,9 +47,9 @@ jobs:
47
47
  runs-on: macos-latest
48
48
  timeout-minutes: 30
49
49
  steps:
50
- - uses: actions/checkout@v4
50
+ - uses: actions/checkout@v7
51
51
 
52
- - uses: actions/setup-python@v5
52
+ - uses: actions/setup-python@v7
53
53
  with:
54
54
  python-version: '3.12'
55
55
 
@@ -32,9 +32,9 @@ jobs:
32
32
  runs-on: macos-latest
33
33
  timeout-minutes: 30
34
34
  steps:
35
- - uses: actions/checkout@v4
35
+ - uses: actions/checkout@v7
36
36
 
37
- - uses: actions/setup-python@v5
37
+ - uses: actions/setup-python@v7
38
38
  with:
39
39
  python-version: '3.12'
40
40
 
@@ -63,7 +63,7 @@ jobs:
63
63
  # shellcheck disable=SC2086
64
64
  fxcss shot --out showcase --only-live $args
65
65
 
66
- - uses: actions/upload-artifact@v4
66
+ - uses: actions/upload-artifact@v7
67
67
  with:
68
68
  name: showcase
69
69
  path: showcase/live/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fxcss
3
- Version: 0.16.0
3
+ Version: 0.16.2
4
4
  Summary: Live-reload, inspect and screenshot-test Firefox userChrome.css themes
5
5
  Author: AdamXweb
6
6
  License: MIT
@@ -122,7 +122,7 @@ the [releases page](https://github.com/AdamXweb/fxcss/releases) has the latest.
122
122
  CI runners' Pythons are not externally managed, so plain pip is fine there:
123
123
 
124
124
  ```bash
125
- pip install "fxcss[images]==0.16.0"
125
+ pip install "fxcss[images]==0.16.2"
126
126
  ```
127
127
 
128
128
  Either gives you an `fxcss` command. To hack on it, clone and install editable:
@@ -1013,7 +1013,7 @@ check out the base revision and the pull request revision, render both, compare,
1013
1013
  and publish the result.
1014
1014
 
1015
1015
  ```yaml
1016
- - run: pip install "fxcss[images]==0.16.0" # pin: your CI, your upgrades
1016
+ - run: pip install "fxcss[images]==0.16.2" # pin: your CI, your upgrades
1017
1017
  - run: fxcss shot --theme base --out shots/base
1018
1018
  - run: fxcss shot --theme head --out shots/head
1019
1019
  - run: fxcss compare --base shots/base --head shots/head --out out/ --platform ${{ runner.os }}
@@ -2396,3 +2396,86 @@ class ProfileChoiceTests(unittest.TestCase):
2396
2396
  for name in ("m", "u", "spare")}
2397
2397
  self.assertEqual(states, {"m": "managed", "u": "unmanaged",
2398
2398
  "spare": "empty"})
2399
+
2400
+
2401
+ class ModuleUrlTests(unittest.TestCase):
2402
+ """Chrome scripts must reach Firefox modules off the window, not by URL.
2403
+
2404
+ Module URLs move. `resource://gre/modules/ContextualIdentityService.sys.mjs`
2405
+ became `moz-src:///toolkit/components/contextualidentity/…` in Firefox 154
2406
+ and every capture broke the day it shipped, on a line that had been correct
2407
+ for a year. `ChromeUtils.defineESModuleGetters` puts the same objects on
2408
+ the browser window under a name that does not move, so a script naming a
2409
+ URL is a dated assumption waiting for the next uplift.
2410
+
2411
+ Scanning the source rather than listing the scripts by name: a new script
2412
+ with a fresh import is exactly what this needs to catch.
2413
+ """
2414
+
2415
+ def source(self):
2416
+ from fxcss import core
2417
+ return Path(core.__file__).read_text(encoding="utf-8")
2418
+
2419
+ def test_no_script_imports_a_module_by_url(self):
2420
+ offenders = [line.strip() for line in self.source().splitlines()
2421
+ if "importESModule" in line and not
2422
+ line.lstrip().startswith("#")]
2423
+ self.assertEqual(offenders, [], "reach these off the window instead")
2424
+
2425
+ def test_the_scripts_that_needed_modules_still_name_them(self):
2426
+ """Guard the guard: a passing scan means nothing if the uses vanished."""
2427
+ source = self.source()
2428
+ for name in ("ContextualIdentityService", "PlacesUtils"):
2429
+ self.assertIn(name, source, name)
2430
+
2431
+
2432
+ class TemplateActionVersionTests(unittest.TestCase):
2433
+ """The shipped templates must not fall behind fxcss's own workflows.
2434
+
2435
+ Dependabot watches .github/workflows/ and bumps the actions there; it
2436
+ does not know fxcss/templates/ holds the same actions, shipped in the
2437
+ wheel for every theme that runs `fxcss init`. That is how the templates
2438
+ sat on checkout@v4 / setup-python@v5 -- the Node 20 set GitHub is
2439
+ retiring -- while fxcss's CI had moved to v7 months earlier. Pinning the
2440
+ two to each other turns the next Dependabot bump into a failing test.
2441
+ """
2442
+
2443
+ PIN = re.compile(r"uses:\s*actions/([a-z-]+)@v(\d+)")
2444
+
2445
+ def versions(self, paths):
2446
+ found = {}
2447
+ for path in paths:
2448
+ for name, major in self.PIN.findall(
2449
+ path.read_text(encoding="utf-8")):
2450
+ found.setdefault(name, set()).add(int(major))
2451
+ return found
2452
+
2453
+ def test_templates_match_the_workflows_fxcss_itself_runs(self):
2454
+ root = Path(__file__).resolve().parent.parent
2455
+ own = self.versions((root / ".github" / "workflows").glob("*.yml"))
2456
+ shipped = self.versions((root / "fxcss" / "templates").glob("*.yml"))
2457
+ self.assertTrue(own and shipped)
2458
+ for name, majors in shipped.items():
2459
+ self.assertEqual(len(majors), 1,
2460
+ f"{name} pinned inconsistently in templates")
2461
+ if name in own:
2462
+ self.assertEqual(majors, own[name],
2463
+ f"templates pin actions/{name}@v{majors} but "
2464
+ f"fxcss's own CI runs v{own[name]}")
2465
+
2466
+ def test_no_template_action_targets_node_20(self):
2467
+ """The majors GitHub's deprecation notice names, by action.
2468
+
2469
+ Kept as a floor rather than derived: what counts as "old" is a fact
2470
+ about GitHub's runners on a date, and a test should say which date.
2471
+ Floors as of 2026-08, each read from the action's own action.yml at
2472
+ that tag: the first major declaring `using: node24`.
2473
+ """
2474
+ root = Path(__file__).resolve().parent.parent
2475
+ floors = {"checkout": 5, "setup-python": 6, "upload-artifact": 6,
2476
+ "download-artifact": 7, "github-script": 8}
2477
+ shipped = self.versions((root / "fxcss" / "templates").glob("*.yml"))
2478
+ for name, floor in floors.items():
2479
+ for major in shipped.get(name, ()):
2480
+ self.assertGreaterEqual(
2481
+ major, floor, f"actions/{name}@v{major} runs on Node 20")
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes