Skip to content

Commit 476b013

Browse files
authored
Merge pull request #112 from Exabyte-io/feature/SOF-7747
2 parents 31851f9 + 22a1979 commit 476b013

File tree

81 files changed

+239
-38
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+239
-38
lines changed

.github/workflows/cicd.yml

Lines changed: 90 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,69 @@
1-
name: Continuous testing and publication to NPM from 'main'
1+
name: Continuous Testing and Publication
22

3-
on: # yamllint disable-line rule:truthy
4-
workflow_dispatch:
5-
push:
3+
on: [ push ]
64

75
concurrency:
86
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
97
cancel-in-progress: true
108

11-
129
jobs:
10+
run-py-linter:
11+
runs-on: ubuntu-24.04
12+
strategy:
13+
matrix:
14+
python-version: [ 3.10.13 ]
1315

14-
run-linter:
15-
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout this repository
18+
uses: actions/checkout@v4
19+
with:
20+
lfs: true
21+
22+
- name: Checkout actions repository
23+
uses: actions/checkout@v4
24+
with:
25+
repository: Exabyte-io/actions
26+
token: ${{ secrets.BOT_GITHUB_TOKEN }}
27+
path: actions
28+
29+
- name: Run ruff linter
30+
uses: ./actions/py/lint
31+
with:
32+
python-version: ${{ matrix.python-version }}
33+
34+
run-py-tests:
35+
needs: run-py-linter
36+
runs-on: ubuntu-24.04
37+
strategy:
38+
matrix:
39+
python-version:
40+
- 3.10.x
41+
- 3.11.x
42+
- 3.12.x
43+
- 3.13.x
1644

1745
steps:
1846
- name: Checkout this repository
1947
uses: actions/checkout@v4
48+
with:
49+
lfs: true
2050

2151
- name: Checkout actions repository
2252
uses: actions/checkout@v4
2353
with:
2454
repository: Exabyte-io/actions
2555
token: ${{ secrets.BOT_GITHUB_TOKEN }}
2656
path: actions
27-
# TODO: re-add when we have Python code to lint
28-
# - name: Run Py linter
29-
# uses: ./actions/py/lint
30-
# with:
31-
# python-version: 3.10.13
32-
# targets: ./assets
57+
58+
- name: Run python unit tests
59+
uses: ./actions/py/pytest
60+
with:
61+
python-version: ${{ matrix.python-version }}
62+
unit-test-directory: tests/py
63+
bot-ssh-key: ${{ secrets.BOT_GITHUB_KEY }}
3364

3465
run-js-tests:
3566
runs-on: ubuntu-latest
36-
if: github.repository != 'Exabyte-io/template-definitions'
3767
strategy:
3868
matrix:
3969
node-version:
@@ -43,6 +73,8 @@ jobs:
4373
steps:
4474
- name: Checkout this repository
4575
uses: actions/checkout@v4
76+
with:
77+
lfs: true
4678

4779
- name: Checkout actions repository
4880
uses: actions/checkout@v4
@@ -51,15 +83,24 @@ jobs:
5183
token: ${{ secrets.BOT_GITHUB_TOKEN }}
5284
path: actions
5385

86+
- name: Run JS validate
87+
uses: ./actions/js/validate
88+
with:
89+
node-version: '20.x'
90+
skip-eslint: 'true'
91+
5492
- name: Run JS tests
5593
uses: ./actions/js/test
5694
with:
5795
node-version: ${{ matrix.node-version }}
5896

5997
publish-js-package:
60-
needs: [run-js-tests]
98+
needs:
99+
- run-js-tests
100+
- run-py-tests
101+
- run-py-linter
61102
runs-on: ubuntu-latest
62-
if: (github.repository != 'Exabyte-io/template-definitions') && (github.ref_name == 'main' || github.ref_name == 'dev')
103+
if: github.ref_name == 'main'
63104

64105
steps:
65106
- name: Checkout this repository
@@ -75,5 +116,38 @@ jobs:
75116
- name: Publish JS release
76117
uses: ./actions/js/publish
77118
with:
119+
node-version: 20.x
78120
npm-token: ${{ secrets.NPM_TOKEN }}
79121
github-token: ${{ secrets.BOT_GITHUB_TOKEN }}
122+
verify-tests: 'false'
123+
124+
publish-py-package:
125+
needs:
126+
- run-js-tests
127+
- run-py-tests
128+
- run-py-linter
129+
# Wait for JS publish step to publish the new tag
130+
- publish-js-package
131+
runs-on: ubuntu-latest
132+
if: github.ref_name == 'main'
133+
134+
steps:
135+
- name: Checkout this repository
136+
uses: actions/checkout@v4
137+
with:
138+
lfs: true
139+
140+
- name: Checkout actions repository
141+
uses: actions/checkout@v4
142+
with:
143+
repository: Exabyte-io/actions
144+
token: ${{ secrets.BOT_GITHUB_TOKEN }}
145+
path: actions
146+
147+
- name: Publish python release
148+
uses: ./actions/py/publish
149+
with:
150+
python-version: 3.10.13
151+
github-token: ${{ secrets.BOT_GITHUB_TOKEN }}
152+
pypi-api-token: ${{ secrets.PYPI_API_TOKEN }}
153+
publish-tag: 'false'

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,20 @@ node_modules/
66
.idea/
77
src/workflows/workflows.js
88
.DS_Store
9+
10+
# Python
11+
.venv*/
12+
*.pyc
13+
__pycache__/
14+
*.py[cod]
15+
*$py.class
16+
*.so
17+
.Python
18+
*.egg-info/
19+
.eggs/
20+
.pytest_cache/
21+
.mypy_cache/
22+
.coverage
23+
htmlcov/
24+
.tox/
25+
.ruff_cache/

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@
33
"version": "0.0.0",
44
"description": "WOrkflow DEfinitions",
55
"scripts": {
6-
"test": "nyc --reporter=text mocha --recursive --bail --require @babel/register/lib --require tests/setup.js tests",
7-
"lint": "eslint src tests && prettier --write src tests",
8-
"lint:fix": "eslint --fix --cache src tests && prettier --write src tests",
9-
"transpile": "babel --out-dir dist src",
6+
"test": "nyc --reporter=text mocha --recursive --bail --require @babel/register/lib --require tests/js/setup.js tests/js",
7+
"lint": "eslint src/js tests/js && prettier --write src/js tests/js",
8+
"lint:fix": "eslint --fix --cache src/js tests/js && prettier --write src/js tests/js",
9+
"transpile": "babel --out-dir dist/js src/js",
1010
"postinstall": "npm run transpile",
11-
"prettier": "prettier --check src tests",
11+
"prettier": "prettier --check src/js tests/js",
1212
"prepare": "husky install || exit 0"
1313
},
1414
"repository": {
1515
"type": "git",
1616
"url": "https://github.com/Exabyte-io/wode.git"
1717
},
18-
"main": "dist/index.js",
18+
"main": "dist/js/index.js",
1919
"files": [
2020
"/assets",
2121
"/dist",
22-
"/src",
22+
"/src/js",
2323
".babelrc",
2424
"build_workflows.js"
2525
],
@@ -88,7 +88,7 @@
8888
"node": ">=20.0.0"
8989
},
9090
"lint-staged": {
91-
"*.js": "eslint --cache --fix",
92-
"*.{js,css}": "prettier --write"
91+
"src/js/**/*.js": ["eslint --cache --fix", "prettier --write"],
92+
"tests/js/**/*.js": ["eslint --cache --fix", "prettier --write"]
9393
}
9494
}

pyproject.toml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
[project]
2+
name = "mat3ra-wode"
3+
dynamic = ["version"]
4+
description = "WOrkflow DEfinitions"
5+
readme = "README.md"
6+
requires-python = ">=3.10"
7+
license = {file = "LICENSE.md"}
8+
authors = [
9+
{ name = "Exabyte Inc.", email = "[email protected]" }
10+
]
11+
classifiers = [
12+
"Programming Language :: Python",
13+
"Programming Language :: Python :: 3",
14+
"Programming Language :: Python :: 3.10",
15+
"Programming Language :: Python :: 3.11",
16+
"Programming Language :: Python :: 3.12",
17+
"Programming Language :: Python :: 3.13",
18+
"Development Status :: 3 - Alpha",
19+
"Topic :: Software Development",
20+
]
21+
dependencies = [
22+
"numpy",
23+
]
24+
25+
[project.optional-dependencies]
26+
dev = [
27+
"pre-commit",
28+
"black",
29+
"ruff",
30+
"isort",
31+
"mypy",
32+
"pip-tools",
33+
]
34+
tests = [
35+
"coverage[toml]>=5.3",
36+
"pytest",
37+
"pytest-cov",
38+
]
39+
all = [
40+
"mat3ra-wode[tests]",
41+
"mat3ra-wode[dev]",
42+
]
43+
44+
[build-system]
45+
requires = [
46+
"setuptools>=42",
47+
"setuptools-scm[toml]>=3.4"
48+
]
49+
build-backend = "setuptools.build_meta"
50+
51+
[tool.setuptools_scm]
52+
git_describe_command = "git describe --tags --long"
53+
54+
[tool.setuptools.packages.find]
55+
where = ["src/py"]
56+
57+
[tool.black]
58+
line-length = 120
59+
target-version = ['py310']
60+
extend-exclude = '''
61+
(
62+
tests\/fixtures*,
63+
examples\/.*\/.*\.py
64+
| other\/.*\/.*\.(py|ipynb)
65+
)
66+
'''
67+
68+
[tool.ruff]
69+
extend-exclude = [
70+
"src/js",
71+
"tests/fixtures"
72+
]
73+
line-length = 120
74+
target-version = "py310"
75+
76+
[tool.ruff.per-file-ignores]
77+
"__init__.py" = ["F401"]
78+
79+
[tool.isort]
80+
profile = "black"
81+
multi_line_output = 3
82+
include_trailing_comma = true
83+
84+
[tool.pytest.ini_options]
85+
pythonpath = [
86+
"src/py",
87+
]
88+
testpaths = [
89+
"tests/py"
90+
]
91+
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)