diff --git a/.copier-answers.yml b/.copier-answers.yml new file mode 100644 index 0000000..9fc064f --- /dev/null +++ b/.copier-answers.yml @@ -0,0 +1,20 @@ +# Changes here will be overwritten by Copier +_commit: 0.4.12 +_src_path: gh:ignition-devs/copier-templates +author_email: cesar@coatl.dev +author_fullname: César Román +copyright_holder: coatl.dev +copyright_year: 2018-2026 +github_org: ignition-devs +github_repo: incendium +main_branch: main +project_description: Package that extends and wraps the Ignition Scripting API +project_development_status: 5 - Production/Stable +project_license: MIT +project_name: incendium +project_type: jython +registry_url: https://upload.pypi.org/legacy/ +registry_username: __token__ +upload_registry: true +use_sourcery: true + diff --git a/.devcontainer.json b/.devcontainer.json index 0dd8cd0..0882123 100644 --- a/.devcontainer.json +++ b/.devcontainer.json @@ -22,4 +22,4 @@ "pre-commit": "pre-commit install --hook-type pre-commit --hook-type commit-msg --hook-type pre-push", "dev-requirements": "python2 -m pip install --requirement requirements.txt" } -} +} \ No newline at end of file diff --git a/.editorconfig b/.editorconfig index 88e00e1..8a47ca0 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,16 +9,20 @@ end_of_line = lf trim_trailing_whitespace = true [Makefile] -indent_size = 4 indent_style = tab insert_final_newline = false -[*.{json,md,toml,yaml,yml}] +[*.{json}] +indent_size = 2 +indent_style = space +insert_final_newline = false + +[*.{md,toml,yaml,yml}] indent_size = 2 indent_style = space insert_final_newline = true -[*.{ini,py,pyi}] +[*.{ini,py}] indent_size = 4 indent_style = space insert_final_newline = true \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 95d81d5..b79e11d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,21 +1,58 @@ name: ci on: + workflow_dispatch: pull_request: push: branches: - main jobs: + pre-commit: + uses: coatl-dev/workflows/.github/workflows/pre-commit.yml@v6 + with: + skip-hooks: 'pylint' + pylint: + needs: pre-commit uses: coatl-dev/workflows/.github/workflows/pylint.yml@v6 - with: - path: src jython: - uses: ./.github/workflows/jython.yml if: ${{ github.event_name == 'pull_request' }} + runs-on: ubuntu-latest + env: + JYTHON_CACHE_DIR: $HOME/.cache/jython + steps: + - name: Checkout repo + uses: actions/checkout@v6 + + - name: Set up Jython + uses: coatl-dev/actions/setup-jython@v5 + id: setup-jython + with: + jython-version: '2.7.3' + + - name: Cache Jython + uses: actions/cache@v5 + with: + path: ${{ env.JYTHON_CACHE_DIR }} + key: jy-${{ steps.setup-jython.outputs.jython-version }}-${{ runner.os }}-${{ steps.setup-jython.outputs.java-distribution }}-${{ steps.setup-jython.outputs.java-version }}-${{ hashFiles('setup.py') }} - tox: - uses: ./.github/workflows/tox.yml + - name: Test installation on Jython + run: | + make install JYTHON_CACHE_DIR=${{ env.JYTHON_CACHE_DIR }} + + tox-package: + if: ${{ github.event_name == 'pull_request' }} + uses: coatl-dev/workflows/.github/workflows/tox-docker.yml@v6 + + tox-stubs: if: ${{ github.event_name == 'pull_request' }} + uses: coatl-dev/workflows/.github/workflows/tox.yml@v6 + with: + python-versions: | + 3.9 + 3.10 + 3.11 + 3.12 + working-directory: stubs diff --git a/.github/workflows/jython.yml b/.github/workflows/jython.yml deleted file mode 100644 index aecd91e..0000000 --- a/.github/workflows/jython.yml +++ /dev/null @@ -1,27 +0,0 @@ -on: - workflow_call: - -jobs: - jython: - runs-on: ubuntu-latest - env: - JYTHON_CACHE_DIR: $HOME/.cache/jython - steps: - - name: Checkout repo - uses: actions/checkout@v6 - - - name: Set up Jython - uses: coatl-dev/actions/setup-jython@v5 - id: setup-jython - with: - jython-version: '2.7.3' - - - name: Cache Jython - uses: actions/cache@v5 - with: - path: ${{ env.JYTHON_CACHE_DIR }} - key: jy-${{ steps.setup-jython.outputs.jython-version }}-${{ runner.os }}-${{ steps.setup-jython.outputs.java-distribution }}-${{ steps.setup-jython.outputs.java-version }}-${{ hashFiles('setup.py') }} - - - name: Test installation on Jython - run: | - make install JYTHON_CACHE_DIR=${{ env.JYTHON_CACHE_DIR }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3886f9a..cd9eabf 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,20 +6,36 @@ on: - published jobs: - tox: - uses: ./.github/workflows/tox.yml + tox-package: + uses: coatl-dev/workflows/.github/workflows/tox-docker.yml@v6 - publish-package: - needs: tox + tox-stubs: + uses: coatl-dev/workflows/.github/workflows/tox.yml@v6 + with: + python-versions: | + 3.9 + 3.10 + 3.11 + 3.12 + working-directory: stubs + + pypi-publish-package: + needs: [tox-package] uses: coatl-dev/workflows/.github/workflows/pypi-upload.yml@v6 + with: + python-version: '2.7' + url: 'https://upload.pypi.org/legacy/' + username: '__token__' secrets: password: ${{ secrets.PYPI_API_TOKEN_INCENDIUM_PKG }} - publish-stubs: - needs: tox + pypi-publish-stubs: + needs: [tox-stubs] uses: coatl-dev/workflows/.github/workflows/pypi-upload.yml@v6 with: python-version: '3.12' - working-directory: stubs + url: 'https://upload.pypi.org/legacy/' + username: '__token__' + working-directory: 'stubs' secrets: password: ${{ secrets.PYPI_API_TOKEN_INCENDIUM_STUBS }} diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml deleted file mode 100644 index d955c3e..0000000 --- a/.github/workflows/tox.yml +++ /dev/null @@ -1,12 +0,0 @@ -on: - workflow_call: - -jobs: - tox-package: - uses: coatl-dev/workflows/.github/workflows/tox-docker.yml@v6 - - tox-stubs: - uses: coatl-dev/workflows/.github/workflows/tox-gh.yml@v6 - with: - python-versions: '["3.9", "3.10", "3.11", "3.12"]' - working-directory: stubs diff --git a/.gitignore b/.gitignore index 500f839..61a8fa6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,143 @@ -# Editors -.idea/ -.vscode/ +# Created by https://www.toptal.com/developers/gitignore/api/linux,macos,pycharm+all,python,visualstudiocode,windows +# Edit at https://www.toptal.com/developers/gitignore?templates=linux,macos,pycharm+all,python,visualstudiocode,windows +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud + +### PyCharm+all ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### PyCharm+all Patch ### +# Ignore everything but code style settings and run configurations +# that are supposed to be shared within teams. + +.idea/* + +!.idea/codeStyles +!.idea/runConfigurations + +### Python ### # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] @@ -92,7 +228,7 @@ ipython_config.py # pyenv # For a library or package, you might want to ignore these files since the code is # intended to run in multiple environments; otherwise, check them in: -.python-version +# .python-version # pipenv # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. @@ -101,7 +237,22 @@ ipython_config.py # install all needed dependencies. #Pipfile.lock -# PEP 582; used by e.g. github.com/David-OConnor/pyflow +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm __pypackages__/ # Celery stuff @@ -144,36 +295,43 @@ dmypy.json # Cython debug symbols cython_debug/ -# macOS -# General -.DS_Store -.AppleDouble -.LSOverride +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ -# Icon must end with two \r -Icon +### Python Patch ### +# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration +poetry.toml +# ruff +.ruff_cache/ -# Thumbnails -._* +# LSP config files +pyrightconfig.json -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk +# Local History for Visual Studio Code +.history/ + +# Built Visual Studio Code Extensions +*.vsix -# Windows +### VisualStudioCode Patch ### +# Ignore all local history of files +.history +.ionide + +### Windows ### # Windows thumbnail cache files Thumbs.db Thumbs.db:encryptable @@ -197,4 +355,6 @@ $RECYCLE.BIN/ *.msp # Windows shortcuts -*.lnk \ No newline at end of file +*.lnk + +# End of https://www.toptal.com/developers/gitignore/api/linux,macos,pycharm+all,python,visualstudiocode,windows diff --git a/.mypy.ini b/.mypy.ini index c9ef72c..776dedf 100644 --- a/.mypy.ini +++ b/.mypy.ini @@ -3,4 +3,4 @@ enable_error_code = ignore-without-code mypy_path = $MYPY_CONFIG_FILE_DIR/src python_version = 2.7 strict = true -warn_return_any = true \ No newline at end of file +warn_return_any = true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8f81688..5a60a90 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,9 +1,3 @@ -ci: - autoupdate_commit_msg: 'build(deps): pre-commit autoupdate' - autofix_commit_msg: 'style: apply auto fixes with pre-commit' - skip: - - pylint - repos: - repo: https://github.com/aio-libs/sort-all rev: v1.3.0 @@ -24,18 +18,15 @@ repos: rev: 1.3.1 hooks: - id: unimport - language_version: python3.12 files: ^src/ + language_version: python3.12 - repo: https://github.com/PyCQA/isort rev: 8.0.1 hooks: - id: isort - name: isort-incendium + name: isort-package files: ^src/ args: [--settings-file=tox.ini] - - repo: https://github.com/PyCQA/isort - rev: 8.0.1 - hooks: - id: isort name: isort-stubs files: ^stubs/stubs/ @@ -44,23 +35,23 @@ repos: rev: v1.7.7 hooks: - id: docformatter - language_version: python3.12 args: [--config, tox.ini] files: ^src/ + language_version: python3.12 - repo: https://github.com/coatl-dev/flake8 rev: 5.0.4 hooks: - id: flake8 - name: flake8-incendium - language_version: python3.12 + name: flake8-package args: [--config=tox.ini] files: ^src/ additional_dependencies: [pydoclint] + language_version: python3.12 - repo: https://github.com/PyCQA/flake8 rev: 7.3.0 hooks: - id: flake8 - name: flake8-incendium-stubs + name: flake8-stubs types: [file] files: \.(pyi)$ additional_dependencies: [flake8-pyi] @@ -72,7 +63,7 @@ repos: files: ^src/ args: [--config=tox.ini] - repo: https://github.com/commitizen-tools/commitizen - rev: v4.13.10 + rev: v4.13.9 hooks: - id: commitizen - id: commitizen-branch diff --git a/.sourcery.yaml b/.sourcery.yaml index 31024a4..b038881 100644 --- a/.sourcery.yaml +++ b/.sourcery.yaml @@ -1,12 +1,12 @@ -version: "1" - ignore: - - .git - - .env - - .tox - - .venv - - env - - venv + - .git + - venv + - .venv + - env + - .env + - .tox + - node_modules + - vendor rule_settings: enable: @@ -17,7 +17,9 @@ rule_settings: - refactoring - suggestion - comment - python_version: "3.3" + python_version: '3.3' + +rules: [] metrics: quality_threshold: 25.0 @@ -33,3 +35,6 @@ clone_detection: min_lines: 3 min_duplicates: 2 identical_clones_only: false + +proxy: + no_ssl_verify: false diff --git a/LICENSE b/LICENSE index ec70bc1..eb1eb26 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020-2024 coatl.dev +Copyright (c) 2018-2026 coatl.dev Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/Makefile b/Makefile index f863b42..48879e2 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ JYTHON_CACHE_DIR := $$HOME/.cache/jython ##@ Help -.PHONY: help clean check init install cleaninstall forceinstall nocacheinstall nodepsinstall +.PHONY: help clean check init install install-clean install-force install-nocache install-nodeps help: ## Display this help message. @awk \ @@ -44,18 +44,18 @@ install: check init ## Install this package using Jython with caching enabled. @echo "Installing package…" jython -m pip install --cache-dir="$(JYTHON_CACHE_DIR)" . -cleaninstall: check init clean ## Perform clean installation using Jython with caching enabled. +install-clean: check init clean ## Perform clean installation using Jython with caching enabled. @echo "Running clean install…" jython -m pip install --cache-dir="$(JYTHON_CACHE_DIR)" . -forceinstall: check init ## Reinstall all packages using Jython even if they are already up-to-date. +install-force: check init ## Reinstall all packages using Jython even if they are already up-to-date. @echo "Reinstalling all packages…" jython -m pip install --force-reinstall --cache-dir="$(JYTHON_CACHE_DIR)" . -nocacheinstall: check ## Install this package using Jython with caching disabled. +install-nocache: check ## Install this package using Jython with caching disabled. @echo "Installing packages (no cache)…" jython -m pip install --no-cache-dir . -nodepsinstall: check ## Install this package without dependencies. +install-nodeps: check ## Install this package without dependencies. @echo "Installing package without dependencies…" jython -m pip install --no-deps . \ No newline at end of file diff --git a/README.md b/README.md index f23046d..8f9153b 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![ci](https://github.com/ignition-devs/incendium/actions/workflows/ci.yml/badge.svg)](https://github.com/ignition-devs/incendium/actions/workflows/ci.yml) [![Join us on GitHub discussions](https://img.shields.io/badge/github-discussions-informational)](https://github.com/orgs/ignition-devs/discussions) -Package that extends and wraps some functions from Ignition's Scripting API. +Package that extends and wraps the Ignition Scripting API. For more information, please refer to the [Wiki]. diff --git a/setup.py b/setup.py index 553f148..8130ae7 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,9 @@ #!/usr/bin/env jython # pylint: skip-file -"""incendium.""" +"""Package that extends and wraps the Ignition Scripting API""" from codecs import open from os import path - from setuptools import find_packages, setup HERE = path.abspath(path.dirname(__file__)) @@ -42,7 +41,7 @@ "Programming Language :: Python :: Implementation :: Jython", "Topic :: Software Development :: Libraries :: Python Modules", ], - keywords="coatl-dev, hmi, ignition, inductive automation, scada", + keywords="incendium", package_dir={"": "src"}, packages=find_packages(where="src"), python_requires=">=2.7, <3", diff --git a/src/incendium/__about__.py b/src/incendium/__about__.py index ec364c0..9907454 100644 --- a/src/incendium/__about__.py +++ b/src/incendium/__about__.py @@ -2,10 +2,10 @@ """Package information.""" __title__ = "incendium" -__description__ = "Package that extends and wraps Ignition Scripting API" +__description__ = "Package that extends and wraps the Ignition Scripting API" __url__ = "https://github.com/ignition-devs/incendium" __version__ = "2025.12.0" __author__ = "César Román" __author_email__ = "cesar@coatl.dev" __license__ = "MIT" -__copyright__ = "Copyright (c) 2018-2025 coatl.dev" +__copyright__ = "Copyright (c) 2018-2026 coatl.dev" diff --git a/src/incendium/__init__.py b/src/incendium/__init__.py index 613777c..1c0214f 100644 --- a/src/incendium/__init__.py +++ b/src/incendium/__init__.py @@ -1,8 +1,4 @@ """incendium. -incendium is a package that extends and wraps some functions from -Ignition Scripting API. - -For more information, please refer to the Wiki. -https://github.com/ignition-devs/incendium/wiki +Package that extends and wraps the Ignition Scripting API """ diff --git a/stubs/.mypy.ini b/stubs/.mypy.ini index b676651..f6952b6 100644 --- a/stubs/.mypy.ini +++ b/stubs/.mypy.ini @@ -1,2 +1,3 @@ [mypy] python_version = 2.7 +strict = true diff --git a/stubs/LICENSE b/stubs/LICENSE new file mode 100644 index 0000000..eb1eb26 --- /dev/null +++ b/stubs/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018-2026 coatl.dev + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/stubs/README.md b/stubs/README.md index 4a07fe5..1643643 100644 --- a/stubs/README.md +++ b/stubs/README.md @@ -5,13 +5,15 @@ [![PyPI - Version](https://img.shields.io/pypi/v/incendium-stubs)](https://pypi.org/project/incendium-stubs/) [![PyPI - Downloads](https://pepy.tech/badge/incendium-stubs)](https://pepy.tech/project/incendium-stubs) -This package contains a collection of [stubs] for the [`incendium`] package. -These files were generated using `mypy`'s [`stubgen`]. +Package that extends and wraps the Ignition Scripting API + +This package contains a collection of [stubs] generated using `mypy`'s +[`stubgen`] tool. ## Installation and usage -To use `incendium-stubs`, you may install it with `pip`. It requires Python 3.9 -through 3.12. +To use incendium-stubs, you may install it with `pip`. It requires Python +3.9 - 3.12. ```sh python -m pip install incendium-stubs @@ -30,34 +32,6 @@ Or mypy code.py ``` -## Contributing - -See [CONTRIBUTING.md]. - -## Discussions - -Feel free to post your questions and/or ideas at [Discussions]. - -## Contributors - -Thanks to everyone who has contributed to this project. - -Up-to-date list of [contributors]. - -## License - -See the [LICENSE]. - -## Code of conduct - -See [CODE_OF_CONDUCT.md]. - -[CODE_OF_CONDUCT.md]: https://github.com/ignition-devs/.github/blob/main/CODE_OF_CONDUCT.md -[CONTRIBUTING.md]: https://github.com/ignition-devs/incendium/blob/main/CONTRIBUTING.md -[contributors]: https://github.com/ignition-devs/incendium/graphs/contributors -[Discussions]: https://github.com/orgs/ignition-devs/discussions -[LICENSE]: https://github.com/ignition-devs/incendium/blob/main/LICENSE -[`incendium`]: https://github.com/ignition-devs/incendium/tree/main/incendium [`stubgen`]: https://coatl-mypy.readthedocs.io/en/v0.971/stubgen.html [stubs]: https://www.python.org/dev/peps/pep-484/ diff --git a/stubs/pyproject.toml b/stubs/pyproject.toml index a26e055..0b38c5f 100644 --- a/stubs/pyproject.toml +++ b/stubs/pyproject.toml @@ -6,15 +6,10 @@ requires = [ [project] name = "incendium-stubs" -version = "2025.12.0" -description = "incendium stubs package" +version = "0.0.1" +description = "Package that extends and wraps the Ignition Scripting API" readme = "README.md" -keywords = [ - "hmi", - "ignition", - "inductive automation", - "scada", -] +keywords = [ "incendium" ] license = "MIT" authors = [ { name = "César Román", email = "cesar@coatl.dev" } ] requires-python = ">=3.9,<3.13" @@ -36,15 +31,13 @@ classifiers = [ "Typing :: Typed", ] dependencies = [ - "ignition-api-stubs>=8.3", + "ignition-api-stubs", ] -urls.Funding = "https://github.com/sponsors/cesarcoatl" +urls.Homepage = "https://github.com/ignition-devs/incendium" urls.Source = "https://github.com/ignition-devs/incendium" urls.Tracker = "https://github.com/ignition-devs/incendium/issues" [tool.setuptools] include-package-data = true package-dir = { "" = "stubs" } - -[tool.setuptools.package-data] -"*" = [ "*.pyi", "py.typed" ] +package-data."*" = [ "*.pyi", "py.typed" ] diff --git a/stubs/tox.ini b/stubs/tox.ini index 59f1569..063dcc0 100644 --- a/stubs/tox.ini +++ b/stubs/tox.ini @@ -1,48 +1,24 @@ [tox] requires = - tox>=4.25 + tox>=4.2 env_list = - typecheck py3{9-12} skip_missing_interpreters = true -[testenv:typecheck] -description = run type check on code base -base_python = python3.12 -skip_install = true +[testenv:py312] +description = install and run type check on code base deps = - --requirement requirements.txt mypy[python2] @ git+https://github.com/coatl-dev/mypy.git@v0.971 commands = mypy stubs -[testenv:style] -description = apply style -skip_install = true -deps = - black - flake8 - flake8-pyi - isort -commands = - black --quiet stubs - isort stubs - flake8 stubs - [flake8] ignore = E301, E302, E701, E704, F821, - Y001, Y026, Y022, Y027, Y036, Y037, Y032, Y034, Y041 + Y022, Y026, Y034, Y036, Y037 max-line-length = 88 -[gh] -python = - 3.9 = py39 - 3.10 = py310 - 3.11 = py311 - 3.12 = py312, typecheck - [isort] extra_standard_library = typing profile = black diff --git a/tox.ini b/tox.ini index 2a8aab2..52fa3b2 100644 --- a/tox.ini +++ b/tox.ini @@ -20,15 +20,6 @@ deps = commands = mypy src -[testenv:pip-compile] -description = compile requirements -base_python = python2.7 -skip_install = true -deps = - pip-tools -commands = - pip-compile --upgrade --generate-hashes requirements.in - [testenv:stubgen] description = generate stubs base_python = python3.12 @@ -38,38 +29,6 @@ deps = commands = stubgen --export-less --output=stubs{/}stubs src -[testenv:style] -description = apply style -base_python = python3.12 -skip_install = true -deps = - black - docformatter - flake8 @ git+https://github.com/coatl-dev/flake8.git@5.0.4 - isort - pydoclint - pydocstyle - sort-all - ssort - unimport -commands = - python -c \ - "import pathlib, subprocess; \ - files = [str(p) for p in pathlib.Path('src').rglob('*.py')]; \ - subprocess.run(['sort-all'] + files, check=True)" - ssort src - black --quiet src - unimport src - isort --settings-file=tox.ini src - docformatter \ - --in-place \ - --wrap-summaries 72 \ - --close-quotes-on-newline \ - --recursive \ - src - flake8 --select=DOC --config=tox.ini src - pydocstyle --config=tox.ini src{/}system - [docformatter] in-place = true close-quotes-on-newline = true