Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclarity in Single-sourcing version option 1 #1069

Closed
soxofaan opened this issue Apr 1, 2022 · 4 comments
Closed

Unclarity in Single-sourcing version option 1 #1069

soxofaan opened this issue Apr 1, 2022 · 4 comments
Labels
component: guides type: bug A confirmed bug or unintended behavior

Comments

@soxofaan
Copy link
Contributor

soxofaan commented Apr 1, 2022

There are many techniques to maintain a single source of truth for the version
number of your project:
#. Read the file in :file:`setup.py` and get the version. Example (from `pip setup.py

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)

@bhrutledge
Copy link
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.

@pradyunsg pradyunsg added component: guides type: bug A confirmed bug or unintended behavior labels Jun 18, 2022
@pradyunsg
Copy link
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. :)

@ChrisBarker-NOAA
Copy link
Contributor

Here's a PR for more updates:

#1273

@ncoghlan
Copy link
Member

Resolved in #1612

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: guides type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

6 participants
@soxofaan @ChrisBarker-NOAA @ncoghlan @bhrutledge @pradyunsg and others