Skip to content

pip users never receive the example configs the README tells them to copy #48

Description

@atdr

Filed with the Bug report template's structure. The run-specific fields do not apply and say so: this is a packaging defect found by inspecting the published artifacts, not something a run surfaces.

Before reporting

  • I searched the existing issues for this problem
  • I am running the latest version of contrail

contrail version

contrail 0.4.1, the published release inspected on PyPI. Present in every release that has shipped a wheel.

Command run

Not applicable. No command reveals this. The user follows README.md before running anything, finds the file it names is absent, and has nothing to report.

Importers configured

Not applicable.

What happened

README.md tells a new user to start from a shipped example:

cp config.example.json config.json      # no extra dependencies
cp config.example.yaml config.yaml      # commented; needs pip install "contrails[yaml]"

Anyone who installed with pip install contrails has neither file, so the first instruction in the configuration section fails with No such file or directory. Only someone working from a git checkout has them, which is why it has gone unnoticed.

Output

The sdist carries both files:

$ tar tzf contrails-0.4.1.tar.gz | grep config.example
contrails-0.4.1/config.example.json
contrails-0.4.1/config.example.yaml

The wheel does not. Its entire payload is contrail/ plus dist-info:

$ unzip -l contrails-0.4.1-py3-none-any.whl | grep -c config.example
0

Because pyproject.toml says:

[tool.hatch.build.targets.wheel]
packages = ["src/contrail"]

contrails-0.4.1-py3-none-any.whl matches every platform, so pip never falls back to the sdist and the examples never reach a normal install.

Python version

Not applicable. Independent of interpreter version.

How contrail is installed

pip install contrails==0.4.1. This is the condition for the bug: an editable or checkout install is unaffected.

Operating system

Not applicable. The wheel is py3-none-any, so every platform gets the same payload.

Suggested fixes

  1. contrail config init, writing a commented starter file from a template inside the package. Preferred: it works regardless of packaging, can refuse to overwrite an existing file, and emits the current schema rather than whatever shipped with the release. The README instruction becomes one command instead of a copy.
  2. Ship the examples inside the package as data files, with the README pointing at their installed location. Cheaper, but asks people to find a path inside site-packages.
  3. Documentation only: link the two files on GitHub for the current tag. Cheapest, and leaves the README telling people to copy files they do not have.

Whichever is chosen, docs/config.md and the README section both need to match, and the x-release-please-start-version markers mean any versioned link has to be wired into extra-files rather than written by hand.

Surfaced while documenting the config file in #45, and not fixed there because packaging stands entirely apart from the schema work.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentation

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions