Skip to content

Modernize project setup - #826

Draft
soredake wants to merge 45 commits into
Syncplay:masterfrom
soredake:modernize-project-setup
Draft

soredake wants to merge 45 commits into
Syncplay:masterfrom
soredake:modernize-project-setup

Conversation

@soredake

@soredake soredake commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR modernizes how Syncplay is built, tested and packaged, and then fixes the problems that the resulting review found.

  • Project metadata and dependencies now live in pyproject.toml and uv.lock; setup.py and the hand-written requirements file are gone.
  • Application packaging moved to PyInstaller with a shared build.spec and a Windows installer build script, replacing the previous per-platform packaging scripts.
  • Windows, macOS (universal2) and Linux artifacts are built by one workflow, which also produces the Debian package and the AppImage.
  • Translation modules live in the syncplay.messages package.
  • Qt binding, GUI/configuration and packaging-script fixes that the move required.

On top of that, a review round added 12 commits (62a2d0b..aa1690c) that fix concrete bugs and close the gaps found while reviewing this PR. Nothing in the application's behaviour, wire protocol or configuration format was changed by that round.

Fixes added in the review round

Packaging and metadata

  • efbb9bd — ship everything: MANIFEST.in now recurses into syncplay/resources, includes ci/ and docs/, and excludes *.py[cod]. Verified 88/88 resource files present in both wheel and sdist.
  • 002768b — the version comes from syncplay.version (dynamic metadata) instead of four independent sed/awk/PowerShell scrapers in the build scripts.
  • a37c8fa — metadata fixes: [project.urls], authors/maintainers, keywords, the Apache classifier, pywin32 runtime dependency, importlib-metadata removed (unused), dmgbuild limited to macOS, uv.lock refreshed.
  • 2b9fc83 — deleted requirements.py (a second generator of the same, now stale data) and dropped the toml dependency it needed only on old Pythons.

Tests and CI

  • 521dd62 — tests/test_smoke.py: version, entry points, translation lookup, resource availability and a GUI import test. Six tests, no new dependencies, no network access.
  • 65d6295 — a test job that fails on a stale lock, runs the suite, builds wheel and sdist, then installs the wheel into a clean environment and runs the suite again from an unrelated working directory.
  • f3881a5 — workflow hygiene: pull_request trigger, no duplicate runs for same-repo branches, permissions: contents: read, concurrency group, current action versions, shorter artifact retention for PR runs.
  • bc9371b — a lint gate (ruff, narrow error-class rules only) plus grouped weekly Dependabot updates for uv and GitHub Actions.

Platform builds

  • a391615 — the macOS job no longer declares its own cffi/zope.interface pins; the versions are declared once, where the universal2 requirement lives.
  • d6e4602 — build.spec: upx disabled on macOS (it breaks the signature), bundle identifier, CFBundleVersion, LSMinimumSystemVersion; the "Python 3.4" guards are gone from both launchers.
  • bc946a4 — Debian packaging: Depends: python3 (>= 3.8) instead of an impossible version, dpkg-deb --build, a valid Maintainer, and a portable install in GNUmakefile (no sed -i, no __pycache__ in the package).

Documentation

  • aa1690c — a Development section in README.md: uv sync, running the tests, the lint gate, and the packaging scripts.

Verification

Run locally on Windows with CPython 3.12 + PySide6:

  • uv lock --check clean and uv sync --locked --all-extras --dev succeeds.
  • ruff check . clean.
  • python -m unittest discover -s tests -> 6/6 pass.
  • The same suite in a fresh Python 3.8.20 environment with PySide2 5.15.2.1 -> 6/6 pass (this is the requires-python floor the project actually supports).
  • uv build produces wheel and sdist; the wheel installed into a clean virtualenv runs the suite from outside the source tree -> 6/6, with the GUI test skipping where Qt is absent.
  • MANIFEST.in output checked against the source tree: 88/88 resource files, plus ci/ and docs/, in both artifacts.
  • Both workflow files parse as YAML.
  • PyInstaller build from the edited build.spec produces Syncplay.exe and syncplayServer.exe, and the frozen server starts and reports its version.

Not verified in this environment, and worth a look from a reviewer who has the hardware: the macOS universal2 and Debian/AppImage jobs were reviewed but not executed (no macOS or Linux host available here); the client GUI was not driven interactively; and no CI run has reported for aa1690c yet.

Contribution guidelines

This work follows the guide attached to #763:

  • Python 3.8-3.12. requires-python = ">=3.8" is kept, no walrus operator, no match/case, no 3.9+ stdlib, no f-strings in the new code, and the suite is actually executed on 3.8 as well as 3.12.
  • No behaviour, protocol or configuration change. No protocol fields, no _config/_iniStructure keys, no user-visible strings, so nothing needed in messages_en.py and no getMessage() impact. No new runtime dependency.
  • One new tool, flagged for agreement: ruff is added as a dev-only dependency to serve as the lint gate. If the project would rather not carry it, it can be dropped from pyproject.toml and invoked in CI without being installed.
  • Minimal, focused changes. Each commit is one concern, no drive-by reformatting, and the packaging fixes keep the existing paths (the Debian build still installs through GNUmakefile, COLLECT is untouched) rather than restructuring them unverifiably.
  • Cross-platform. The macOS pins (cryptography, charset-normalizer) are kept deliberately: newer releases drop the macosx_10_9_universal2 wheels this build needs.
  • The guide's map is now stale: it documents syncplay/messages.py and syncplay/messages_*.py; after the package move in this PR those paths no longer exist. Worth updating the guide/wiki together with this PR.

Left out of scope, but visible from the same review: 21 message keys are missing from all 13 non-English languages (pre-existing; getMessage() falls back to English, the NSIS build warns about it), there are pre-existing print() calls in ep_server.py/client.py, and isNoOSDMessage() decides OSD suppression from translated message text. Each is a separate, riskier change and does not belong in a build-system PR.

AI assistance

Parts of this PR were written with an AI coding agent (Codebuff, an LLM-based assistant); the commits carry the attribution trailer. Following #763, every change was reviewed and tested locally before pushing, the commands and results are in Verification above, and the work is split into small, self-contained commits so each one can be read, amended or reverted on its own. No unreviewed machine-generated code is included.

This work is based on #718.

mindstormjak and others added 14 commits October 30, 2026 15:08
- Use uv for package management during development
- Update the qt.py bindings
- Replace packaging with pyinstaller
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@soredake
soredake marked this pull request as draft November 5, 2026 18:50
soredake and others added 15 commits November 6, 2026 10:30
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the Windows Vista style with PySide6 on Windows.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
soredake and others added 2 commits November 6, 2026 12:15
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@soredake
soredake force-pushed the modernize-project-setup branch from e470b62 to 4df76bc Compare November 6, 2026 10:31
soredake and others added 14 commits November 6, 2026 12:40
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The MANIFEST globs only matched a few extensions at the top of
syncplay/resources, so the built wheel silently lost icon.ico, icon.icns,
the hicolor icons and the macOS dmg assets, and the sdist could not
reproduce a Linux install or an installer build at all. Include the whole
resources tree plus the CI scripts, man pages and packaging files.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
The version was written in pyproject.toml as well as syncplay/__init__.py,
so the two had to be bumped in lockstep, and four different scrapers then
re-parsed the module (sed, awk twice, and a PowerShell regex). Build the
version dynamically from the module and read it through Python everywhere.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Project-URL was passed as a URL label, so the built wheel advertised
"Project-URL: Project-URL, https://syncplay.pl/"; authors were dropped
entirely and the Apache license classifier that setup.py declared was lost.
Declare real project URLs, authors, maintainers, keywords and the license
classifier, swap the abandoned pypiwin32 shim for pywin32, drop the unused
importlib-metadata dependency and mark dmgbuild as macOS-only.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Nothing in the tree checked that the shipped package was usable: entry
points could stop importing, a translation module could be dropped, or a
resource could vanish from the wheel without any test noticing. Cover the
version, both entry modules, every translation, the main window import (when
a Qt binding is installed) and the runtime plus installer resources, and run
the same suite against a wheel installed into a clean virtual environment.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
The workflow only proved that an installer could be produced, never that
the package inside it imports or carries its data files, and a lockfile out
of sync with pyproject.toml was silently re-locked instead of failing. Add a
test job that runs the smoke tests against the checkout and again against the
built wheel installed in a clean environment, with uv lock --check as a gate.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Pushes to pull request branches built everything twice, the jobs ran with a
write-capable token they never use, and every run kept its artifacts for the
full default retention. Build master and tags only, cancel superseded runs,
drop to read-only permissions, use one version of each action and bound
artifact retention to seven days for pull requests and fourteen otherwise.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
cffi and zope.interface were force-rebuilt from hand-written versions that
drift from uv.lock, while cryptography and charset-normalizer were repeated
in both the download and the install line. Compile the locked versions and
declare the universal2-only pins once, with a note on why they cannot follow
the lock (cryptography no longer publishes universal2 wheels).

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
The universal2 bundle was packed with UPX and then ad-hoc signed, which
corrupts the Mach-O headers codesign inspects; the declared minimum system
version (10.12) predates what the bundled Qt 6 requires; and the bundle
identifier was left empty while the plist hardcoded one. Disable UPX on
macOS, state macOS 11 as the minimum, declare the identifier once and give
the bundle a numeric version. Also drop the "Python 3.4 or newer" guards from
the launchers, which contradict requires-python.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
The package declared Python 3.6 while the project requires 3.8, the
Maintainer field had no name, and dpkg -b is deprecated in favour of
dpkg-deb --build. In the makefile the launcher was copied and then rewritten
in place with sed -i, which is GNU-only despite the BSD branch above it, and
the whole source tree was installed with its __pycache__ directories.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
requirements.py re-parsed pyproject.toml with the toml package to emit two
requirements files that nothing in the tree installs from, and uv export
already produces them on demand. Delete it, drop its toml dependency and let
uv own dependency resolution.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
The new lockfile and the pinned actions will rot silently without something
watching them, and nothing checked the tree before a build. Enable a small
ruff rule set limited to real breakage (undefined names, syntax errors) with
the vendored Qt helper and the injected-globals scripts excluded, run it in
the test job, and let Dependabot keep uv.lock and the actions current.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
After moving to uv, PyInstaller and no setup.py, nothing in the repository
told a contributor how to install, run, test or build the project, so the
workflow only existed in chat history and on the website. Add a short
development section covering the commands, where each artifact is built and
which file holds the version.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants