-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pyproject: migrate to PDM build backend.
`.git_archival.txt` and the functionality of deriving SCM version from a GitHub generated archive is removed pending implementation of pdm-project/pdm-backend#194.
- Loading branch information
1 parent
a9d0380
commit d32ca04
Showing
5 changed files
with
27 additions
and
38 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
.git_archival.txt export-subst | ||
/amaranth/vendor/* -linguist-vendored |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from pdm.backend._vendor.packaging.version import Version | ||
|
||
|
||
# This is done in a PDM build hook without specifying `dynamic = [..., "version"]` to put all | ||
# of the static metadata into pyproject.toml. Tools other than PDM will not execute this script | ||
# and will use the generic version of the documentation URL (which redirects to /latest). | ||
def pdm_build_initialize(context): | ||
version = Version(context.config.metadata["version"]) | ||
if version.is_prerelease: | ||
url_version = "latest" | ||
else: | ||
url_version = f"v{version}" | ||
context.config.metadata["urls"]["Documentation"] += url_version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters