Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: CI Pipeline (PRs and pushes main)
run-name: Merged to main by ${{ github.actor }}

on:
push:
branches:
- main
branches: [main]
pull_request:
branches:
- main
branches: [main]

permissions:
contents: read
Expand All @@ -23,16 +22,16 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip

- name: Install package with pip
run: |
python -m pip install --upgrade pip
pip install .[dev]
- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Install dependencies
run: uv sync --group dev

- name: Run tests
run: pytest
run: uv run pytest
55 changes: 47 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,58 @@
fail_fast: true
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v6.0.0
hooks:
- id: check-ast
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: check-illegal-windows-names
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: check-toml
- id: check-yaml
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.9.5
- id: debug-statements
# - id: end-of-file-fixer
# - id: mixed-line-ending
# - id: trailing-whitespace
- repo: https://github.com/fpgmaas/deptry
rev: 0.24.0
hooks:
- id: uv-lock
- id: deptry
language: python
additional_dependencies: [deptry]
exclude: '^(?!.*\.py$).*$'
- repo: https://github.com/asottile/pyupgrade
rev: v3.21.2
hooks:
- id: pyupgrade
- repo: https://github.com/asottile/add-trailing-comma
rev: v4.0.0
hooks:
- id: add-trailing-comma
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.0
rev: v0.14.14
hooks:
- id: ruff
args: [ --fix ]
- id: ruff-check
args:
- --fix
- id: ruff-format
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.9.28
hooks:
- id: uv-lock
- repo: https://github.com/tombi-toml/tombi-pre-commit
rev: v0.7.25
hooks:
- id: tombi-format
- id: tombi-lint
- repo: https://github.com/crate-ci/typos
rev: v1
hooks:
- id: typos
exclude: "CITATION.cff|README.md"
- repo: local
hooks:
- id: uv-upgrade
Expand All @@ -25,4 +64,4 @@ repos:
name: pytest
entry: uv run pytest
language: system
types: [ file, python ]
types: [ file, python ]
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Changelog: flattened structure, changed identifiers to ORCID, changed versioning to major alone (before 'major.minor')
- Evidence: flattened structure to a single object (before: a list of objects)
- Reaction database IDs: flattened structure, changed formatting of EC to the code (e.g. 1.2.3.4) alone (before: string had to start with 'EC'), drop MITE crosslinks
- References: removed non-peristing reference types, only DOI allowed (before: url, pubmed, patent)
- References: removed non-persisting reference types, only DOI allowed (before: url, pubmed, patent)
- Tailoring reaction terms: removed 'FADH2 supply for chlorination' since it is not tailoring per se
- Status: removed 'embargoed' specification

Expand Down
6 changes: 3 additions & 3 deletions mite_schema/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ def config_logger(verboseness: str) -> logging.Logger:
console_handler = logging.StreamHandler(sys.stdout)
console_handler.setFormatter(
coloredlogs.ColoredFormatter(
"%(asctime)s - %(name)s - %(levelname)s - %(message)s"
)
"%(asctime)s - %(name)s - %(levelname)s - %(message)s",
),
)
logger.addHandler(console_handler)
return logger
Expand Down Expand Up @@ -98,7 +98,7 @@ def main() -> None:
logger = config_logger(args.v)

logger.info(
f"Validate file '{args.i}' with MITE schema v{metadata.version('mite_schema')}."
f"Validate file '{args.i}' with MITE schema v{metadata.version('mite_schema')}.",
)

for file in args.i:
Expand Down
124 changes: 50 additions & 74 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,57 +1,45 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "mite_schema"
version = "1.8.4"
description = "Containing the Minimum Information about a Tailoring Enzymes data standard schema and auxiliary methods"
readme = "README.md"
requires-python = ">=3.11"
license-files = { paths = ["LICENSE"] }
authors = [
{ name = "Mitja M. Zdouc", email = "zdoucmm@gmail.com" }
]
keywords = [
"cheminformatics",
"genomics"
]
license-files = ["LICENSE"]
authors = [{ name = "Mitja M. Zdouc", email = "zdoucmm@gmail.com" }]
keywords = ["cheminformatics", "genomics"]
classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: MIT License",
"Operating System :: POSIX :: Linux",
"Development Status :: 4 - Beta",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Topic :: Scientific/Engineering :: Chemistry"
"Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Topic :: Scientific/Engineering :: Chemistry"
]
dependencies = [
"argparse~=1.4",
"coloredlogs~=15.0",
"jsonschema~=4.25",
"pydantic~=2.11",
"coloredlogs~=15.0",
"jsonschema~=4.25",
"pydantic~=2.11",
]

