Skip to content

Commit

Permalink
chore: Add Makefile with test commands
Browse files Browse the repository at this point in the history
  • Loading branch information
aiakide committed Feb 4, 2025
1 parent 0234324 commit e3ccd14
Show file tree
Hide file tree
Showing 20 changed files with 150 additions and 93 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/BUG-REPORT.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
30 changes: 15 additions & 15 deletions .github/ISSUE_TEMPLATE/FEATURE-REQUEST.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -10,33 +10,33 @@ body:
value: |
Thank you for taking the time to fill out this feature request. 🚀
- type: textarea
id: problem-description
id: context
attributes:
label: ✏️ Problem Description
description: Describe the problem or lack of functionality that you want to address. ✨
placeholder: What is not working as desired? Which feature is missing or could be improved?
validations:
required: true
label: 🌍 Context
description: What is the context for requesting the feature? What use case are you facing? 📝
placeholder: Please describe why you want to request the feature.
- type: textarea
id: feature-request
attributes:
label: 💡 Feature Request
description: What feature do you want to request or would like to have improved? 🔍
placeholder: Please describe the desired feature in detail.
label: 💡 Suggested Feature
description: What feature do you want to request or would like to have improved? What difficulties are you facing in your use case with the current implementation? 🔍
placeholder: What is not working as desired? Which feature is missing or could be improved?
validations:
required: true
- type: textarea
id: context
id: suggested-implementation
attributes:
label: 🌍 Context
description: Describe the context or background in which the new feature or improvement would be useful. 📝
placeholder: Which user group or target audience would it affect? What benefits would they gain from it?
label: 🚀 Suggested Implementation
description: How can/should the feature be solved? Which existing feature can be used to solve the request? ✨
placeholder: What is not working as desired? Which feature is missing or could be improved?
validations:
required: true
- type: textarea
id: additional-info
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:
Expand Down
5 changes: 0 additions & 5 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

Please describe your changes in detail and provide any necessary context.

## 👀 Affected Areas

Please indicate which areas of the project are affected by your changes (e.g. pipelines, tests, documentation).

## 📝 Checklist

Please make sure you've completed the following tasks before submitting this pull request:
Expand All @@ -16,7 +12,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

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/pre-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -38,7 +38,7 @@ jobs:
- name: ⬇️ Download current coverage report
uses: actions/download-artifact@v4
with:
name: code-coverage-report-${{runner.os}}-3.10
name: code-coverage-report-${{github.event.pull_request.number}}
path: ./coverage.xml
- name: 📃Pytest coverage report
id: coverageComment
Expand All @@ -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'
Expand Down
22 changes: 9 additions & 13 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -82,9 +71,16 @@ jobs:
junitxml-path: ./junit.xml
junitxml-title: Pytest summary
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: 🔍Check if coverage report already exists
id: check-existing-artifact
uses: xSAVIKx/artifact-exists-action@v0
with:
name: code-coverage-report-${{github.event.pull_request.number}}
- name: ⬆️ Upload coverage report
if: steps.check-existing-artifact.outputs.exists == 'false'
uses: actions/upload-artifact@v4
with:
name: code-coverage-report-${{matrix.python-version}}-${{matrix.os}}
name: code-coverage-report-${{github.event.pull_request.number}}
path: ./coverage.xml
overwrite: 'true'

6 changes: 4 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -38,7 +38,7 @@ jobs:
- name: ⬇️ Download current coverage report
uses: actions/download-artifact@v4
with:
name: code-coverage-report-${{runner.os}}-3.10
name: code-coverage-report-${{github.event.pull_request.number}}
path: ./coverage.xml
- name: 📃Pytest coverage report
id: coverageComment
Expand All @@ -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'
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,5 @@ cython_debug/
data/

.DS_Store

junit.xml
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- Pytest Coverage Comment:Begin -->
<!-- Pytest Coverage Comment:End -->

[![🧪 pytest](https://github.com/codecentric-oss/lightml/actions/workflows/pytest.yaml/badge.svg)](https://github.com/codecentric-oss/lightml/actions/workflows/pytest.yaml)
[![🧪 pytest](https://github.com/codecentric-oss/canaryml/actions/workflows/pytest.yaml/badge.svg)](https://github.com/codecentric-oss/canaryml/actions/workflows/pytest.yaml)
2 changes: 1 addition & 1 deletion config/.python-semantic-release.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"pyproject.toml:project.version"
],
"version_variables": [
"src/lightml/__init__.py:__version__"
"src/canaryml/__init__.py:__version__"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions config/semantic-release-templates/.components/macros.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
81 changes: 79 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,40 @@
[project]
name = "lightml"
name = "canaryml"
version = "0.1.0"
description = "Add your description here"
description = "Welcome to CanaryML 👋, a python-based framework to speed up the implementation and customization of your Machine Learning project 🧠."
authors = [
{ name = "Denis Stalz-John", email = "[email protected]" },
{ name = "Nils Uhrberg", email = "[email protected]" },
{ name = "Anke Koke", email = "[email protected]" }
]
readme = "README.md"
requires-python = ">=3.10"
line-length = 100
indent-width = 4
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"
]

dependencies = []

[dependency-groups]
Expand All @@ -13,6 +44,52 @@ dev = [
"python-semantic-release>=9.15.2",
]

[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"


[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"]
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions src/canaryml/dummyfunctions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def dummyfunction():
return 1
Empty file added src/canaryml/py.tpyed
Empty file.
25 changes: 0 additions & 25 deletions src/lightml/dummyfunctions.py

This file was deleted.

2 changes: 1 addition & 1 deletion tests/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Loading

0 comments on commit e3ccd14

Please sign in to comment.