From cc30d7119de747dad1253a35d1cc3a2cf2384b80 Mon Sep 17 00:00:00 2001 From: Pier CeccoPierangioliEugenio Date: Sun, 1 Mar 2026 11:43:51 +0000 Subject: [PATCH] chore: create cleaner env (#608) --- .github/workflows/testing.yml | 2 +- Makefile | 71 ++++------------------------ apps/ttkode/pyproject.toml | 87 +++++++++++++++++++---------------- docs/requirements.txt | 77 ------------------------------- pyproject.toml | 52 +++++++++++++++++++++ 5 files changed, 110 insertions(+), 179 deletions(-) delete mode 100644 docs/requirements.txt create mode 100644 pyproject.toml diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index efb2f719..bed79012 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -61,7 +61,7 @@ jobs: shell: bash run: | python -m pip install --upgrade pip - python -m pip install -e 'libs/pyTermTk[test]' + python -m pip install -e '.[test]' - name: Lint with flake8 run: | diff --git a/Makefile b/Makefile index e151812b..d3496838 100644 --- a/Makefile +++ b/Makefile @@ -3,79 +3,26 @@ .venv: python3 -m venv .venv . .venv/bin/activate ; \ - pip install -r docs/requirements.txt - # Add "Signal" option in the method domains - # patch -p3 -d .venv/lib/python3*/ < docs/sphynx.001.signal.patch - # Update/Regen - # # Docs - # pip install sphinx sphinx-epytext sphinx-autodocgen sphinx-rtd-theme - # # Test - # pip install flake8 pytest - # # Build - # pip install build twine - # Regen requirements; - # pip freeze > docs/requirements.txt + pip install uv .venv.ttkDesigner: python3 -m venv .venv.ttkDesigner . .venv.ttkDesigner/bin/activate ; \ - pip install pyperclip Pillow + pip install pyperclip Pillow doc: .venv . .venv/bin/activate ; \ - make -C docs/source/ clean ; \ - make -C docs/source/ html ; + uv pip install '.[docs]' ; + . .venv/bin/activate ; \ + make -C docs/source/ clean ; \ + make -C docs/source/ html ; testDoc: python3 -m http.server --directory docs/source/_build/html/ -runTtkDesigner: .venv.ttkDesigner - . .venv.ttkDesigner/bin/activate ; \ - python -m ttkDesigner - -runGittk: .venv - . .venv/bin/activate ; \ - demo/gittk.py -f - -runDemo: .venv - . .venv/bin/activate ; \ - demo/demo.py -f - -runDumbImageTool: .venv - . .venv/bin/activate ; \ - tools/dumb.image.tool.py - -build: .venv - . .venv/bin/activate ; \ - tools/prepareBuild.sh release ; \ - cd tmp ; \ - python3 -m build - -deploy: .venv - . .venv/bin/activate ; \ - python3 -m twine upload tmp/dist/* - -buildTest: .venv - . .venv/bin/activate ; \ - tools/prepareBuild.sh test ; \ - cd tmp ; \ - python3 -m build - -buildTTkDesigner: .venv - . .venv/bin/activate ; \ - tools/prepareBuild.sh ttkDesigner ; \ - cd tmp ; \ - python3 -m build - -buildDumbPaintTool: .venv - . .venv/bin/activate ; \ - tools/prepareBuild.sh dumbPaintTool ; \ - cd tmp ; \ - python3 -m build - deployTTkDesigner: .venv . .venv/bin/activate ; \ - python3 -m twine upload tmp/dist/* + python3 -m twine upload tmp/dist/* pyTermTk-Docs: git clone git@github.com:ceccopierangiolieugenio/pyTermTk-Docs.git @@ -122,7 +69,7 @@ deploySandbox: deployTest: .venv . .venv/bin/activate ; \ - python3 -m twine upload --repository testpypi tmp/dist/* --verbose + python3 -m twine upload --repository testpypi tmp/dist/* --verbose itchDumbPaintToolexporter: tools/webExporterInit.sh @@ -134,6 +81,8 @@ test: .venv # Play the test stream # tests/pytest/test_001_demo.py -p test.input.bin tools/check.import.sh + . .venv/bin/activate ; \ + uv pip install '.[test]' ; \ . .venv/bin/activate ; \ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude .venv,build,tmp,experiments ; . .venv/bin/activate ; \ diff --git a/apps/ttkode/pyproject.toml b/apps/ttkode/pyproject.toml index 31f70d58..36c47505 100644 --- a/apps/ttkode/pyproject.toml +++ b/apps/ttkode/pyproject.toml @@ -1,51 +1,58 @@ [build-system] -requires = ["setuptools>=45", "wheel"] -build-backend = "setuptools.build_meta" + requires = ["setuptools>=45", "wheel"] + build-backend = "setuptools.build_meta" [project] -name = "ttkode" -dynamic = ["version"] -readme = {file = "README.md", content-type = "text/markdown"} -authors = [ - {name = "Eugenio Parodi", email = "ceccopierangiolieugenio@googlemail.com"}, -] -description = "Terminal ToolKit Studio Code editor" -requires-python = ">=3.9" -license = {text = "MIT"} -classifiers = [ - "Programming Language :: Python :: 3", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - "Development Status :: 3 - Alpha", - "Environment :: Console", - "Intended Audience :: Developers", - "Intended Audience :: Information Technology", - "Topic :: Terminals", - "Topic :: Software Development :: User Interfaces", -] -dependencies = [ - 'pyTermTk>=0.48.1-a0', - 'pytest', - 'appdirs', - 'copykitten', - 'pygments' -] + name = "ttkode" + dynamic = ["version"] + readme = {file = "README.md", content-type = "text/markdown"} + authors = [ + {name = "Eugenio Parodi", email = "ceccopierangiolieugenio@googlemail.com"}, + ] + description = "Terminal ToolKit Studio Code editor" + requires-python = ">=3.9" + license = {text = "MIT"} + classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Development Status :: 3 - Alpha", + "Environment :: Console", + "Intended Audience :: Developers", + "Intended Audience :: Information Technology", + "Topic :: Terminals", + "Topic :: Software Development :: User Interfaces", + ] + dependencies = [ + 'pyTermTk>=0.48.1-a0', + 'pytest', + 'appdirs', + 'copykitten', + 'pygments' + ] + +[project.optional-dependencies] + test = [ + "pytest>=8.3.4", + "mypy>=1.15.0" + ] [project.urls] -Homepage = "https://github.com/ceccopierangiolieugenio/pyTermTk/tree/main/apps/ttkode" -Repository = "https://github.com/ceccopierangiolieugenio/pyTermTk.git" -Issues = "https://github.com/ceccopierangiolieugenio/pyTermTk/issues" -Changelog = "https://github.com/ceccopierangiolieugenio/pyTermTk/blob/main/apps/ttkode/CHANGELOG.md" + Homepage = "https://github.com/ceccopierangiolieugenio/pyTermTk/tree/main/apps/ttkode" + Repository = "https://github.com/ceccopierangiolieugenio/pyTermTk.git" + Issues = "https://github.com/ceccopierangiolieugenio/pyTermTk/issues" + Changelog = "https://github.com/ceccopierangiolieugenio/pyTermTk/blob/main/apps/ttkode/CHANGELOG.md" [project.scripts] -ttkode = "ttkode.__main__:main" + ttkode = "ttkode.__main__:main" [tool.setuptools] -packages = [ - "ttkode", "ttkode.app", - "ttkode.plugins", - "ttkode.plugins._010", - ] + packages = [ + "ttkode", "ttkode.app", + "ttkode.plugins", + "ttkode.plugins._010", + "ttkode.plugins._030", + ] [tool.setuptools.dynamic] -version = {attr = "ttkode.__version__"} + version = {attr = "ttkode.__version__"} diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index 84bb20ef..00000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,77 +0,0 @@ -accessible-pygments==0.0.5 -alabaster==1.0.0 -babel==2.17.0 -backports.tarfile==1.2.0 -beautifulsoup4==4.13.4 -build==1.2.2.post1 -certifi==2025.4.26 -cffi -charset-normalizer==3.4.2 -cryptography==46.0.5 -css-html-js-minify==2.5.5 -docutils==0.21.2 -flake8==7.2.0 -furo==2024.8.6 -id==1.5.0 -idna==3.10 -imagesize==1.4.1 -importlib_metadata==8.7.0 -iniconfig==2.1.0 -jaraco.classes==3.4.0 -jaraco.context==6.0.1 -jaraco.functools==4.1.0 -jeepney==0.9.0 -Jinja2==3.1.6 -keyring==25.6.0 -lxml==5.4.0 -markdown-it-py==3.0.0 -MarkupSafe==3.0.2 -mccabe==0.7.0 -mdurl==0.1.2 -more-itertools==10.7.0 -nh3==0.2.21 -packaging==25.0 -piccolo_theme==0.24.0 -pkginfo==1.12.1.2 -pluggy==1.6.0 -pycodestyle==2.13.0 -pycparser==2.22 -pydata-sphinx-theme==0.15.4 -pyflakes==3.3.2 -Pygments==2.19.1 -pyproject_hooks==1.2.0 -pytest==8.3.5 -python-slugify==8.0.4 -readme_renderer==44.0 -requests==2.32.4 -requests-toolbelt==1.0.0 -rfc3986==2.0.0 -rich==14.0.0 -roman-numerals-py==3.1.0 -SecretStorage==3.3.3 -snowballstemmer==3.0.1 -soupsieve==2.7 -Sphinx==8.2.3 -sphinx-autodocgen==1.3 -sphinx-basic-ng==1.0.0b2 -sphinx-book-theme==1.1.4 -sphinx-copybutton==0.5.2 -sphinx-epytext==0.0.4 -sphinx-material==0.0.36 -sphinx-rtd-theme==3.0.2 -sphinx_press_theme==0.9.1 -sphinx_wagtail_theme==6.5.0 -sphinxawesome-theme==5.3.2 -sphinxcontrib-applehelp==2.0.0 -sphinxcontrib-devhelp==2.0.0 -sphinxcontrib-htmlhelp==2.1.0 -sphinxcontrib-jquery==4.1 -sphinxcontrib-jsmath==1.0.1 -sphinxcontrib-qthelp==2.0.0 -sphinxcontrib-serializinghtml==2.0.0 -text-unidecode==1.3 -twine==6.1.0 -typing_extensions==4.13.2 -Unidecode==1.4.0 -urllib3==2.6.3 -zipp==3.22.0 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..f53b80c1 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,52 @@ +[build-system] + requires = ["setuptools>=45", "wheel"] + build-backend = "setuptools.build_meta" + +[project] + name = "pyTermTk-Env-Setup" + version = "0.0.0" + readme = {file = "README.md", content-type = "text/markdown"} + authors = [ + {name = "Eugenio Parodi", email = "ceccopierangiolieugenio@googlemail.com"}, + ] + description = "pyTermTk dev env" + requires-python = ">=3.9" + + dependencies = [ + 'pyTermTk', + 'TTKode', + 'Tlogg', + 'TTkDesigner', + 'dumbPaintTool', + ] + +[project.urls] + Homepage = "https://github.com/ceccopierangiolieugenio/pyTermTk" + Documentation = "https://ceccopierangiolieugenio.github.io/pyTermTk-Docs/" + Repository = "https://github.com/ceccopierangiolieugenio/pyTermTk.git" + Issues = "https://github.com/ceccopierangiolieugenio/pyTermTk/issues" + Changelog = "https://github.com/ceccopierangiolieugenio/pyTermTk/blob/main/libs/pyTermTk/CHANGELOG.md" + +[project.optional-dependencies] + test = [ + "pyTermTk[test]", + "ttkode[test]", + "pytest>=8.3.4", + "flake8>=7.2.0", + "mypy>=1.15.0" + ] + docs = [ + "Sphinx==8.2.3", + "sphinx-book-theme==1.1.4" + ] + +[tool.setuptools] + packages = [] + +[tool.uv.sources] + pyTermTk = { path = "libs/pyTermTk", editable = true } + TTKode = { path = "apps/ttkode", editable = true } + Tlogg = { path = "apps/tlogg", editable = true } + TTkDesigner = { path = "apps/ttkDesigner", editable = true } + dumbPaintTool = { path = "apps/dumbPaintTool", editable = true } +