-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create nv-ingest-api wheel and publish nightly to artifactory (#430)
- Loading branch information
Showing
7 changed files
with
72 additions
and
14 deletions.
There are no files selected for viewing
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
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
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,7 @@ | ||
exclude *.egg-info | ||
|
||
include README.md | ||
include LICENSE | ||
recursive-include src * | ||
global-exclude __pycache__ | ||
global-exclude *.pyc |
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,11 +1,11 @@ | ||
[build-system] | ||
requires = ["setuptools", "wheel"] # Tools needed to build the project | ||
requires = ["setuptools", "wheel"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "nv-ingest-api" | ||
version = "24.12.dev0" | ||
description = "Python module with core document ingestion functions." | ||
dynamic = ["version"] # Declare attrs that will be generated at build time | ||
readme = "README.md" | ||
authors = [ | ||
{name = "Jeremy Dyer", email = "[email protected]"} | ||
|
@@ -29,3 +29,6 @@ documentation = "https://docs.nvidia.com/nv-ingest" | |
|
||
[tool.setuptools.packages.find] | ||
where = ["src"] | ||
|
||
[tool.setuptools.dynamic] | ||
version = {attr = "version.get_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# SPDX-FileCopyrightText: Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. | ||
# All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
|
||
import datetime | ||
import os | ||
import re | ||
|
||
|
||
def get_version(): | ||
release_type = os.getenv("NV_INGEST_RELEASE_TYPE", "dev") | ||
version = os.getenv("NV_INGEST_VERSION") | ||
rev = os.getenv("NV_INGEST_REV", "0") | ||
|
||
if not version: | ||
version = f"{datetime.datetime.now().strftime('%Y.%m.%d')}" | ||
|
||
# Ensure the version is PEP 440 compatible | ||
pep440_regex = r"^\d{4}\.\d{1,2}\.\d{1,2}$" | ||
if not re.match(pep440_regex, version): | ||
raise ValueError(f"Version '{version}' is not PEP 440 compatible") | ||
|
||
# Construct the final version string | ||
if release_type == "dev": | ||
# If rev is not specified and defaults to 0 lets create a more meaningful development | ||
# identifier that is pep440 compliant | ||
if int(rev) == 0: | ||
rev = datetime.datetime.now().strftime("%Y%m%d%H%M%S") | ||
final_version = f"{version}.dev{rev}" | ||
elif release_type == "release": | ||
final_version = f"{version}.post{rev}" if int(rev) > 0 else version | ||
else: | ||
raise ValueError(f"Invalid release type: {release_type}") | ||
|
||
return final_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
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