[project.urls]
Website = "https://mite.bioinformatics.nl/"
Discussions = "https://github.com/orgs/mite-standard/discussions/3"
Homepage = "https://github.com/mite-standard/mite_schema"
Issues = "https://github.com/mite-standard/mite_schema/issues"
Discussions = "https://github.com/orgs/mite-standard/discussions/3"
Website = "https://mite.bioinformatics.nl/"

[project.scripts]
mite_schema = "mite_schema.main:main"

Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change from [project.optional-dependencies] to [dependency-groups] is a significant breaking change for users. The [project.optional-dependencies] section is a PEP 621 standard that allows installing dev dependencies with pip install .[dev]. The [dependency-groups] section is a uv-specific feature (PEP 735) that requires users to use uv for installation. This change will break existing workflows for users who install the package with pip using pip install -e .[dev]. Consider maintaining backward compatibility or documenting this breaking change clearly.

Suggested change
[project.optional-dependencies]
dev = ["pre-commit~=4.3", "pytest~=8.4", "ruff~=0.13"]

Copilot uses AI. Check for mistakes.
[project.optional-dependencies]
dev = [
"pre-commit~=4.3",
"pytest~=8.4",
"ruff~=0.13"
]
[dependency-groups]
dev = ["pre-commit~=4.3", "pytest~=8.4", "ruff~=0.13"]
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pyproject.toml specifies ruff~=0.13 in the dev dependency group, but uv.lock has resolved to version 0.14.14. The ~= operator allows minor version updates (0.13.x) but should not allow 0.14.x. This indicates the lockfile is inconsistent with the dependency specification. Either update pyproject.toml to ruff~=0.14 to match the locked version, or regenerate the lockfile with the correct version constraint.

Suggested change
dev = ["pre-commit~=4.3", "pytest~=8.4", "ruff~=0.13"]
dev = ["pre-commit~=4.3", "pytest~=8.4", "ruff~=0.14"]

Copilot uses AI. Check for mistakes.

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.envs.dev]
features = [
"dev"
]
features = ["dev"]

[tool.hatch.build.targets.sdist]
exclude = [
Expand All @@ -71,48 +59,36 @@ exclude = [
[tool.hatch.build.targets.wheel]
packages = ["mite_schema"]

[tool.pytest.ini_options]
minversion = "6.0"
addopts = "-ra -q"
testpaths = [
"tests",
]
pythonpath = [
"mite_schema"
]

[tool.ruff.lint]
select = [
# flake8-bugbear
"B",
# flake8-comprehensions
"C4",
# flake8-eradicate/eradicate
"ERA",
# isort
"I",
# pep8-naming
"N",
# flake8-pie
"PIE",
# pygrep
"PGH",
# ruff checks
"RUF",
# flake8-simplify
"SIM",
# flake8-type-checking
"TCH",
# flake8-tidy-imports
"TID",
# pyupgrade
"UP",
# flake8-bugbear
"B",
# flake8-comprehensions
"C4",
# flake8-eradicate/eradicate
"ERA",
# isort
"I",
# pep8-naming
"N",
# flake8-pie
"PIE",
# pygrep
"PGH",
# ruff checks
"RUF",
# flake8-simplify
"SIM",
# flake8-tidy-imports
"TID",
# pyupgrade
"UP",
]
ignore = [
# whitespace-before-punctuation
"E203",
# percent-format-invalid-format
"E501",
# mixed-case-variable-in-class-scope
"N815"
# whitespace-before-punctuation
"E203",
# percent-format-invalid-format
"E501",
# mixed-case-variable-in-class-scope
"N815"
]
9 changes: 6 additions & 3 deletions tests/test_main_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ def test_no_attrs(monkeypatch):

def test_cli_single_valid(monkeypatch):
monkeypatch.setattr(
"sys.argv", ["mite-schema", "-i", "tests/example_files/example_valid.json"]
"sys.argv",
["mite-schema", "-i", "tests/example_files/example_valid.json"],
)
with pytest.raises(SystemExit) as e:
main()
Expand All @@ -36,7 +37,8 @@ def test_cli_multi_valid(monkeypatch):

def test_cli_single_invalid(monkeypatch):
monkeypatch.setattr(
"sys.argv", ["mite-schema", "-i", "tests/example_files/example_invalid.json"]
"sys.argv",
["mite-schema", "-i", "tests/example_files/example_invalid.json"],
)
with pytest.raises(SystemExit) as e:
main()
Expand All @@ -45,7 +47,8 @@ def test_cli_single_invalid(monkeypatch):

def test_cli_multi_invalid(monkeypatch):
monkeypatch.setattr(
"sys.argv", ["mite-schema", "-i", "tests/example_files/example_invalid.json"]
"sys.argv",
["mite-schema", "-i", "tests/example_files/example_invalid.json"],
)
with pytest.raises(SystemExit) as e:
main()
Expand Down
Loading
Loading