Skip to content

Package graphik for proper release & distribution (replace vendored copies) #5

@dmccoystephenson

Description

@dmccoystephenson

Problem

graphik is consumed today by vendoring a pinned copy — every downstream project either adds graphik as a git submodule or copies graphik.py directly:

Consumer How it pulls graphik in
Preponderous-Software/roam submodule at src/lib/graphik/, from lib.graphik.src.graphik import Graphik
Preponderous-Software/apex copied into src/lib/graphiklib/, from lib.graphiklib.graphik import Graphik
Preponderous-Software/ophidian submodule at src/lib/graphik/
Preponderous-Software/patchwork copied graphik.py
Stephenson-Software/Tic-Tak-Toe git submodule graphik

There is no installable package and no real release mechanism. Consequences:

  • Every consumer pins a different copy at a different commit; there's no single "version 0.2.0 of graphik" they can depend on.
  • A bug fix here doesn't reach anyone until they manually bump a submodule or re-copy the file.
  • Import paths differ per consumer (lib.graphik.src.graphik vs lib.graphiklib.graphik), so there's no canonical import graphik.
  • Version metadata is inconsistent and unenforced: version.txt = 0.2.0 but pom.xml <version> = 0.2-alpha-1, and getVersion() returns an attribute that's never set.

Goal

Make graphik installable as a proper Python package with a real release/usage flow, so consumers can declare a versioned dependency (e.g. graphik==0.2.0) instead of vendoring source.

Packaging work required regardless of where we host it

  1. Add packaging metadata — a pyproject.toml (PEP 621) declaring name, version, the pygame dependency, and the package layout. Retire the vestigial Java pom.xml (this is a Python project) or, if it's intentionally kept, stop treating it as a version source.
  2. Settle the import path / layout. Today the module lives at src/main/python/preponderous/graphik/graphik.py (a Maven-style tree). Decide the canonical import — e.g. from preponderous.graphik import Graphik — and make the package build expose exactly that, so all consumers can converge on one import.
  3. Single source of version truth. Pick one (likely pyproject.toml or version.txt) and have everything else — including getVersion() — read from it. Fix the current drift.
  4. Build + publish workflow. A CI job (none exists yet) that builds an sdist/wheel and publishes on tag.

Distribution options (need a decision)

A. Public PyPI — standard, zero-infra, consumers just pip install graphik. Name availability on PyPI needs checking (graphik may be taken). Best reach; fully public.

B. Private index hosted on gateway — gateway already runs a Nexus instance (repo.dansplugins.com) serving Maven artifacts; Nexus OSS can also host PyPI-format repositories. Reusing it means no new infrastructure: publish wheels there and consumers install with an --index-url / pip.conf entry. Keeps releases in-house, consistent with how the Maven plugins are already distributed.

C. Interim: formalize the git-tag + submodule flow — until a package exists, at least cut real git tags/releases and standardize the submodule path/import across consumers, so everyone pins the same tagged commits. Lower effort, doesn't solve the "no pip install" problem but reduces drift.

Open questions

  • Public (PyPI) vs in-house (gateway/Nexus) — or publish to both?
  • Is the graphik name available on PyPI, and do we want the public namespace?
  • Canonical import path and final package layout?
  • Do we migrate existing consumers off vendored copies as part of this, or ship the package first and migrate them in follow-ups?

Filed as a design/discussion issue — the concrete packaging PRs (pyproject, version-source consolidation, CI publish) can be split out once the host + import-path decisions are made.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions