|
14 | 14 | for wheel_file in WHEEL_DIR.glob("*"):
|
15 | 15 | shutil.copy(wheel_file, SITE_ARTIFACT_WHEEL_DIR)
|
16 | 16 |
|
| 17 | + |
| 18 | +def package_name(wheel_file: pathlib.Path) -> str: |
| 19 | + return wheel_file.name.split("-")[0].replace("_", "-") |
| 20 | + |
| 21 | + |
17 | 22 | newline = "\n"
|
18 | 23 | (SITE_OUTPUT_DIR / "index.html").write_text(
|
19 | 24 | f"""
|
|
28 | 33 | <body>
|
29 | 34 | <div class="ui container">
|
30 | 35 | <h1 class="ui header" style="padding-top: 1.5em;">DataHub Python Builds</h1>
|
31 |
| - <p>Built at {datetime.now().strftime("%Y-%m-%d %H:%M:%S")}</p> |
| 36 | + <p> |
| 37 | + These prebuilt wheel files can be used to install our Python packages as of a specific commit. |
| 38 | + </p> |
| 39 | + <p>Built at {datetime.now().strftime("%Y-%m-%d %H:%M:%S")}.</p> |
32 | 40 |
|
33 | 41 | <p>
|
34 | 42 | Current base URL: <span class="base-url">unknown</span>
|
|
47 | 55 | newline.join(
|
48 | 56 | f'''
|
49 | 57 | <tr>
|
50 |
| - <td><code>{wheel_file.name.split('-')[0].replace('_', '-')}</code></td> |
| 58 | + <td><code>{package_name(wheel_file)}</code></td> |
51 | 59 | <td>{wheel_file.stat().st_size / 1024 / 1024:.3f} MB</td>
|
52 |
| - <td><code>pip install '<span class="base-url"><base-url></span>/artifacts/wheels/{wheel_file.name}'</code></td> |
| 60 | + <td><code>pip install '{package_name(wheel_file)} @ <span class="base-url"><base-url></span>/artifacts/wheels/{wheel_file.name}'</code></td> |
53 | 61 | </tr>
|
54 | 62 | '''
|
55 | 63 | for wheel_file in sorted(WHEEL_DIR.glob("*.whl"))
|
|
60 | 68 | </div>
|
61 | 69 | </body>
|
62 | 70 | <script>
|
| 71 | + const baseUrl = window.location.href.split('/').slice(0, -1).join('/'); |
63 | 72 | document.querySelectorAll(".base-url").forEach(el => {{
|
64 |
| - el.textContent = window.location.href.split('/').slice(0, -1).join('/'); |
| 73 | + el.textContent = baseUrl; |
65 | 74 | }});
|
66 | 75 | </script>
|
67 | 76 | </html>
|
68 | 77 | """
|
69 | 78 | )
|
70 | 79 |
|
71 |
| -print("Built site in", SITE_OUTPUT_DIR) |
| 80 | +print("DataHub Python wheel site built in", SITE_OUTPUT_DIR) |
0 commit comments