Skip to content

Commit

Permalink
[Enhancement] Update ci and docs (#16)
Browse files Browse the repository at this point in the history
* fix link issue

* fix link issue

* [Docs] update intro and fix issues

* [Docs] fix translation

* [Docs] update introduction

* remove duplicated model_zoo.yml

* update intro and fix codecov icon

* update README

* update CI and README

* add human3d link

* update mmhuman3d link
  • Loading branch information
linyq17 authored Dec 5, 2021
1 parent fd33c3c commit 0b0f8b3
Show file tree
Hide file tree
Showing 9 changed files with 90 additions and 40 deletions.
38 changes: 18 additions & 20 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
name: build

on: [push, pull_request]
on:
push:
paths-ignore:
- 'README.md'
- 'README_zh-CN.md'
- 'docs/**'
- 'docs_zh-CN/**'
- 'examples/**'
- '.dev_scripts/**'

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install pre-commit hook
run: |
pip install pre-commit
pre-commit install
- name: Linting
run: pre-commit run --all-files
- name: Check docstring coverage
run: |
pip install interrogate
interrogate -v --ignore-init-method --ignore-module --ignore-nested-functions --ignore-regex "__repr__" --fail-under 80 mmfewshot
pull_request:
paths-ignore:
- 'README.md'
- 'README_zh-CN.md'
- 'docs/**'
- 'docs_zh-CN/**'
- 'examples/**'
- '.dev_scripts/**'

jobs:
build_cpu:
runs-on: ubuntu-latest
strategy:
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: lint

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install pre-commit hook
run: |
# markdownlint requires ruby >= 2.7
sudo apt-add-repository ppa:brightbox/ruby-ng -y
sudo apt-get update
sudo apt-get install -y ruby2.7
pip install pre-commit
pre-commit install
- name: Linting
run: pre-commit run --all-files
- name: Check docstring coverage
run: |
pip install interrogate
interrogate -v --ignore-init-method --ignore-module --ignore-nested-functions --ignore-regex "__repr__" --fail-under 80 mmfewshot
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ repos:
args: ["--remove"]
- id: mixed-line-ending
args: ["--fix=lf"]
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 2.1.4
- repo: https://github.com/markdownlint/markdownlint
rev: v0.11.0
hooks:
- id: markdownlint
args: ["-r", "~MD002,~MD013,~MD024,~MD029,~MD033,~MD034,~MD036", "-t", "allow_different_nesting"]
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ This project is released under the [Apache 2.0 license](LICENSE).
Supported algorithms:

<details open>
<summary>classification</summary>
<summary>Classification</summary>

- [x] [Baseline](configs/classification/baseline/README.md) (ICLR'2019)
- [x] [Baseline++](configs/classification/baseline_plus/README.md) (ICLR'2019)
Expand Down Expand Up @@ -146,3 +146,4 @@ mmfewshot is an open source project that is contributed by researchers and engin
- [MMGeneration](https://github.com/open-mmlab/mmgeneration): OpenMMLab image and video generative models toolbox.
- [MMFlow](https://github.com/open-mmlab/mmflow): OpenMMLab optical flow toolbox and benchmark.
- [MMFewShot](https://github.com/open-mmlab/mmfewshot): OpenMMLab FewShot Learning Toolbox and Benchmark.
- [MMHuman3D](https://github.com/open-mmlab/mmhuman3d): OpenMMLab 3D Human Parametric Model Toolbox and Benchmark.
2 changes: 2 additions & 0 deletions README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
## Introduction

[English](README.md) | 简体中文

[![Documentation](https://readthedocs.org/projects/mmfewshot/badge/?version=latest)](https://mmfewshot.readthedocs.io/en/latest/?badge=latest)
[![actions](https://github.com/open-mmlab/mmfewshot/workflows/build/badge.svg)](https://github.com/open-mmlab/mmfewshot/actions)
[![codecov](https://codecov.io/gh/open-mmlab/mmfewshot/branch/main/graph/badge.svg)](https://codecov.io/gh/open-mmlab/mmfewshot)
Expand Down Expand Up @@ -145,6 +146,7 @@ MMFewShot 是一款由不同学校和公司共同贡献的开源项目。我们
- [MMGeneration](https://github.com/open-mmlab/mmgeneration): OpenMMLab 新一代生成模型工具箱
- [MMFlow](https://github.com/open-mmlab/mmflow): OpenMMLab 光流估计工具箱与测试基准
- [MMFewShot](https://github.com/open-mmlab/mmfewshot): OpenMMLab 少样本学习工具箱与测试基准
- [MMHuman3D](https://github.com/open-mmlab/mmhuman3d): OpenMMLab 人体参数化模型工具箱与测试基准

## 欢迎加入 OpenMMLab 社区

Expand Down
4 changes: 4 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ def get_version():
'name': 'MMFewShot',
'url': 'https://mmfewshot.readthedocs.io/en/latest/',
},
{
'name': 'MMHuman3D',
'url': 'https://github.com/open-mmlab/mmhuman3d',
},
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
- PyTorch 1.5+
- CUDA 9.2+
- GCC 5+
- [mmcv](https://mmcv.readthedocs.io/en/latest/#installation) 1.3.12+
- [mmdet](https://mmdetection.readthedocs.io/en/latest/#installation) 2.16.0+
- [mmcls](https://mmclassification.readthedocs.io/en/latest/#installation) 0.15.0+
- [mmcv](https://mmcv.readthedocs.io/en/latest/get_started/installation.html) 1.3.12+
- [mmdet](https://mmdetection.readthedocs.io/en/latest/get_started.html#installation) 2.16.0+
- [mmcls](https://mmclassification.readthedocs.io/en/latest/install.html) 0.15.0+


Compatible MMCV, MMClassification and MMDetection versions are shown as below. Please install the correct version of them to avoid installation issues.
Expand Down
30 changes: 18 additions & 12 deletions docs_zh-CN/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,64 +87,70 @@ def get_version():
},
{
'name':
'Docs',
'文档',
'children': [
{
'name': 'MMCV',
'url': 'https://mmcv.readthedocs.io/en/latest/',
'url': 'https://mmcv.readthedocs.io/zh_CN/latest/',
},
{
'name': 'MIM',
'url': 'https://openmim.readthedocs.io/en/latest/'
},
{
'name': 'MMAction2',
'url': 'https://mmaction2.readthedocs.io/en/latest/',
'url': 'https://mmaction2.readthedocs.io/zh_CN/latest/',
},
{
'name': 'MMClassification',
'url':
'https://mmclassification.readthedocs.io/en/latest/',
'https://mmclassification.readthedocs.io/zh_CN/latest/',
},
{
'name': 'MMDetection',
'url': 'https://mmdetection.readthedocs.io/en/latest/',
'url': 'https://mmdetection.readthedocs.io/zh_CN/latest/',
},
{
'name': 'MMDetection3D',
'url': 'https://mmdetection3d.readthedocs.io/en/latest/',
'url':
'https://mmdetection3d.readthedocs.io/zh_CN/latest/',
},
{
'name': 'MMEditing',
'url': 'https://mmediting.readthedocs.io/en/latest/',
'url': 'https://mmediting.readthedocs.io/zh_CN/latest/',
},
{
'name': 'MMGeneration',
'url': 'https://mmgeneration.readthedocs.io/en/latest/',
},
{
'name': 'MMOCR',
'url': 'https://mmocr.readthedocs.io/en/latest/',
'url': 'https://mmocr.readthedocs.io/zh_CN/latest/',
},
{
'name': 'MMPose',
'url': 'https://mmpose.readthedocs.io/en/latest/',
'url': 'https://mmpose.readthedocs.io/zh_CN/latest/',
},
{
'name': 'MMSegmentation',
'url': 'https://mmsegmentation.readthedocs.io/en/latest/',
'url':
'https://mmsegmentation.readthedocs.io/zh_CN/latest/',
},
{
'name': 'MMTracking',
'url': 'https://mmtracking.readthedocs.io/en/latest/',
'url': 'https://mmtracking.readthedocs.io/zh_CN/latest/',
},
{
'name': 'MMFlow',
'url': 'https://mmflow.readthedocs.io/en/latest/',
},
{
'name': 'MMFewShot',
'url': 'https://mmfewshot.readthedocs.io/en/latest/',
'url': 'https://mmfewshot.readthedocs.io/zh_CN/latest/',
},
{
'name': 'MMHuman3D',
'url': 'https://github.com/open-mmlab/mmhuman3d',
},
]
},
Expand Down
16 changes: 14 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,20 @@ def add_mim_extension():

if mode == 'symlink':
src_relpath = osp.relpath(src_path, osp.dirname(tar_path))
os.symlink(src_relpath, tar_path)
elif mode == 'copy':
try:
os.symlink(src_relpath, tar_path)
except OSError:
# Creating a symbolic link on windows may raise an
# `OSError: [WinError 1314]` due to privilege. If
# the error happens, the src file will be copied
mode = 'copy'
warnings.warn(
f'Failed to create a symbolic link for {src_relpath}, '
f'and it will be copied to {tar_path}')
else:
continue

if mode == 'copy':
if osp.isfile(src_path):
shutil.copyfile(src_path, tar_path)
elif osp.isdir(src_path):
Expand Down

0 comments on commit 0b0f8b3

Please sign in to comment.