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

Documenting SETUPTOOLS_SCM_PRETEND_VERSION_FOR_${NORMALIZED_DIST_NAME} #981

Merged
merged 1 commit into from
Dec 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,22 @@ Callables or other Python objects have to be passed in `setup.py` (via the `use_
: used as the primary source for the version number
in which case it will be an unparsed string

!!! warning "it is strongly recommended to use use distribution name specific pretend versions"
!!! warning ""

it is strongly recommended to use distribution-specific pretend versions
(see below).

`SETUPTOOLS_SCM_PRETEND_VERSION_FOR_${NORMALIZED_DIST_NAME}`
: used as the primary source for the version number
in which case it will be an unparsed string
: used as the primary source for the version number,
in which case it will be an unparsed string.
Specifying distribution-specific pretend versions will
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I say something like "distribution-specific (aka package-specific)"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if it perhaps should change to python package name to disambiguate

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean in the docs, or in the docs and source code?

For convenience, #500 and #509 are the relevant PRs

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for parity, as a followup

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I finally got around to this today, and concluded:

  1. The term "distribution" is all over the Python docs (e.g. importlib.metadata, legacy install docs, setuptools docs)
  2. "dist" is also all over the place in the source code here

So I think it's fine to stick with the terminology "distribution" here after all. I am going to skip on opening a PR to change the wording from "dist" to "pkg"

avoid possible collisions with third party distributions
also using ``setuptools_scm``

the dist name normalization follows adapted PEP 503 semantics, with one or
more of ".-_" being replaced by a single "_", and the name being upper-cased

it takes precedence over ``SETUPTOOLS_SCM_PRETEND_VERSION``
this will take precedence over ``SETUPTOOLS_SCM_PRETEND_VERSION``

`SETUPTOOLS_SCM_DEBUG`
: enable the debug logging
Expand Down
Loading