Skip to content

Commit 7bca60a

Browse files
authored
ci: Add build-test-publish-wheel workflow (#114)
Signed-off-by: oliver könig <[email protected]>
1 parent 6eeb1f9 commit 7bca60a

File tree

5 files changed

+142
-90
lines changed

5 files changed

+142
-90
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Copyright (c) 2020-2021, NVIDIA CORPORATION.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Build, test, and publish a PyPi wheel (to testpypi)
16+
17+
on:
18+
push:
19+
branches:
20+
- "main"
21+
- "[rv][0-9].[0-9].[0-9]"
22+
- "[rv][0-9].[0-9].[0-9]rc[0-9]"
23+
pull_request:
24+
25+
defaults:
26+
run:
27+
shell: bash -x -e -u -o pipefail {0}
28+
29+
jobs:
30+
build-test-publish-wheel:
31+
uses: NVIDIA/NeMo-FW-CI-templates/.github/workflows/[email protected]
32+
with:
33+
dry-run: true
34+
python-package: nemo_run
35+
python-version: "3.10"
36+
packaging: hatch
37+
secrets:
38+
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
39+
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
40+
SLACK_WEBHOOK: ${{ secrets.SLACK_RELEASE_ENDPOINT }}
41+
SLACK_WEBHOOK_ADMIN: ${{ secrets.SLACK_WEBHOOK_ADMIN }}

nemo_run/__init__.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,9 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
from nemo_run import cli
1716
from nemo_run.api import autoconvert, dryrun_fn
1817
from nemo_run.config import Config, ConfigurableMixin, Partial, Script
19-
from nemo_run.core.execution.base import (
20-
Executor,
21-
ExecutorMacros,
22-
import_executor,
23-
)
18+
from nemo_run.core.execution.base import Executor, ExecutorMacros, import_executor
2419
from nemo_run.core.execution.dgxcloud import DGXCloudExecutor
2520
from nemo_run.core.execution.docker import DockerExecutor
2621
from nemo_run.core.execution.launcher import FaultTolerance, SlurmRay, SlurmTemplate, Torchrun
@@ -32,10 +27,13 @@
3227
from nemo_run.devspace.base import DevSpace
3328
from nemo_run.help import help
3429
from nemo_run.lazy import LazyEntrypoint, lazy_imports
30+
from nemo_run.package_info import __package_name__, __version__
3531
from nemo_run.run.api import run
3632
from nemo_run.run.experiment import Experiment
3733
from nemo_run.run.plugin import ExperimentPlugin as Plugin
3834

35+
from nemo_run import cli
36+
3937
__all__ = [
4038
"autoconvert",
4139
"cli",
@@ -70,9 +68,6 @@
7068
"Torchrun",
7169
"SlurmRay",
7270
"SlurmTemplate",
71+
"__version__",
72+
"__package_name__",
7373
]
74-
75-
try:
76-
from nemo_run._version import __version__
77-
except Exception:
78-
__version__ = "0.0.1"

nemo_run/package_info.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
from packaging.version import Version
15+
16+
__version__ = "0.2.0rc0.dev0"
17+
18+
MAJOR = Version(__version__).major
19+
MINOR = Version(__version__).minor
20+
PATCH = 3082
21+
if pre := Version(__version__).pre:
22+
PRE_RELEASE = "".join(map(str, pre))
23+
else:
24+
PRE_RELEASE = ""
25+
26+
DEV = Version(__version__).dev
27+
28+
__package_name__ = "nemo_curator"
29+
__contact_names__ = "NVIDIA"
30+
__contact_emails__ = "[email protected]"
31+
__homepage__ = "https://docs.nvidia.com/nemo-framework/user-guide/latest/datacuration/index.html"
32+
__repository_url__ = "https://github.com/NVIDIA/NeMo-Curator"
33+
__download_url__ = "https://github.com/NVIDIA/NeMo-Curator/releases"
34+
__description__ = (
35+
"NeMo Curator - Scalable Data Preprocessing Tool for Training Large Language Models"
36+
)
37+
__license__ = "Apache2"
38+
__keywords__ = "deep learning, machine learning, gpu, NLP, NeMo, nvidia, pytorch, torch, language, preprocessing, LLM, large language model"

pyproject.toml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ dependencies = [
2929
"jinja2>=3.1.4",
3030
"cryptography < 43.0.0",
3131
"networkx >= 3.3",
32-
"omegaconf>=2.3.0"
32+
"omegaconf>=2.3.0",
33+
"packaging"
3334
]
3435
readme = "README.md"
3536
requires-python = ">= 3.10"
@@ -125,10 +126,7 @@ allow-direct-references = true
125126
packages = ["nemo_run"]
126127

127128
[tool.hatch.version]
128-
source = "vcs"
129-
130-
[tool.hatch.build.hooks.vcs]
131-
version-file = "nemo_run/_version.py"
129+
path = "nemo_run/package_info.py"
132130

133131
[tool.ruff]
134132
line-length = 100

0 commit comments

Comments
 (0)