-
-
Notifications
You must be signed in to change notification settings - Fork 216
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
Be nicer about possible misconfigurations #1004
base: main
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
* Add "just-tag" * docs too * rename * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Rename * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Dont autoformat this * docs warning --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
normcase around realpath all over the place should help to operate with normalized paths in general
this ensures we dont spam projects
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i like the idea behind how the details change, but i aslo beleive a larger change is necessary to do the path/version scheme handling in a better way
due to personal time constraints it may take a be a while to propperly reiterate this
thank you for getting the ball rolling and preparing this as a initial vesion
warnings.warn( | ||
"Expected tag_regex to contain a single match group or a group named" | ||
" 'version' to identify the version part of any tag." | ||
raise ValueError( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one is possibly a breaking change im not sure we can integrate it off hand
@@ -105,6 +105,9 @@ class Configuration: | |||
|
|||
parent: _t.PathT | None = None | |||
|
|||
def __post_init__(self) -> None: | |||
self.tag_regex = _check_tag_regex(self.tag_regex) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
taking this here without leaving it in place creates potental trouble for valies valid in config but not in the config objects
@@ -139,13 +142,11 @@ def from_data( | |||
given configuration data | |||
create a config instance after validating tag regex/version class | |||
""" | |||
tag_regex = _check_tag_regex(data.pop("tag_regex", None)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this check needs to say even if the validation gets more struct
cleanups + bugfixes
All required types are part of the stdlib as of Python 3.10
Apply assorted repo-review rules
I found the current discussion around version files somewhat confusing. When you're reading the usage guide, the second point is telling you to make a version file; strongly implying you should. But in reality, you most likely do not need to bother with keeping a specific version file. Explain more clearly about the implications of this. Under this is a section on using `python -m setuptools_scm --help` which seems like an orphan from the "as a cli" section; move it down there. The runtime section starts by telling you what is strongly discouraged without explaination why. Make it clearer by giving the first example as the most supported thing, which is using standard importlib; then briefly discuss the version file from above, explaining what's in it for a standard Python template, then the strongly discouraged direct import method. In the config doc, update to discuss `importlib` for consistency. Correct some capitalization and other minor formatting bits while we're here.
Rename the project to setuptools-scm
`version.py` including `__all__`
Better cleanup PYTHONPATH for Mercurial calls (support for PDM)
Signed-off-by: Anchal Agarwal <[email protected]>
I had a difficult time finding the implementations in the docs, despite knowing of their existence. Adding this cross-reference should help. x
In PEP 440, "local" refers to the optional portion of a version after the `+` <https://peps.python.org/pep-0440/#local-version-identifiers>. But `version_scheme` doesn't apply to this part.
Most people reading this sentence probably don't have PEP 440 memorized.
Improve the docs about `version_scheme` and `local_scheme`
Fixes pypa#1090. Pinned requirement to tomli<=2.0.2.
Add a lower bound pin on setuptools dependency
docs: clarify usage of version files
pipx.run entry-points should be setuptools-scm
Mention SETUPTOOLS_SCM_PRETEND_VERSION_FOR in error message
i pushed a merge to validate with current code - i have to do a release before merging this |
Fixes #1003 by turning situations where the user might get an
AssertionError
and turn them into descriptiveValueError
s.Additionally, tests have been added to test the behavior.
The situations fixed are (with the real-world facepalm situations I ended up in):
version_scheme
andlocal_scheme
don't existversion_scheme
andlocal_scheme
don't return anythingreturn
to my custom schemetag_regex
is bad, and was loaded from the configtag_regex
matched, but the version was blank