Skip to content

build: include build-shell-completions.sh in sdist #5625

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

Conversation

bastimeyer
Copy link
Member

Some packagers are currently patching the versioningit fallback version string, which isn't meant for setting the right version. It's a fallback for when not using the dist tarball or a git repo with at least one tag.

The packagers need to do that because they incorrectly use the tarball generated by GitHub as package source instead of our signed sdist tarball which has the right version string already built in.

# signed Streamlink sdist tarball
$ curl -sSL https://github.com/streamlink/streamlink/releases/download/6.2.1/streamlink-6.2.1.tar.gz \
  | bsdtar -xOf- streamlink-6.2.1/src/streamlink/_version.py \
  | grep __version__
__version__ = "6.2.1"

# tarball built by GitHub from the git tag
$ curl -sSL https://github.com/streamlink/streamlink/archive/refs/tags/6.2.1.tar.gz \
  | bsdtar -xOf- streamlink-6.2.1/src/streamlink/_version.py \
  | grep __version__
__version__ = _get_version()

The second commit therefore adds and updates the version string comments accordingly, while the first one adds the missing shell completions build-script to the sdist, despite the sdist including pre-built shell completions in the completions directory, so that there's no need to ever use the GH tarball, even when building the completions manually.

@bastimeyer bastimeyer force-pushed the build/include-completions-script-in-sdist branch from 5918046 to 6a285c2 Compare October 21, 2023 15:31
@bastimeyer
Copy link
Member Author

Removed the second commit...

I will remove the versioningit build requirement altogether in the sdist, as it's a no-op here anyway. This will require an override of the setuptools sdist hook while taking care of the override versioningit provides. The hook will simply comment out the build-system.requires field in pyproject.toml with a regex substitution. Building a wheel from the sdist with the embedded version string and installing it should then "just work" without versioningit.

I already have something ready here on my system, but before I'm opening a new PR, I will need to perform some additional checks.

Going to merge this PR here now.

@bastimeyer bastimeyer merged commit 80a7645 into streamlink:master Oct 21, 2023
@bastimeyer bastimeyer deleted the build/include-completions-script-in-sdist branch October 21, 2023 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants