From 33fb05708ded6c2e14d4346df5e20f04436fce63 Mon Sep 17 00:00:00 2001 From: Nils Uhrberg Date: Thu, 30 Jan 2025 17:20:50 +0100 Subject: [PATCH] chore: Add Makefile with test commands --- .github/ISSUE_TEMPLATE/BUG-REPORT.yml | 2 +- .github/ISSUE_TEMPLATE/FEATURE-REQUEST.yml | 4 +- .github/pull_request_template.md | 1 - .github/workflows/pre-release.yaml | 3 +- .github/workflows/pytest.yaml | 13 +-- .github/workflows/release.yaml | 4 +- Makefile | 8 ++ README.md | 2 +- config/.python-semantic-release.json | 2 +- .../.components/changelog_init.md.j2 | 2 +- .../.components/macros.md.j2 | 3 +- pyproject.toml | 81 ++++++++++++++++++- src/{lightml => canaryml}/__init__.py | 0 src/canaryml/dummyfunctions.py | 2 + src/canaryml/py.tpyed | 0 src/lightml/dummyfunctions.py | 25 ------ tests/test_file.py | 2 +- tox.ini | 2 +- uv.lock | 42 +++++----- 19 files changed, 126 insertions(+), 72 deletions(-) create mode 100644 Makefile rename src/{lightml => canaryml}/__init__.py (100%) create mode 100644 src/canaryml/dummyfunctions.py create mode 100644 src/canaryml/py.tpyed delete mode 100644 src/lightml/dummyfunctions.py diff --git a/.github/ISSUE_TEMPLATE/BUG-REPORT.yml b/.github/ISSUE_TEMPLATE/BUG-REPORT.yml index f3ba83a..d14ce5f 100644 --- a/.github/ISSUE_TEMPLATE/BUG-REPORT.yml +++ b/.github/ISSUE_TEMPLATE/BUG-REPORT.yml @@ -1,5 +1,5 @@ name: Bug Report -description: Have you discovered an error during the development or use of lightML? Please let us know in the form of a bug report. +description: Have you discovered an error during the development or use of canaryml? Please let us know in the form of a bug report. title: "[Bug]: " labels: [ "๐Ÿชฒ bug", "๐Ÿ“‹ needs review" ] assignees: diff --git a/.github/ISSUE_TEMPLATE/FEATURE-REQUEST.yml b/.github/ISSUE_TEMPLATE/FEATURE-REQUEST.yml index 4610844..0308643 100644 --- a/.github/ISSUE_TEMPLATE/FEATURE-REQUEST.yml +++ b/.github/ISSUE_TEMPLATE/FEATURE-REQUEST.yml @@ -1,5 +1,5 @@ name: Feature Request -description: If you miss a functionality in lightML or would like to contribute to the development of lightML, you are welcome to submit a feature request. +description: If you miss a functionality in canaryml or would like to contribute to the development of canaryml, you are welcome to submit a feature request. title: "[Feature]: " labels: [ "โœจ feature", "๐Ÿ“‹ needs review" ] assignees: @@ -36,7 +36,7 @@ body: attributes: label: ๐Ÿ” Additional Information description: Include any relevant information that could help the developers better understand your request and find a solution. - placeholder: ๐Ÿ“ท Screenshots, if possible. ๐Ÿ“‹ Error logs or error messages. ๐Ÿ•น๏ธ Version of the affected product being used. + placeholder: ๐Ÿ“ท Screenshots, if possible. ๐Ÿ•น๏ธ Version of the affected product being used. - type: checkboxes id: terms attributes: diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 9a86f53..418dcec 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -16,7 +16,6 @@ Please make sure you've completed the following tasks before submitting this pul - [ ] All tests ran successfully - [ ] All merge conflicts are resolved - [ ] Documentation has been updated to reflect the changes -- [ ] Any necessary migrations have been run ## ๐Ÿ“Œ Related Issues diff --git a/.github/workflows/pre-release.yaml b/.github/workflows/pre-release.yaml index 625ff79..315376b 100644 --- a/.github/workflows/pre-release.yaml +++ b/.github/workflows/pre-release.yaml @@ -16,7 +16,7 @@ jobs: id-token: write environment: name: pypi - url: https://pypi.org/p/ligthml + url: https://pypi.org/p/canaryml steps: - name: โฌ‡๏ธ Checkout repository uses: actions/checkout@v4 @@ -57,6 +57,7 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} force: "prerelease" + root_options: "-c config/.python-semantic-release.json" - name: ๐Ÿ Publish package distributions to PyPI if: steps.release.outputs.released == 'true' diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index 56ae19b..c79522e 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -29,7 +29,7 @@ jobs: enable-cache: true python-version: ${{matrix.python-version}} cache-dependency-glob: "**/pyproject.toml" - - name: ๐ŸชŸ Add .local/bin to Windows PATH + - name: ๐ŸชŸ Prepare/Setup windows environment if: runner.os == 'Windows' shell: bash run: echo "$USERPROFILE/.local/bin" >> $GITHUB_PATH @@ -50,22 +50,11 @@ jobs: if: always() uses: pmeier/pytest-results-action@main with: - # A list of JUnit XML files, directories containing the former, and wildcard - # patterns to process. - # See @actions/glob for supported patterns. path: ./junit.xml - - # (Optional) Add a summary of the results at the top of the report summary: true - - # (Optional) Select which results should be included in the report. # Follows the same syntax as `pytest -r` display-options: fEX - - # (Optional) Fail the workflow if no JUnit XML was found. fail-on-empty: true - - # (Optional) Title of the test results section in the workflow summary title: Test results - name: โœ๏ธ Write test result as comment uses: MishaKav/pytest-coverage-comment@v1 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index fe2553f..bdba27c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -16,7 +16,7 @@ jobs: id-token: write environment: name: pypi - url: https://pypi.org/p/ligthml + url: https://pypi.org/p/canaryml steps: - name: โฌ‡๏ธ Checkout repository uses: actions/checkout@v4 @@ -56,6 +56,8 @@ jobs: uses: python-semantic-release/python-semantic-release@v9 with: github_token: ${{ secrets.GITHUB_TOKEN }} + root_options: "-c config/.python-semantic-release.json" + - name: ๐Ÿ Publish package distributions to PyPI if: steps.release.outputs.released == 'true' diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ae5f396 --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +include .env + +install_tox: + uv tool install --python-preference only-managed --python 3.14 tox --with tox-uv --with tox-gh + uv python install --python-preference only-managed 3.13 3.12 3.11 3.10 + +run_test: + uvx tox -r -p \ No newline at end of file diff --git a/README.md b/README.md index 82c46f0..acb35df 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![๐Ÿงช pytest](https://github.com/codecentric-oss/lightml/actions/workflows/pytest.yaml/badge.svg)](https://github.com/codecentric-oss/lightml/actions/workflows/pytest.yaml) \ No newline at end of file +[![๐Ÿงช pytest](https://github.com/codecentric-oss/canaryml/actions/workflows/pytest.yaml/badge.svg)](https://github.com/codecentric-oss/canaryml/actions/workflows/pytest.yaml) \ No newline at end of file diff --git a/config/.python-semantic-release.json b/config/.python-semantic-release.json index 32df822..4826aed 100644 --- a/config/.python-semantic-release.json +++ b/config/.python-semantic-release.json @@ -97,7 +97,7 @@ "pyproject.toml:project.version" ], "version_variables": [ - "src/lightml/__init__.py:__version__" + "src/canaryml/__init__.py:__version__" ] } } diff --git a/config/semantic-release-templates/.components/changelog_init.md.j2 b/config/semantic-release-templates/.components/changelog_init.md.j2 index fd65ebb..a86433c 100644 --- a/config/semantic-release-templates/.components/changelog_init.md.j2 +++ b/config/semantic-release-templates/.components/changelog_init.md.j2 @@ -14,7 +14,7 @@ it follows the following logic: #}{% include "unreleased_changes.md.j2" -%}{# # # Since this is initialization, we are generating all the previous - # # release notes per version. The very first release notes is specialized. + # # release notes per version. The very first release note is specialized. # # We also have non-conformative commits, so insert manual write-ups. #}{% if releases | length > 0 %}{% for release in releases diff --git a/config/semantic-release-templates/.components/macros.md.j2 b/config/semantic-release-templates/.components/macros.md.j2 index 22edb78..7f947dc 100644 --- a/config/semantic-release-templates/.components/macros.md.j2 +++ b/config/semantic-release-templates/.components/macros.md.j2 @@ -62,8 +62,7 @@ {# #}{% if commit.linked_merge_request != "" %}{% set pr_num = commit.linked_merge_request -%}{# # TODO: breaking change v10, remove summary line replacers as PSR will do it for us -#}{% set summary_line = summary_line | replace("(pull request ", "(") | replace("(" ~ pr_num ~ ")", "") | trim +%}{% set summary_line = summary_line | replace("(pull request ", "(") | replace("(" ~ pr_num ~ ")", "") | trim %}{# # # Add PR references with a link to the PR #}{% set _ = link_references.append( diff --git a/pyproject.toml b/pyproject.toml index b17fdd5..3cef38b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,11 +1,47 @@ [project] -name = "lightml" +name = "canaryml" version = "0.1.0" description = "Add your description here" +authors = [ + "Denis Stalz-John ", + "Nils Uhrberg ", + "Anke Koke " +] readme = "README.md" requires-python = ">=3.10" +keywords = ["tensorflow", "keras", "scikit-learn", "torch", "MLOps", "Deep Learning", "Machine Learning", "Computer Vision"] +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "Natural Language :: English", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", + "Operating System :: MacOS", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX :: Linux", + "Topic :: Software Development", + "Topic :: Software Development :: Libraries", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Scientific/Engineering :: Artificial Intelligence", + "Typing :: Typed" +] + +[project.urls] +Repository = "https://github.com/codecentric-oss/canaryml.git" +Issues = "https://github.com/codecentric-oss/canaryml/issues" +Changelog = "https://github.com/codecentric-oss/canaryml/blob/main/CHANGELOG.md" + + dependencies = [] + [dependency-groups] dev = [ "pre-commit>=4.0.1", @@ -13,6 +49,49 @@ dev = [ "python-semantic-release>=9.15.2", ] +line-length = 100 +indent-width = 4 + +[tool.ruff] +fixable = ["E", "F", "D", "PT", "PL"] +exclude = ["./tests/**"] + + +[tool.ruff.lint] +select = ["E", "F", "D100", "D101", "D102", "D103", "D105", "D106", "D107", "PT", "PL"] +fixable = ["ALL"] + +# Allow unused variables when underscore-prefixed. +dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" + +[tool.ruff.format] +# Like Black, use double quotes for strings. +quote-style = "double" + +# Like Black, indent with spaces, rather than tabs. +indent-style = "space" + +# Like Black, respect magic trailing commas. +skip-magic-trailing-comma = false + +# Like Black, automatically detect the appropriate line ending. +line-ending = "auto" + +# Enable auto-formatting of code examples in docstrings. Markdown, +# reStructuredText code/literal blocks and doctests are all supported. +# +# This is currently disabled by default, but it is planned for this +# to be opt-out in the future. +docstring-code-format = true + +# Set the line length limit used when formatting code snippets in +# docstrings. +# +# This only has an effect when the `docstring-code-format` setting is +# enabled. +docstring-code-line-length = "dynamic" + + [build-system] requires = ["hatchling"] diff --git a/src/lightml/__init__.py b/src/canaryml/__init__.py similarity index 100% rename from src/lightml/__init__.py rename to src/canaryml/__init__.py diff --git a/src/canaryml/dummyfunctions.py b/src/canaryml/dummyfunctions.py new file mode 100644 index 0000000..44a482e --- /dev/null +++ b/src/canaryml/dummyfunctions.py @@ -0,0 +1,2 @@ +def dummyfunction(): + return 1 diff --git a/src/canaryml/py.tpyed b/src/canaryml/py.tpyed new file mode 100644 index 0000000..e69de29 diff --git a/src/lightml/dummyfunctions.py b/src/lightml/dummyfunctions.py deleted file mode 100644 index 8eec097..0000000 --- a/src/lightml/dummyfunctions.py +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (c) codecentric AG 2025. All Rights Reserved. -# -# Licensed under the MIT License. See the LICENSE file in the project root for more information. -# -# 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: -# -# 1. The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# 2. 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. - - -def dummyfunction(): - return 1 diff --git a/tests/test_file.py b/tests/test_file.py index 7e5b1e2..f44a03a 100644 --- a/tests/test_file.py +++ b/tests/test_file.py @@ -19,7 +19,7 @@ # 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. -from lightml.dummyfunctions import dummyfunction +from canaryml.dummyfunctions import dummyfunction def test_dummy_function(): diff --git a/tox.ini b/tox.ini index 5362675..243b7d3 100644 --- a/tox.ini +++ b/tox.ini @@ -16,4 +16,4 @@ description = "run the tests with pytest under {env_name}" deps = pytest pytest-cov -commands = pytest --durations 5 --junitxml=junit.xml --no-cov-on-fail --cov-report=xml:coverage.xml --cov=lightml tests/ +commands = pytest --durations 5 --junitxml=junit.xml --no-cov-on-fail --cov-report=xml:coverage.xml --cov=canaryml tests/ diff --git a/uv.lock b/uv.lock index e5fe289..a1fc86e 100644 --- a/uv.lock +++ b/uv.lock @@ -10,6 +10,27 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/78/b6/6307fbef88d9b5ee7421e68d78a9f162e0da4900bc5f5793f6d3d0e34fb8/annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53", size = 13643 }, ] +[[package]] +name = "canaryml" +version = "0.1.0" +source = { editable = "." } + +[package.dev-dependencies] +dev = [ + { name = "pre-commit" }, + { name = "pytest" }, + { name = "python-semantic-release" }, +] + +[package.metadata] + +[package.metadata.requires-dev] +dev = [ + { name = "pre-commit", specifier = ">=4.0.1" }, + { name = "pytest", specifier = ">=8.3.4" }, + { name = "python-semantic-release", specifier = ">=9.15.2" }, +] + [[package]] name = "certifi" version = "2024.12.14" @@ -230,27 +251,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/bd/0f/2ba5fbcd631e3e88689309dbe978c5769e883e4b84ebfe7da30b43275c5a/jinja2-3.1.5-py3-none-any.whl", hash = "sha256:aba0f4dc9ed8013c424088f68a5c226f7d6097ed89b246d7749c2ec4175c6adb", size = 134596 }, ] -[[package]] -name = "lightml" -version = "0.1.0" -source = { editable = "." } - -[package.dev-dependencies] -dev = [ - { name = "pre-commit" }, - { name = "pytest" }, - { name = "python-semantic-release" }, -] - -[package.metadata] - -[package.metadata.requires-dev] -dev = [ - { name = "pre-commit", specifier = ">=4.0.1" }, - { name = "pytest", specifier = ">=8.3.4" }, - { name = "python-semantic-release", specifier = ">=9.15.2" }, -] - [[package]] name = "markdown-it-py" version = "3.0.0"