Skip to content

Commit d1579c5

Browse files
committed
📦 use hatchling and github actions.
1 parent fcee1ac commit d1579c5

5 files changed

Lines changed: 123 additions & 67 deletions

File tree

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Python package
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
tags: ["v*"]
7+
pull_request:
8+
branches: [main, master]
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
python-version: ["3.9", "3.10", "3.11", "3.12"]
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install -e ".[test]"
30+
31+
- name: Test with pytest
32+
run: pytest
33+
34+
- name: Test with pytest coverage
35+
run: pytest --cov=./
36+
37+
build:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- name: Set up Python
43+
uses: actions/setup-python@v5
44+
with:
45+
python-version: "3.12"
46+
47+
- name: Install build dependencies
48+
run: |
49+
python -m pip install --upgrade pip
50+
pip install build
51+
52+
- name: Build package
53+
run: python -m build
54+
55+
- name: Upload artifacts
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: dist
59+
path: dist/

.travis.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

nwpc_workflow_model/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# coding: utf-8
2+
3+
try:
4+
from importlib.metadata import version
5+
__version__ = version("nwpc-workflow-model")
6+
except Exception:
7+
__version__ = "unknown"

pyproject.toml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
[build-system]
2+
requires = ["hatchling", "hatch-vcs"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "nwpc-workflow-model"
7+
dynamic = ["version"]
8+
description = "A workflow model using in operation systems at CEMC/CMA."
9+
readme = "README.md"
10+
license = {text = "MIT"}
11+
requires-python = ">=3.9"
12+
authors = [
13+
{name = "perillaroc", email = "perillaroc@gmail.com"},
14+
]
15+
keywords = ["nwpc", "workflow", "model"]
16+
classifiers = [
17+
"Development Status :: 2 - Pre-Alpha",
18+
"Intended Audience :: Developers",
19+
"License :: OSI Approved :: MIT License",
20+
"Programming Language :: Python :: 3.9",
21+
"Programming Language :: Python :: 3.10",
22+
"Programming Language :: Python :: 3.11",
23+
"Programming Language :: Python :: 3.12",
24+
]
25+
dependencies = []
26+
27+
[project.urls]
28+
Homepage = "https://github.com/cemc-oper/nwpc-workflow-model"
29+
30+
[project.optional-dependencies]
31+
test = [
32+
"pytest",
33+
]
34+
cov = [
35+
"pytest-cov",
36+
"codecov",
37+
]
38+
39+
[project.entry-points]
40+
41+
[tool.hatch.version]
42+
source = "vcs"
43+
44+
[tool.hatch.build.targets.sdist]
45+
include = [
46+
"/nwpc_workflow_model",
47+
"/tests",
48+
]
49+
50+
[tool.hatch.build.targets.wheel]
51+
packages = ["nwpc_workflow_model"]
52+
53+
[tool.hatch.build]
54+
exclude = [
55+
"docs",
56+
"contrib",
57+
]

setup.py

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)