Skip to content

Commit

Permalink
Build and publish to Test PyPI (#6)
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Chang <[email protected]>
  • Loading branch information
mocsharp authored Jan 9, 2025
1 parent a73c606 commit f0ed376
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 23 deletions.
42 changes: 25 additions & 17 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- name: Install library and dependencies
run: |
poetry run pip install --upgrade pip setuptools
poetry install --with test
poetry -vvv install --with test
- name: Run pre-commit Check
uses: pre-commit/[email protected]
Expand Down Expand Up @@ -173,19 +173,27 @@ jobs:
touch output/file
holoscan run -r $(docker images | grep "test-app-python" | awk '{print $1":"$2}') -i input -o output
# testpypi-deploy:
# name: Build and publish Python 🐍 distributions 📦 to TestPyPI
# runs-on: ubuntu-latest
# needs: test
# steps:

# - name: Checkout repository
# uses: actions/checkout@v4

# - name: Publish distribution 📦 to Test PyPI
# uses: JRubics/[email protected]
# continue-on-error: true
# with:
# pypi_token: ${{ secrets.TEST_PYPI_PASSWORD }}
# repository_name: 'testpypi'
# repository_url: 'https://test.pypi.org/legacy/'
testpypi-deploy:
name: publish-test-pypi
runs-on: ubuntu-latest
needs: [pre-commit, test]
permissions:
id-token: write
steps:

- name: Checkout repository
uses: actions/checkout@v4

- name: Install Poetry
uses: Gr1N/setup-poetry@v9

- name: Build
run: |
poetry build
rm dist/*.tar.gz
- name: Publish package distributions to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
verbose: true
26 changes: 20 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.
[tool.poetry]
name = "holoscan-cli"
version = "2.9.0"
version = "0.0.0"
description = "Command line interface for packaging and running Holoscan applications."
authors = ["NVIDIA"]
maintainers = ["mocsharp"]
Expand Down Expand Up @@ -55,9 +55,9 @@ classifiers = [
"Typing :: Typed",
]

[tool.poetry.build]
script = "build.py"
generate-setup-file = true
# [tool.poetry.build]
# script = "build.py"
# generate-setup-file = false

[tool.poetry.dependencies]
python = ">=3.9,<3.13"
Expand Down Expand Up @@ -110,6 +110,20 @@ addopts = """
--ignore=docs/
"""

[tool.poetry-dynamic-versioning]
enable = true
vcs = "git"
style = "pep440"
format-jinja = """
{%- if branch == 'main' -%}
{{ serialize_pep440(base, metadata=[branch_escaped]) }}
{%- elif branch.startswith("release/") -%}
{{ serialize_pep440(base, stage="rc", dev=distance, metadata=[commit]) }}
{%- else -%}
{{ serialize_pep440(base, stage="a", dev=distance, metadata=[branch_escaped, commit]) }}
{%- endif -%}
"""

[build-system]
requires = ["poetry-core", "setuptools"]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core", "setuptools", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]
build-backend = "poetry_dynamic_versioning.backend"

0 comments on commit f0ed376

Please sign in to comment.