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 3, 2025
1 parent 0234324 commit 33fb057
Show file tree
Hide file tree
Showing 19 changed files with 126 additions and 72 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
4 changes: 2 additions & 2 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 Down Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion .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 Down Expand Up @@ -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
13 changes: 1 addition & 12 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 Down
4 changes: 3 additions & 1 deletion .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 Down Expand Up @@ -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
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: 80 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,97 @@
[project]
name = "lightml"
name = "canaryml"
version = "0.1.0"
description = "Add your description here"
authors = [
"Denis Stalz-John <[email protected]>",
"Nils Uhrberg <[email protected]>",
"Anke Koke <[email protected]>"
]
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",
"pytest>=8.3.4",
"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"]
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/
42 changes: 21 additions & 21 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 33fb057

Please sign in to comment.