Skip to content

Commit 3499b2d

Browse files
committed
add docs
1 parent 05d7922 commit 3499b2d

File tree

230 files changed

+6457
-0
lines changed

Some content is hidden

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

230 files changed

+6457
-0
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @Semi-ATE/Semi-ATE

.github/workflows/CICD.yml

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
name: CI-CD
2+
3+
on:
4+
push:
5+
release:
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
name: Py${{ matrix.PYTHON_VERSION }}
11+
runs-on: ubuntu-latest
12+
defaults:
13+
run:
14+
shell: bash -l {0}
15+
env:
16+
CI: 'true'
17+
OS: 'linux'
18+
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
PYTHON_VERSION: ['3.8', '3.9', '3.10']
23+
steps:
24+
- name: Checkout Pull Requests
25+
uses: actions/checkout@v3
26+
27+
- name: Install Environment Dependencies
28+
run: |
29+
sudo apt-get update --fix-missing
30+
sudo apt-get install -y libgit2-dev xvfb x11-utils libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 xdotool
31+
32+
- name: Setup miniconda
33+
uses: conda-incubator/setup-miniconda@v2
34+
with:
35+
miniconda-version: "latest"
36+
python-version: ${{ matrix.PYTHON_VERSION }}
37+
channel-priority: false # "strict"
38+
channels: "conda-forge"
39+
mamba-version: "*"
40+
show-channel-urls: true
41+
42+
- name: Setup environment
43+
run: |
44+
mamba install spyder=5.4.3
45+
cd scripts
46+
python package_tool.py --change-env cicd
47+
cd ..
48+
conda list
49+
50+
generate_artifacts:
51+
needs: test
52+
runs-on: ubuntu-latest
53+
defaults:
54+
run:
55+
shell: bash -l {0}
56+
57+
steps:
58+
- name: Checkout Pull Requests
59+
uses: actions/checkout@v3
60+
61+
- name: Install Environment Dependencies
62+
shell: bash
63+
run: |
64+
sudo apt-get update --fix-missing
65+
66+
- name: Setup miniconda
67+
uses: conda-incubator/setup-miniconda@v2
68+
with:
69+
miniconda-version: "latest"
70+
python-version: 3.9
71+
channel-priority: false # "strict"
72+
channels: "conda-forge"
73+
mamba-version: "*"
74+
show-channel-urls: true
75+
76+
- name: Compute Version
77+
id: computed_version
78+
run: |
79+
if [[ ${{ github.event.release.tag_name != '' }} != false ]]
80+
then
81+
echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
82+
else
83+
echo ::set-output name=VERSION::$(echo "0.0.0")
84+
fi
85+
86+
- name: Apply version
87+
run: |
88+
echo Version is ${{ steps.computed_version.outputs.VERSION }}
89+
cd scripts
90+
python package_tool.py --tag-version ${{ steps.computed_version.outputs.VERSION }}
91+
cd ..
92+
93+
- name: Setup environment
94+
run: |
95+
cd scripts
96+
python package_tool.py --change-env cicd
97+
pip install sphinx sphinx-rtd-theme myst-parser sphinx-markdown-tables
98+
pip install --upgrade myst-parser
99+
cd ..
100+
101+
- name: Workaround for spyder_lab_control because it is not the right version in pip
102+
run: |
103+
mkdir workaround
104+
cd workaround
105+
git clone https://github.com/Semi-ATE/Semi-ATE.git
106+
cd Semi-ATE/src/ATE_spyder/ate_spyder_lab_control
107+
pip install -e .
108+
cd ../../../..
109+
110+
- name: Run Manifest Check
111+
run: |
112+
cd src/labml_instruments
113+
echo 'Check manifest of labml_instruments'
114+
check-manifest
115+
cd ../../
116+
117+
- name: Build Sphinx
118+
run: |
119+
sphinx-build -b html docs/source/ docs/build/html
120+
121+
- name: Upload docs to Github artifact
122+
uses: actions/upload-artifact@v3
123+
with:
124+
path: docs/build/html/*
125+
name: docs-output
126+
127+
- name: Deploy preview
128+
if: github.event_name == 'pull_request'
129+
uses: rossjrw/pr-preview-action@v1
130+
with:
131+
source-dir: ./docs/build/html
132+
- uses: JamesIves/github-pages-deploy-action@v4
133+
if: github.event_name != 'pull_request'
134+
with:
135+
folder: ./docs/build/html
136+
branch: docs
137+
target-folder: .
138+
clean-exclude: pr-preview
139+
140+
- name: Generate distribution sdist files
141+
run: |
142+
cd scripts
143+
python package_tool.py --setup-cmd sdist --packages distribution
144+
cd ..
145+
mkdir output
146+
find . -iname '*.tar.gz' -exec cp '{}' output \;
147+
148+
- name: Check distribution files
149+
run: |
150+
twine check output/*
151+
152+
- name: Upload Build Artifacts
153+
uses: actions/upload-artifact@v3
154+
with:
155+
name: output
156+
path: ./output
157+
158+
publish:
159+
if: ${{ github.event.release.tag_name != '' }}
160+
needs: generate_artifacts
161+
runs-on: ubuntu-latest
162+
defaults:
163+
run:
164+
shell: bash -l {0}
165+
166+
steps:
167+
- name: Install
168+
run: |
169+
python -m pip install twine
170+
171+
- name: Get artifacts from build job
172+
uses: actions/download-artifact@v3
173+
with:
174+
name: output
175+
path: |
176+
output
177+
178+
- name: Extend Release Assets
179+
uses: alexellis/[email protected]
180+
env:
181+
GITHUB_TOKEN: ${{ github.token }}
182+
with:
183+
asset_paths: '["output/*"]'

.gitignore

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
*.py,cover
51+
.hypothesis/
52+
.pytest_cache/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
target/
76+
77+
# Jupyter Notebook
78+
.ipynb_checkpoints
79+
80+
# IPython
81+
profile_default/
82+
ipython_config.py
83+
84+
# pyenv
85+
.python-version
86+
87+
# pipenv
88+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
90+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
91+
# install all needed dependencies.
92+
#Pipfile.lock
93+
94+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
95+
__pypackages__/
96+
97+
# Celery stuff
98+
celerybeat-schedule
99+
celerybeat.pid
100+
101+
# SageMath parsed files
102+
*.sage.py
103+
104+
# Environments
105+
.env
106+
.venv
107+
env/
108+
venv/
109+
ENV/
110+
env.bak/
111+
venv.bak/
112+
113+
# Spyder project settings
114+
.spyderproject
115+
.spyproject
116+
117+
# Rope project settings
118+
.ropeproject
119+
120+
# mkdocs documentation
121+
/site
122+
123+
# mypy
124+
.mypy_cache/
125+
.dmypy.json
126+
dmypy.json
127+
128+
# Pyre type checker
129+
.pyre/
130+
131+
.DS_Store
132+
*~
133+
134+
135+
136+

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.http://sphinx-doc.org/
25+
exit /b 1
26+
)
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

0 commit comments

Comments
 (0)