Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI

on:
push:
branches: [develop, main]
pull_request:
branches: [develop, main]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install -e ".[dev]"
- name: Run tests
run: pytest -m "not slow and not integration"

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: pip install -e ".[dev]"
Comment thread
coketaste marked this conversation as resolved.
- name: Check formatting (black)
run: black --check src/ tests/
- name: Check imports (isort)
run: isort --check src/ tests/
- name: Lint (flake8)
run: flake8 src/ tests/
90 changes: 90 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Publish to PyPI

on:
release:
types: [published]
workflow_dispatch:
inputs:
target:
description: 'Publish target'
required: true
default: 'testpypi'
type: choice
options:
- testpypi
- pypi

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install build tools
run: pip install build
- name: Build sdist and wheel
run: python -m build
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/

test-install:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Install wheel
run: pip install dist/*.whl
- name: Verify CLI entry point
run: madengine --help
- name: Verify import and version
run: python -c "import madengine; print(madengine.__version__)"

Comment thread
coketaste marked this conversation as resolved.
publish-testpypi:
needs: test-install
if: >-
github.event_name == 'workflow_dispatch' &&
github.event.inputs.target == 'testpypi'
runs-on: ubuntu-latest
environment: testpypi
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

publish-pypi:
needs: test-install
if: >-
github.event_name == 'release' ||
(github.event_name == 'workflow_dispatch' &&
github.event.inputs.target == 'pypi')
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST
*.whl
*.tar.gz

# PyInstaller
# Usually these files are written by a Python script from a template
Expand Down
7 changes: 7 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
include LICENSE
include README.md
include CHANGELOG.md
include pyproject.toml
recursive-include src/madengine/scripts *
recursive-include src/madengine/deployment/presets *.json
recursive-include src/madengine/deployment/templates *.j2 *.yaml
Comment thread
coketaste marked this conversation as resolved.
Outdated
50 changes: 32 additions & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,49 @@ authors = [
]
description = "MAD Engine is a set of interfaces to run various AI models from public MAD."
readme = "README.md"
requires-python = ">=3.8"
license = {text = "MIT"}
requires-python = ">=3.9"
keywords = ["ai", "ml", "docker", "rocm", "amd", "benchmark", "automation", "gpu"]
dependencies = [
"pandas",
"GitPython",
"jsondiff",
"sqlalchemy",
"paramiko",
"tqdm",
"typing-extensions",
"pymongo",
"toml",
"pandas>=1.3",
"GitPython>=3.1",
"jsondiff>=2.0",
"sqlalchemy>=1.4",
"paramiko>=2.9",
"tqdm>=4.60",
"typing-extensions>=4.0",
"pymongo>=4.0",
"toml>=0.10",
"typer>=0.9.0",
"rich>=13.0.0",
"click>=8.0.0",
"jinja2>=3.0.0",
"pyyaml>=6.0",
]
classifiers = [
"Programming Language :: Python :: 3",
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Testing",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]

[project.scripts]
madengine = "madengine.cli.app:cli_main"

[project.urls]
Homepage = "https://github.com/ROCm/madengine"
Repository = "https://github.com/ROCm/madengine"
Issues = "https://github.com/ROCm/madengine/issues"
Changelog = "https://github.com/ROCm/madengine/blob/develop/CHANGELOG.md"

[project.optional-dependencies]
dev = [
Expand Down Expand Up @@ -75,11 +89,11 @@ all = [
"pre-commit",
]

[tool.hatch.build.targets.wheel]

[tool.hatch.build.targets.wheel.force-include]
"src/madengine/scripts" = "madengine/scripts"
"src/madengine/deployment/templates" = "madengine/deployment/templates"
[tool.hatch.build]
artifacts = [
"src/madengine/scripts/**/*",
"src/madengine/deployment/templates/**/*",
]

Comment thread
coketaste marked this conversation as resolved.
[tool.hatch.version]
source = "versioningit"
Expand All @@ -99,7 +113,7 @@ distance-dirty = "{base_version}.post{distance}+{vcs}{rev}.d{build_date:%Y%m%d}"
# Code formatting and linting configuration
[tool.black]
line-length = 88
target-version = ['py38', 'py39', 'py310', 'py311']
target-version = ['py39', 'py310', 'py311', 'py312']
include = '\.pyi?$'
extend-exclude = '''
/(
Expand All @@ -123,7 +137,7 @@ known_first_party = ["madengine"]
known_third_party = ["pytest", "pandas", "numpy", "sqlalchemy"]

[tool.mypy]
python_version = "3.8"
python_version = "3.9"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = false
Expand Down
Loading
Loading