Skip to content

Commit

Permalink
fix: back-compat for normalizing name too
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
  • Loading branch information
henryiii committed Aug 2, 2023
1 parent 59f9bdb commit 3576bdc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
10 changes: 10 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,16 @@ probably keep in sync with your build-system requirements.
minimum-version = "0.2"
```

:::{warning}

The following behaviors are affected by `minimum-version`:

- `minimum-version` 0.5+ (or unset) provides the original name in metadata and
properly normalized SDist names.
- `minimum-version` 0.5+ (or unset) strips binaries by default.

:::

## CMake and Ninja minimum versions

You can select a different minimum version for CMake and Ninja.
Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def _run_tests(
session.run("pytest", *run_args, *posargs, env=env)


@nox.session(python="3.7")
@nox.session
def tests(session: nox.Session) -> None:
"""
Run the unit and regular tests. Includes coverage if --cov passed.
Expand Down
7 changes: 6 additions & 1 deletion src/scikit_build_core/settings/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from typing import Any

from packaging.version import Version
from pyproject_metadata import StandardMetadata

from ..settings.skbuild_model import ScikitBuildSettings
Expand Down Expand Up @@ -46,5 +47,9 @@ def get_standard_metadata(

metadata = StandardMetadata.from_pyproject(pyproject_dict)
# pyproject-metadata normalizes the name - see https://github.com/FFY00/python-pyproject-metadata/pull/65
metadata.name = pyproject_dict["project"]["name"]
# For scikit-build-core 0.5+, we keep the un-normalized name, and normalize it when using it for filenames
if settings.minimum_version is None or Version(settings.minimum_version) >= Version(
"0.5"
):
metadata.name = pyproject_dict["project"]["name"]
return metadata

0 comments on commit 3576bdc

Please sign in to comment.