Skip to content

Add more URLs to package #1156

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

Merged
merged 7 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ name = "onnxscript"
dynamic = ["version"]
description = "Naturally author ONNX functions and models using a subset of Python"
authors = [{ name = "Microsoft Corporation", email = "[email protected]" }]
urls = { "Repository" = "https://github.com/microsoft/onnxscript" }
readme = "README.md"
requires-python = ">=3.8"
license = { file = "LICENSE" }
Expand Down
14 changes: 13 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import datetime
import os
import pathlib
import subprocess

import setuptools

Expand All @@ -15,9 +16,20 @@
VERSION_FILE = ROOT_DIR / "VERSION"
version = VERSION_FILE.read_text().strip()

project_urls = {
"Repository": "https://github.com/microsoft/onnxscript",
}
if os.environ.get("ONNX_SCRIPT_RELEASE") != "1":
date = datetime.date.today().strftime("%Y%m%d")
version = f"{version}.dev{date}"

commit_hash_cmd = subprocess.run(
["git", "rev-parse", "HEAD"], stdout=subprocess.PIPE, check=False
)
if commit_hash_cmd.returncode == 0:
project_urls[
"Commit"
] = f"https://github.com/microsoft/onnxscript/tree/{commit_hash_cmd.stdout.decode('utf-8').strip()}"

# NOTE: Do not include other metadata in setup.py. Put it in pyproject.toml.
setuptools.setup(version=version)
setuptools.setup(version=version, project_urls=project_urls, url="https://onnxscript.ai/")