From ba3c876f61defa255d6fbb08409ef3bd80319a0f Mon Sep 17 00:00:00 2001 From: svtter Date: Fri, 15 Nov 2024 17:51:48 +0800 Subject: [PATCH 1/5] Chore, try pdm build. --- .github/workflows/python-app.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index dcd662b..4bf53e3 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -26,8 +26,8 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest . - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + pip install flake8 pytest . pdm + pdm install - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names @@ -36,4 +36,7 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | - pytest + pdm run pytest + + - name: Try build + run: pdm build From b61263b8dddb45dfbf91bbbd03bb351f8c265cc3 Mon Sep 17 00:00:00 2001 From: svtter Date: Fri, 15 Nov 2024 17:54:01 +0800 Subject: [PATCH 2/5] ignore .venv file. Chore. --- .github/workflows/python-app.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 4bf53e3..e56b073 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -31,12 +31,11 @@ jobs: - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude .git,__pycache__,.venv # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude .git,__pycache__,.venv - name: Test with pytest run: | pdm run pytest - - - name: Try build + - name: Package build run: pdm build From 81ef737dcba9abfb1d89956ed2c5cc2d66cf2405 Mon Sep 17 00:00:00 2001 From: svtter Date: Fri, 15 Nov 2024 17:57:32 +0800 Subject: [PATCH 3/5] fix build error. --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 647b79d..b3eeb31 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,6 +13,7 @@ license = {text = "MIT"} [tool.pdm] distribution = true +version = { source = "file", path = "src/easybuilder/__init__.py" } [build-system] requires = ["pdm-backend"] From b201ac97b40bdd12780f487b2a4c5411af650252 Mon Sep 17 00:00:00 2001 From: svtter Date: Fri, 15 Nov 2024 17:58:21 +0800 Subject: [PATCH 4/5] update publish process. --- .github/workflows/python-publish.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index b7a704b..89b5d8a 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -28,10 +28,9 @@ jobs: python-version: '3.x' - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install build + python -m pip install --upgrade pip pdm - name: Build package - run: python -m build + run: pdm build - name: Publish package uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 with: From e9cc82102d281ec0fbf4a8585ca57553ee0f9359 Mon Sep 17 00:00:00 2001 From: svtter Date: Fri, 15 Nov 2024 17:59:16 +0800 Subject: [PATCH 5/5] docs, add sphinx --- docs/Makefile | 20 ++++++++++++++++++++ docs/conf.py | 27 +++++++++++++++++++++++++++ docs/index.rst | 17 +++++++++++++++++ docs/make.bat | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 99 insertions(+) create mode 100644 docs/Makefile create mode 100644 docs/conf.py create mode 100644 docs/index.rst create mode 100644 docs/make.bat diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..d4bb2cb --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..0fecf0e --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,27 @@ +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +project = 'easybuilder' +copyright = '2024, svtter' +author = 'svtter' + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [] + +templates_path = ['_templates'] +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] + + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = 'alabaster' +html_static_path = ['_static'] diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..105694a --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,17 @@ +.. easybuilder documentation master file, created by + sphinx-quickstart on Fri Nov 15 17:55:01 2024. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +easybuilder documentation +========================= + +Add your content using ``reStructuredText`` syntax. See the +`reStructuredText `_ +documentation for details. + + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..954237b --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd