Skip to content

Unclarity in Single-sourcing version option 1 #1069

Closed

Description

@soxofaan

https://github.com/pypa/packaging.python.org/blob/526ee6d6563855551bfee4d967a06823044ddbd4/source/guides/single-sourcing-package-version.rst#L8-L11

states:

Read the file in ...

but it's not clear which file (there is no preceding discussion about a file).
The meaning can be somewhat guessed from the code snippet below it, but that limits the interpretation to package/__init__.py, while it could be applied to other options too (e.g. package/version.py)

Activity

  1. bhrutledge commented on Apr 1, 2022

    @bhrutledge
    Contributor

    I think this whole document could/should be updated to favor methods that don't rely on setup.py, since the current recommendation to use setup.cfg. I also note that this is specific to setuptools, and there are now many other build backends, some of which probably have their own method of handling this.

    I'm tempted to re-purpose this issue as "Update single-sourcing package version recommendations", and probably close #616 as a duplicate. Off the top of my head, I might list the options as:

    • importlib.metadata (currently 5)
    • Version-updating tools (currently 2)
    • version = attr: package.__version__ (currently note in 1)
    • setuptools_scm (currently 7)
    • Methods from other build backends (flit, poetry, pdm, etc.)

    I wonder if @jaraco and/or @henryiii have thoughts.

  2. added
    type: bug
    on Jun 18, 2022
  3. pradyunsg commented on Jun 18, 2022

    @pradyunsg
    Member

    My 2 cents: Let's start simple, and fix the sentence ambiguity first. We shouldn't need to block minor sentence structure improvements on doing a major updates of various pages. :)

  4. ChrisBarker-NOAA commented on Jul 10, 2023

    @ChrisBarker-NOAA
    Contributor

    Here's a PR for more updates:

    #1273

  5. ncoghlan commented on Oct 15, 2024

    @ncoghlan
    Contributor

    Resolved in #1612

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

    component: guidestype: bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions