Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDILab开源决策智能平台
treevalue
提交
911c2737
T
treevalue
项目概览
OpenDILab开源决策智能平台
/
treevalue
大约 1 年 前同步成功
通知
3
Star
213
Fork
3
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
treevalue
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
911c2737
编写于
6月 20, 2022
作者:
HansBug
😆
1
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'main' into doc/readme
上级
602931bf
ee2a5527
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
267 addition
and
115 deletion
+267
-115
.github/workflows/release.yml
.github/workflows/release.yml
+94
-9
.github/workflows/release_test.yml
.github/workflows/release_test.yml
+116
-0
.github/workflows/run.yml
.github/workflows/run.yml
+1
-1
.github/workflows/test.yml
.github/workflows/test.yml
+6
-103
Makefile
Makefile
+4
-1
pyproject.toml
pyproject.toml
+37
-1
requirements-test.txt
requirements-test.txt
+1
-0
test/entry/cli/test_graph.py
test/entry/cli/test_graph.py
+8
-0
未找到文件。
.github/workflows/release.yml
浏览文件 @
911c2737
...
...
@@ -5,8 +5,8 @@ on:
types
:
[
published
]
jobs
:
release
:
name
:
Publish to official pypi
source_
release
:
name
:
Publish
source package
to official pypi
runs-on
:
${{ matrix.os }}
if
:
${{ github.repository == 'opendilab/treevalue' }}
strategy
:
...
...
@@ -14,11 +14,7 @@ jobs:
os
:
-
'
ubuntu-18.04'
python-version
:
-
'
3.6'
-
'
3.7'
-
'
3.8'
-
'
3.9'
-
'
3.10'
steps
:
-
name
:
Checkout code
...
...
@@ -39,10 +35,99 @@ jobs:
pip install --upgrade build
-
name
:
Build packages
run
:
|
make
package
make
zip
-
name
:
Publish distribution 📦 to real PyPI
uses
:
pypa/gh-action-pypi-publish@master
with
:
password
:
${{ secrets.PYPI_PASSWORD }}
skip_existing
:
true
verbose
:
true
\ No newline at end of file
verbose
:
true
-
name
:
Upload distribution 📦 to github release
uses
:
svenstaro/upload-release-action@v2
with
:
repo_token
:
${{ secrets.GITHUB_TOKEN }}
file
:
dist/*
tag
:
${{ github.ref }}
file_glob
:
true
wheel_release
:
name
:
Try build the wheels
runs-on
:
${{ matrix.os }}
strategy
:
fail-fast
:
false
matrix
:
os
:
-
'
ubuntu-18.04'
# - 'windows-2019'
-
'
macos-10.15'
python
:
-
'
3.6'
-
'
3.7'
-
'
3.8'
-
'
3.9'
-
'
3.10'
architecture
:
-
x86_64
-
arm64
-
aarch64
-
x86
-
AMD64
exclude
:
-
os
:
ubuntu-18.04
architecture
:
arm64
-
os
:
ubuntu-18.04
architecture
:
x86
-
os
:
ubuntu-18.04
architecture
:
AMD64
-
os
:
windows-2019
architecture
:
x86_64
-
os
:
windows-2019
architecture
:
arm64
-
os
:
windows-2019
architecture
:
aarch64
-
os
:
macos-10.15
architecture
:
aarch64
-
os
:
macos-10.15
architecture
:
x86
-
os
:
macos-10.15
architecture
:
AMD64
-
python
:
'
3.6'
architecture
:
arm64
-
python
:
'
3.7'
architecture
:
arm64
steps
:
-
name
:
Checkout code
uses
:
actions/checkout@v2
with
:
fetch-depth
:
20
-
name
:
Set up QEMU
if
:
${{ runner.os == 'Linux' }}
uses
:
docker/setup-qemu-action@v1
with
:
platforms
:
all
-
name
:
Build wheels
uses
:
pypa/cibuildwheel@v2.7.0
env
:
CIBW_SKIP
:
"
pp*
*musllinux*"
CIBW_ARCHS
:
${{ matrix.architecture }}
CIBW_PROJECT_REQUIRES_PYTHON
:
~=${{ matrix.python }}.0
-
name
:
Show the buildings
shell
:
bash
run
:
|
ls -al ./wheelhouse
-
name
:
Publish distribution 📦 to real PyPI
uses
:
pypa/gh-action-pypi-publish@master
with
:
password
:
${{ secrets.PYPI_PASSWORD }}
verbose
:
true
packages_dir
:
wheelhouse/
-
name
:
Upload distribution 📦 to github release
uses
:
svenstaro/upload-release-action@v2
with
:
repo_token
:
${{ secrets.GITHUB_TOKEN }}
file
:
wheelhouse/*
tag
:
${{ github.ref }}
file_glob
:
true
.github/workflows/release_test.yml
0 → 100644
浏览文件 @
911c2737
name
:
Release Test
on
:
workflow_dispatch
jobs
:
source_release
:
name
:
Try package the source
runs-on
:
${{ matrix.os }}
strategy
:
fail-fast
:
false
matrix
:
os
:
-
'
ubuntu-18.04'
python-version
:
-
'
3.8'
steps
:
-
name
:
Checkout code
uses
:
actions/checkout@v2
with
:
fetch-depth
:
20
-
name
:
Set up python ${{ matrix.python-version }}
uses
:
actions/setup-python@v2
with
:
python-version
:
${{ matrix.python-version }}
-
name
:
Set up python dependences
run
:
|
pip install --upgrade pip
pip install --upgrade flake8 setuptools wheel twine
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f requirements-build.txt ]; then pip install -r requirements-build.txt; fi
if [ -f requirements-test.txt ]; then pip install -r requirements-test.txt; fi
pip install --upgrade build
-
name
:
Build packages
run
:
|
make zip
ls -al dist
-
name
:
Upload packed files to artifacts
uses
:
actions/upload-artifact@v2
with
:
name
:
build-artifacts-source-pack
path
:
./dist/*
wheel_release
:
name
:
Try build the wheels
runs-on
:
${{ matrix.os }}
strategy
:
fail-fast
:
false
matrix
:
os
:
-
'
ubuntu-18.04'
# - 'windows-2019'
-
'
macos-10.15'
python
:
-
'
3.6'
-
'
3.7'
-
'
3.8'
-
'
3.9'
-
'
3.10'
architecture
:
-
x86_64
-
arm64
-
aarch64
-
x86
-
AMD64
exclude
:
-
os
:
ubuntu-18.04
architecture
:
arm64
-
os
:
ubuntu-18.04
architecture
:
x86
-
os
:
ubuntu-18.04
architecture
:
AMD64
-
os
:
windows-2019
architecture
:
x86_64
-
os
:
windows-2019
architecture
:
arm64
-
os
:
windows-2019
architecture
:
aarch64
-
os
:
macos-10.15
architecture
:
aarch64
-
os
:
macos-10.15
architecture
:
x86
-
os
:
macos-10.15
architecture
:
AMD64
-
python
:
'
3.6'
architecture
:
arm64
-
python
:
'
3.7'
architecture
:
arm64
steps
:
-
name
:
Checkout code
uses
:
actions/checkout@v2
with
:
fetch-depth
:
20
-
name
:
Set up QEMU
if
:
${{ runner.os == 'Linux' }}
uses
:
docker/setup-qemu-action@v1
with
:
platforms
:
all
-
name
:
Build wheels
uses
:
pypa/cibuildwheel@v2.7.0
env
:
CIBW_SKIP
:
"
pp*
*musllinux*"
CIBW_ARCHS
:
${{ matrix.architecture }}
CIBW_PROJECT_REQUIRES_PYTHON
:
~=${{ matrix.python }}.0
-
name
:
Show the buildings
shell
:
bash
run
:
|
ls -al ./wheelhouse
-
name
:
Upload packed files to artifacts
uses
:
actions/upload-artifact@v2
with
:
name
:
build-artifacts-${{ runner.os }}-cp${{ matrix.python }}-${{ matrix.architecture }}
path
:
./wheelhouse/*
.github/workflows/run.yml
浏览文件 @
911c2737
...
...
@@ -2,7 +2,7 @@ name: Code Script Run
on
:
push
:
branches
:
[
main
,
'
dev/*'
,
'
run/*'
]
branches
:
[
'
run/*'
]
jobs
:
unittest
:
...
...
.github/workflows/test.yml
浏览文件 @
911c2737
name
:
Code Test
on
:
-
push
push
:
branches
:
-
main
-
dev/*
-
fix/*
-
test/*
jobs
:
unittest
:
...
...
@@ -113,105 +118,3 @@ jobs:
flags
:
unittests
name
:
codecov-umbrella
fail_ci_if_error
:
false
benchmark
:
name
:
Benchmark Test
runs-on
:
${{ matrix.os }}
if
:
"
!contains(github.event.head_commit.message,
'ci
skip')"
strategy
:
fail-fast
:
false
matrix
:
os
:
-
'
ubuntu-18.04'
python-version
:
-
'
3.6'
-
'
3.7'
-
'
3.8'
-
'
3.9'
-
'
3.10'
steps
:
-
name
:
Checkout code
uses
:
actions/checkout@v2
with
:
fetch-depth
:
20
-
name
:
Set up system dependences on linux
if
:
${{ runner.os == 'Linux' }}
run
:
|
sudo apt-get update
sudo apt-get install -y tree cloc wget curl make graphviz
sudo apt-get install -y libxml2-dev libxslt-dev python-dev # need by pypy3
dot -V
-
name
:
Set up python ${{ matrix.python-version }}
uses
:
actions/setup-python@v2
with
:
python-version
:
${{ matrix.python-version }}
-
name
:
Install dependencies
run
:
|
python -m pip install --upgrade pip
pip install --upgrade flake8 setuptools wheel twine
pip install -r requirements.txt
pip install -r requirements-build.txt
pip install -r requirements-test.txt
pip install -r requirements-benchmark.txt
./install_test.sh
-
name
:
Test the basic environment
run
:
|
python -V
pip --version
pip list
tree .
cloc treevalue
cloc test
-
name
:
Run benckmark
env
:
CI
:
'
true'
run
:
|
make clean build benchmark compare
try_release
:
name
:
Try build the release
runs-on
:
${{ matrix.os }}
if
:
"
!contains(github.event.head_commit.message,
'ci
skip')"
strategy
:
fail-fast
:
false
matrix
:
os
:
-
'
ubuntu-18.04'
python-version
:
-
'
3.6'
-
'
3.7'
-
'
3.8'
-
'
3.9'
-
'
3.10'
steps
:
-
name
:
Checkout code
uses
:
actions/checkout@v2
with
:
fetch-depth
:
20
-
name
:
Set up python ${{ matrix.python-version }}
uses
:
actions/setup-python@v2
with
:
python-version
:
${{ matrix.python-version }}
-
name
:
Set up python dependences
run
:
|
pip install --upgrade pip
pip install --upgrade flake8 setuptools wheel twine
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f requirements-build.txt ]; then pip install -r requirements-build.txt; fi
if [ -f requirements-test.txt ]; then pip install -r requirements-test.txt; fi
pip install --upgrade build
-
name
:
Build packages
run
:
|
make package
ls -al dist
-
name
:
Get package version
run
:
|
make build
python -c 'from treevalue.config.meta import __VERSION__;print(__VERSION__)'
echo "PACKAGE_VERSION=$(python -c 'from treevalue.config.meta import __VERSION__;print(__VERSION__)')" >> $GITHUB_ENV
-
uses
:
actions/upload-artifact@v2
with
:
name
:
treevalue-v${{ env.PACKAGE_VERSION }}-${{ matrix.os }}-${{ matrix.python-version }}
path
:
dist
Makefile
浏览文件 @
911c2737
.PHONY
:
docs test unittest build clean benchmark
.PHONY
:
docs test unittest build clean benchmark
zip
PYTHON
:=
$(
shell
which python
)
...
...
@@ -24,6 +24,9 @@ build:
$(PYTHON)
setup.py build_ext
--inplace
\
$(
if
${LINETRACE}
,--define CYTHON_TRACE,
)
zip
:
$(PYTHON)
-m
build
--sdist
--outdir
${DIST_DIR}
package
:
$(PYTHON)
-m
build
--sdist
--wheel
--outdir
${DIST_DIR}
for
whl
in
`
ls
${DIST_DIR}
/
*
.whl
`
;
do
\
...
...
pyproject.toml
浏览文件 @
911c2737
[build-system]
requires
=
[
"setuptools"
,
"wheel"
,
"Cython"
]
requires
=
[
"setuptools>=42"
,
"wheel"
,
"Cython"
,
]
[tool.cibuildwheel]
skip
=
["pp*"]
# Do not build for PyPy
## macOS build configuration
[tool.cibuildwheel.macos]
archs
=
[
"x86_64"
,
"arm64"
]
# Build for x86_64 and arm64
before-test
=
[
# Unittest for linux
"pip install -r {project}/requirements-test.txt"
,
]
test-command
=
[
"cp -rf {project}/test test"
,
"cp {project}/pytest.ini pytest.ini"
,
"pytest test -sv -m unittest --log-level=DEBUG"
,
"rm -rf test"
,
]
## Linux build configuration
[tool.cibuildwheel.linux]
archs
=
[
"x86_64"
,
"aarch64"
]
# Build for x86_64 and arm64
skip
=
[
"pp* *musllinux*"
]
# dependencies do not build for musl
before-test
=
[
# Unittest for linux
"pip install -r {project}/requirements-test.txt"
,
]
test-command
=
[
"cp -rf {project}/test test"
,
"cp {project}/pytest.ini pytest.ini"
,
"pytest test -sv -m unittest --log-level=DEBUG"
,
"rm -rf test"
,
]
requirements-test.txt
浏览文件 @
911c2737
...
...
@@ -9,6 +9,7 @@ pytest-rerunfailures~=10.2
pytest-timeout~=2.0.2
pytest-benchmark~=3.4.0
testtools>=2
hbutils>=0.6.13
setuptools<=59.5.0
numpy>=1.10
torch>=1.1.0
...
...
test/entry/cli/test_graph.py
浏览文件 @
911c2737
import
os
import
pathlib
import
pickle
import
unittest
import
warnings
import
zlib
import
pytest
from
click.testing
import
CliRunner
from
hbutils.testing
import
cmdv
from
treevalue
import
FastTreeValue
,
dump
,
graphics
from
treevalue.entry.cli
import
treevalue_cli
...
...
@@ -24,6 +26,7 @@ g = graphics(
@
pytest
.
mark
.
unittest
class
TestEntryCliGraph
:
@
unittest
.
skipUnless
(
cmdv
(
'dot'
),
'Dot installed only'
)
def
test_simple_code_graph
(
self
):
runner
=
CliRunner
()
with
runner
.
isolated_filesystem
():
...
...
@@ -54,6 +57,7 @@ class TestEntryCliGraph:
assert
not
os
.
path
.
exists
(
'test_graph.gv'
)
assert
len
(
result
.
output
)
<=
2500
@
unittest
.
skipUnless
(
cmdv
(
'dot'
),
'Dot installed only'
)
def
test_simple_code_multiple_graph
(
self
):
runner
=
CliRunner
()
with
runner
.
isolated_filesystem
():
...
...
@@ -76,6 +80,7 @@ class TestEntryCliGraph:
assert
os
.
path
.
exists
(
'test_graph.svg'
)
assert
os
.
path
.
getsize
(
'test_graph.svg'
)
<=
17500
@
unittest
.
skipUnless
(
cmdv
(
'dot'
),
'Dot installed only'
)
def
test_simple_binary_graph
(
self
):
runner
=
CliRunner
()
with
runner
.
isolated_filesystem
():
...
...
@@ -134,6 +139,7 @@ class TestEntryCliGraph:
assert
os
.
path
.
exists
(
'test_graph.svg'
)
assert
os
.
path
.
getsize
(
'test_graph.svg'
)
<=
6500
@
unittest
.
skipUnless
(
cmdv
(
'dot'
),
'Dot installed only'
)
def
test_duplicates
(
self
):
runner
=
CliRunner
()
with
runner
.
isolated_filesystem
():
...
...
@@ -162,6 +168,7 @@ class TestEntryCliGraph:
shutil
.
copy
(
'test_graph.svg'
,
os
.
path
.
join
(
_p
,
'test_graph.svg'
))
assert
os
.
path
.
getsize
(
'test_graph.svg'
)
<=
11000
@
unittest
.
skipUnless
(
cmdv
(
'dot'
),
'Dot installed only'
)
def
test_graph
(
self
):
runner
=
CliRunner
()
with
runner
.
isolated_filesystem
():
...
...
@@ -203,6 +210,7 @@ class TestEntryCliGraph:
assert
result
.
exit_code
!=
0
assert
"Configuration should be KEY=VALUE, but 'bgcolor#ffffff00' found."
in
result
.
output
@
unittest
.
skipUnless
(
cmdv
(
'dot'
),
'Dot installed only'
)
def
test_file_with_invalid_permission
(
self
):
runner
=
CliRunner
()
with
runner
.
isolated_filesystem
():
...
...
HansBug
😆
@HansBug
mentioned in commit
3eca7d9d
·
7月 14, 2022
mentioned in commit
3eca7d9d
mentioned in commit 3eca7d9d0a1c9d83afeb638e24fe3451828b1f43
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录