diff --git a/.flake8 b/.flake8 index cbf6ff2..c02c50b 100644 --- a/.flake8 +++ b/.flake8 @@ -1,8 +1,7 @@ [flake8] -exclude = citools/ max-line-length = 160 per-file-ignores = # conf.py files use star imports to setup config variables examples/*/conf*.py: F405 docs/conf*.py: F405 - test/*/conf*py: F405 \ No newline at end of file + test/*/conf*py: F405 diff --git a/.github/workflows/check-pre-commit.yml b/.github/workflows/check-pre-commit.yml new file mode 100644 index 0000000..6111ee5 --- /dev/null +++ b/.github/workflows/check-pre-commit.yml @@ -0,0 +1,14 @@ +name: pre-commit check + +on: + pull_request: + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/setup-python@v4 + - uses: pre-commit/action@v3.0.0 \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..efea463 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,41 @@ +name: Release New Version + +# on: +# push: +# tags: +# - 'v*' + +on: + pull_request: + +env: + RELEASE_VERSION: '' + RELEASE_NOTES_BODY_FILE: 'body.md' + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.7' + - name: Publish packages + env: + FLIT_USERNAME: __token__ + FLIT_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: + echo "{env.RELEASE_VERSION}={$(git describe --tags --abbrev=0)}" >> "$GITHUB_ENV" + # pip install flit + # flit publish + - name: Create Release Notes + run: + echo "Changelog for release ${RELEASE_VERSION}:" + cz changelog --file-name ${RELEASE_NOTES_BODY_FILE} ${RELEASE_VERSION} + cat ${RELEASE_NOTES_BODY_FILE} + - name: Create Github Release + uses: softprops/action-gh-release@v1 + with: + body_path: ${{ env.RELEASE_NOTES_BODY_FILE }} + tag_name: ${{ env.RELEASE_VERSION }} diff --git a/.github/workflows/test-esp-docs.yml b/.github/workflows/test-esp-docs.yml new file mode 100644 index 0000000..9f5db2a --- /dev/null +++ b/.github/workflows/test-esp-docs.yml @@ -0,0 +1,128 @@ +# name: Test Esp-Docs + +# on: +# pull_request: +# push: +# branches: +# - main + +# defaults: +# run: +# shell: bash + +# jobs: +# build-python-packages: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-python@v4 +# with: +# python-version: '3.7' +# - run: | +# pip install -U pip +# pip install flit +# flit build +# - name: Upload built python packages +# uses: actions/upload-artifact@v3 +# with: +# name: wheel +# path: dist/esp_docs-*-py3-none-any.whl + + # test-esp-docs-ut: + # runs-on: ubuntu-latest + # needs: build-python-packages + # steps: + # - uses: actions/checkout@v3 + # - uses: actions/setup-python@v4 + # with: + # python-version: '3.7' + # - name: Download wheel + # uses: actions/download-artifact@v3 + # with: + # name: wheel + # - run: | + # pip install -U pip + # pip install esp_docs-*-py3-none-any.whl + # cd test/unit_tests + # python test_docs.py + # python test_esp_extensions.py + # python test_deploy.py + + # test-esp-docs-build: + # runs-on: ubuntu-latest + # needs: build-python-packages + # steps: + # - uses: actions/checkout@v3 + # - uses: actions/setup-python@v4 + # with: + # python-version: '3.7' + # - name: Download wheel + # uses: actions/download-artifact@v3 + # with: + # name: wheel + # - run: | + # pip install -U pip + # pip install esp_docs-*-py3-none-any.whl + # sudo apt update && sudo apt install -y doxygen latexmk texlive-latex-recommended texlive-fonts-recommended texlive-xetex fonts-freefont-otf + # cd test/build_tests + # ./build_all.sh + + # build-esp-docs-examples-basic: + # runs-on: ubuntu-latest + # needs: build-python-packages + # steps: + # - uses: actions/checkout@v3 + # - uses: actions/setup-python@v4 + # with: + # python-version: '3.7' + # - name: Download wheel + # uses: actions/download-artifact@v3 + # with: + # name: wheel + # - run: | + # pip install -U pip + # pip install esp_docs-*-py3-none-any.whl + # cd examples/basic + # ./build_example.sh + + # build-esp-docs-examples-doxygen: + # runs-on: ubuntu-latest + # needs: build-python-packages + # steps: + # - uses: actions/checkout@v3 + # - uses: actions/setup-python@v4 + # with: + # python-version: '3.7' + # - name: Download wheel + # uses: actions/download-artifact@v3 + # with: + # name: wheel + # - run: | + # pip install -U pip + # pip install esp_docs-*-py3-none-any.whl + # sudo apt update && sudo apt install -y doxygen + # cd examples/doxygen + # ./build_example.sh + + # build-esp-idf-docs: + # runs-on: ubuntu-latest + # needs: build-python-packages + # container: espressif/idf:v5.1 + # steps: + # - uses: actions/checkout@v3 + # - uses: actions/setup-python@v4 + # with: + # python-version: '3.7' + # - name: Download wheel + # uses: actions/download-artifact@v3 + # with: + # name: wheel + # - name: Build docs for esp-idf + # shell: bash + # run: | + # ${IDF_PATH}/install.sh + # . ${IDF_PATH}/export.sh + # apt update && apt install -y libffi-dev libcairo2-dev doxygen + # pip install esp_docs-*-py3-none-any.whl + # cd ${IDF_PATH}/docs + # build-docs -t esp32 -l en \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..adcd033 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,12 @@ +repos: + - repo: https://github.com/pycqa/flake8 + rev: 6.1.0 + hooks: + - id: flake8 + args: ['--config=.flake8'] + - repo: https://github.com/commitizen-tools/commitizen + rev: 3.6.0 + hooks: + - id: commitizen + - id: commitizen-branch + stages: [push] \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..19c1ed5 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,5 @@ +## v1.6.0 (2023-08-07) + +### Feat + +- **CI**: move to github diff --git a/pyproject.toml b/pyproject.toml index 374b58c..482e693 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,51 @@ [build-system] -requires = [ - "setuptools>=42", - "wheel" +requires = ["flit_core >=3.2,<4"] +build-backend = "flit_core.buildapi" + +[project] +name = "esp_docs" +authors = [{name = "Espressif", email = "marius.vikhammer@espressif.com"}] +readme = "README.md" +license = {file = "LICENSE"} +classifiers = ["License :: OSI Approved :: MIT License"] + +dynamic = ["version", "description"] +requires-python = ">=3.7" + +dependencies = [ + "docutils<0.18", + "pillow<10.0.0", + "cairosvg==2.5.1", # required by sphinxcontrib-svg2pdfconverter[CairoSVG] + "sphinx==4.5.0", + "breathe==4.33.1", + "sphinx-copybutton==0.5.0", + "sphinx-notfound-page", + "sphinxcontrib-blockdiag==3.0.0", + "sphinxcontrib-seqdiag==3.0.0", + "sphinxcontrib-actdiag==3.0.0", + "sphinxcontrib-nwdiag==2.0.0", + "sphinxcontrib-wavedrom>=3.0,<3.1", + "sphinxcontrib-svg2pdfconverter[CairoSVG]==1.2.0", + "nwdiag==2.0.0", + "recommonmark", + "sphinx_selective_exclude==1.0.3", + "sphinx_idf_theme==1.1.0", ] -build-backend = "setuptools.build_meta" + +[project.urls] +Home = "https://github.com/espressif/esp-docs" + +[project.scripts] +build-docs = "esp_docs.build_docs:main" +deploy-docs = "esp_docs.deploy_docs:main" + + +[tool.commitizen] +name = "cz_conventional_commits" +tag_format = "v$version" +version = "1.6.0" +changelog_start_rev = "v1.5.0" +version_files = [ + "src/esp_docs/__version__.py", +] +update_changelog_on_bump = true diff --git a/src/esp_docs/__init__.py b/src/esp_docs/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/esp_docs/__version__.py b/src/esp_docs/__version__.py new file mode 100644 index 0000000..afc41e6 --- /dev/null +++ b/src/esp_docs/__version__.py @@ -0,0 +1,3 @@ +"""Documentation building package used at Espressif""" + +__version__ = "1.6.0"