File: export_sdist_name.py

package info (click to toggle)
matplotlib 3.10.1%2Bdfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 78,352 kB
  • sloc: python: 147,118; cpp: 62,988; objc: 1,679; ansic: 1,426; javascript: 786; makefile: 104; sh: 53
file content (21 lines) | stat: -rw-r--r-- 486 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env python3

"""
Determine the name of the sdist and export to GitHub output named SDIST_NAME.

To run:
    $ python3 -m build --sdist
    $ ./ci/determine_sdist_name.py
"""
import os
from pathlib import Path
import sys


paths = [p.name for p in Path("dist").glob("*.tar.gz")]
if len(paths) != 1:
    sys.exit(f"Only a single sdist is supported, but found: {paths}")

print(paths[0])
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
    f.write(f"SDIST_NAME={paths[0]}\n")