Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DEPLOYMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ The site deploys from this `website` branch. From a fresh clone (`git clone --br

## Installer behavior

The installer asks for a starting point, confirms its installation plan, bootstraps pipx when necessary, installs `fxcss[images]`, verifies the executable, and runs `pipx ensurepath`. It prints the chosen next steps without launching Firefox or creating theme files. Re-running it preserves an existing pipx-managed fxcss version and adds Pillow only if missing. Update existing fxcss explicitly with `pipx upgrade fxcss`.
The installer asks for a starting point, confirms its installation plan, bootstraps pipx when necessary, installs `fxcss`, verifies the executable, and runs `pipx ensurepath`. It prints the chosen next steps without launching Firefox or creating theme files. Re-running it preserves an existing pipx-managed fxcss version. Pillow comes with fxcss 0.26 and later; the installer adds it to an older installation that lacks it. Update existing fxcss explicitly with `pipx upgrade fxcss`.

On macOS, missing pipx is installed through an existing Homebrew installation. Otherwise setup uses Python 3.10+ and venv to bootstrap a persistent pipx-managed pipx installation. It cleans up only its own temporary bootstrap directory. Missing Python or venv produces recovery instructions; the installer does not install an operating-system package manager, run as root, or bypass Python's system-package protections.

Expand Down
2 changes: 1 addition & 1 deletion app/components/getting-started.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function InstallStep({ journey }: { journey: Journey }) {
<div>
<h3>Manual · pipx already installed</h3>
<p>Use pipx directly on macOS, Linux, or Windows.</p>
<CopyCommand command={'pipx install "fxcss[images]"'} />
<CopyCommand command="pipx install fxcss" />
<Link href="/docs/installation">
Need pipx first? See installation options
</Link>
Expand Down
16 changes: 10 additions & 6 deletions app/open/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,22 @@ export default function WebsiteData() {
the website’s services see what you do with it.
</p>
<p>
fxcss itself connects only to GitHub, and only when you ask it to
work with a theme stored there: <code>fxcss try</code>,{' '}
fxcss itself connects to the internet only when you ask it to
fetch something. <code>fxcss try</code>,{' '}
<code>fxcss install</code> and <code>fxcss upgrade</code> download
the theme, and <code>fxcss adopt</code> and{' '}
<code>fxcss profiles --check</code> look up its versions. It never
a theme from the site that hosts it: GitHub, Codeberg, git.gay or
GitLab. <code>fxcss adopt</code> and{' '}
<code>fxcss profiles --check</code> look up the theme’s versions
on the same site. <code>fxcss support</code> downloads Firefox
releases from Mozilla to compare a theme against. fxcss never
checks for its own updates, and it turns off Firefox’s data
reporting in the temporary profiles it creates.
</p>
<p>
The setup script installs fxcss from the Python Package Index (PyPI)
using pipx, a tool that installs Python programs. GitHub and PyPI
handle those downloads under{' '}
using pipx, a tool that installs Python programs. Each of those
sites handles its downloads under its own privacy policy, such
as{' '}
<a href="https://docs.github.com/en/site-policy/privacy-policies/github-general-privacy-statement">
GitHub’s privacy statement
</a>{' '}
Expand Down
2 changes: 1 addition & 1 deletion app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export default function Home() {
<div>
<CopyCommand command={INSTALL} />
<p className="setup-caption">
Already have pipx? <code>{'pipx install "fxcss[images]"'}</code>
Already have pipx? <code>pipx install fxcss</code>
</p>
<Link
className="text-link"
Expand Down
2 changes: 1 addition & 1 deletion content/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -1610,7 +1610,7 @@
"title": "Requirements",
"chapter": "Troubleshooting and configuration",
"group": "guide",
"description": "Run fxcss with Python 3.9+ and Firefox on macOS, Windows or Linux. Add Pillow for image commands with the fxcss[images] extra.",
"description": "Run fxcss with Python 3.9+ and Firefox on macOS, Windows or Linux. Pillow, which the image commands use, is installed with it.",
"html": "<ul>\n<li id=\"passage-1\">Python 3.9+</li><li id=\"passage-2\">Firefox (any recent release; the toolkit finds it automatically on macOS,\nWindows and Linux, or set <code>FIREFOX_BIN</code>)</li><li id=\"passage-3\">Pillow for <code>catalogue</code>, <code>compare</code>, <code>check</code>, <code>tweaks</code> and <code>upgrade --compare</code>.\nThe <code>fxcss[images]</code> extra includes it; add it later with\n<code>pipx inject fxcss pillow</code>. Other commands use the Python standard library.</li></ul>\n",
"codes": [],
"headings": [],
Expand Down
2 changes: 1 addition & 1 deletion content/search-index.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"url": "/search/index-46a0a54ff668f99a.json"
"url": "/search/index-fa81488d5954b741.json"
}
9 changes: 5 additions & 4 deletions public/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,12 @@ HELP
"$pipx_cmd" --version >/dev/null || fail 'The pipx command is unavailable. Fix pipx, then rerun setup.'
if "$pipx_cmd" runpip fxcss show fxcss >/dev/null 2>&1; then
say 'Using your existing pipx installation of fxcss.'
if ! "$pipx_cmd" runpip fxcss show Pillow >/dev/null 2>&1; then
"$pipx_cmd" inject fxcss 'pillow>=10.1' || fail 'Could not add the image tools to fxcss.'
fi
else
"$pipx_cmd" install 'fxcss[images]' || fail 'Could not install fxcss. Check the error above and retry.'
"$pipx_cmd" install fxcss || fail 'Could not install fxcss. Check the error above and retry.'
fi
# fxcss 0.26 and later bring Pillow with them; older releases need it added.
if ! "$pipx_cmd" runpip fxcss show Pillow >/dev/null 2>&1; then
"$pipx_cmd" inject fxcss 'pillow>=10.1' || fail 'Could not add the image tools to fxcss.'
fi
local app_bin fxcss_cmd
app_bin=$("$pipx_cmd" environment --value PIPX_BIN_DIR) || fail 'Could not locate the installed fxcss command.'
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion scripts/build-content.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ const docs = [];
// These reference pages start with a list/table rather than introductory
// prose. Keep their summaries specific to the recorded source content.
const descriptionOverrides = {
requirements: 'Run fxcss with Python 3.9+ and Firefox on macOS, Windows or Linux. Add Pillow for image commands with the fxcss[images] extra.',
requirements: 'Run fxcss with Python 3.9+ and Firefox on macOS, Windows or Linux. Pillow, which the image commands use, is installed with it.',
commands: 'Find fxcss commands for trying and installing Firefox themes, live CSS editing, screenshots, compatibility checks, and troubleshooting.',
};
for (const page of pages) {
Expand Down
26 changes: 20 additions & 6 deletions tests/test_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
out.write(json.dumps([name, *args]) + '\n')
apps = pathlib.Path(env['PIPX_BIN_DIR'])
state = pathlib.Path(env['SETUP_TEST_STATE'])
pillow = state.with_name(state.name + '-pillow')
def executable(path):
path.parent.mkdir(parents=True, exist_ok=True)
shutil.copyfile(env['SETUP_TEST_STUB'], path)
Expand All @@ -49,13 +50,16 @@ def done(code=0): sys.exit(code)
if args[:1] == ['environment']: print(str(apps)); done()
if args[:3] == ['runpip', 'fxcss', 'show']:
if args[3] == 'fxcss': done(0 if env.get('SETUP_TEST_INSTALLED') or state.exists() else 1)
done(0 if env.get('SETUP_TEST_PILLOW') or state.exists() else 1)
done(0 if env.get('SETUP_TEST_PILLOW') or pillow.exists() else 1)
if args[:1] == ['install']:
if env.get('SETUP_TEST_INSTALL_FAIL'): done(1)
if args[1] == 'pipx': executable(apps / 'pipx')
else: state.touch(); executable(apps / 'fxcss')
else:
state.touch(); executable(apps / 'fxcss')
# Releases before 0.26 did not depend on Pillow.
if not env.get('SETUP_TEST_OLD_RELEASE'): pillow.touch()
done()
if args[:1] == ['inject']: state.touch(); done()
if args[:1] == ['inject']: pillow.touch(); done()
if args == ['ensurepath']: done(int(env.get('SETUP_TEST_PATH_FAIL', '0')))
print('Unexpected stub invocation', name, args, file=sys.stderr)
done(99)
Expand Down Expand Up @@ -126,10 +130,20 @@ def test_each_intent_installs_and_prints_matching_next_step(self):
result = self.run_setup('--yes', '--intent', intent)
self.assert_success(result)
self.assertIn(command, result.stdout)
self.assertIn(['pipx', 'install', 'fxcss[images]'], self.calls())
self.assertIn(['pipx', 'install', 'fxcss'], self.calls())
self.assertIn(['pipx', 'ensurepath'], self.calls())
self.assertFalse(any(c[1] == 'inject' for c in self.calls() if c[0] == 'pipx'))
self.assertTrue(all(call == ['fxcss', '--version'] for call in self.calls() if call[0] == 'fxcss'))

def test_new_install_of_a_release_without_pillow_gets_the_image_tools(self):
self.env['SETUP_TEST_OLD_RELEASE'] = '1'
self.assert_success(self.run_setup('--yes'))
calls = self.calls()
self.assertIn(['pipx', 'install', 'fxcss'], calls)
self.assertIn(['pipx', 'inject', 'fxcss', 'pillow>=10.1'], calls)
self.assertLess(calls.index(['pipx', 'install', 'fxcss']),
calls.index(['pipx', 'inject', 'fxcss', 'pillow>=10.1']))

def test_existing_install_is_preserved_and_missing_images_added(self):
self.env['SETUP_TEST_INSTALLED'] = '1'
self.assert_success(self.run_setup('--yes'))
Expand All @@ -146,7 +160,7 @@ def test_bootstrap_creates_persistent_pipx_then_cleans_temporary_venv(self):
self.assert_success(self.run_setup('--yes'))
self.assertTrue((self.apps / 'pipx').exists())
self.assertTrue(any(c[:3] == ['pipx', 'install', 'pipx'] for c in self.calls()))
self.assertIn(['pipx', 'install', 'fxcss[images]'], self.calls())
self.assertIn(['pipx', 'install', 'fxcss'], self.calls())
self.assertEqual(list(self.tmp.iterdir()), [])

def test_homebrew_installs_pipx_on_macos(self):
Expand Down Expand Up @@ -224,7 +238,7 @@ def test_piped_script_reads_menu_and_confirmation_from_tty(self):
status, output = self.run_piped([('Choose [1]:', '2'), ('Continue? [Y/n]:', 'y')])
self.assertEqual(status, 0, output)
self.assertIn('fxcss new my-theme', output)
self.assertIn(['pipx', 'install', 'fxcss[images]'], self.calls())
self.assertIn(['pipx', 'install', 'fxcss'], self.calls())

def test_cancel_from_piped_menu_does_not_install(self):
status, output = self.run_piped([('Choose [1]:', '0')])
Expand Down
Loading