Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MAINT] switch bidsschematools to pyproject.toml #1948

Merged
merged 10 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
8 changes: 7 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ repos:
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
- id: check-toml
- id: check-ast
- id: check-added-large-files
- id: check-case-conflict
Expand Down Expand Up @@ -48,7 +49,7 @@ repos:
rev: 7.1.1
hooks:
- id: flake8
args: [--config=tools/schemacode/setup.cfg]
args: [--config=tools/schemacode/.flake8]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
Expand All @@ -61,6 +62,11 @@ repos:
- id: yamllint
args: [-f=standard, -c=.yamllint.yml]
files: src/schema/.*/.*\.yaml
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.14.0
hooks:
- id: pretty-format-toml
args: [--autofix, --indent, '4']
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think sorting leads to a very readable pyproject.toml, where I think there are some rough importance levels that are good to indicate (e.g. "name" should be the first thing in project metadata).

Suggested change
args: [--autofix, --indent, '4']
args: [--autofix, --indent, '4', --no-sort]

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good with me
defo not a hill I want to die on

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

forgot to commit this one

- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
Expand Down
7 changes: 7 additions & 0 deletions tools/schemacode/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[flake8]
max-line-length = 99
exclude = *build/
ignore = E203,E402,E722,W503
per-file-ignores =
*/__init__.py : F401
docstring-convention = numpy
6 changes: 6 additions & 0 deletions tools/schemacode/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
include bidsschematools/data/metaschema.json
include bidsschematools/data/schema/BIDS_VERSION
include bidsschematools/data/schema/SCHEMA_VERSION
recursive-include bidsschematools/data/schema *.yaml
recursive-include bidsschematools/tests/data
recursive-include bidsschematools/tests/data/ .bidsignore
89 changes: 75 additions & 14 deletions tools/schemacode/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,64 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
build-backend = "hatchling.build"
requires = ["hatchling"]

[project]
authors = [{name = "bids-standard developers"}]
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Information Analysis",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13"
]
dependencies = [
"click",
"pyyaml",
"jsonschema"
]
description = " Python tools for working with the BIDS schema."
license = {text = "MIT"}
maintainers = [{name = "bids-standard developers", email = " [email protected]"}]
name = "bidsschematools"
readme = "README.md"
requires-python = ">=3.9"
version = "0.11.4-dev" # file:bidsschematools/data/schema/SCHEMA_VERSION
Remi-Gau marked this conversation as resolved.
Show resolved Hide resolved

[project.optional-dependencies]
all = [
"bidsschematools[doc,render,tests,expressions]"
]
doc = [
"sphinx>=1.5.3",
"sphinx_rtd_theme"
]
expressions = ["pyparsing"]
render = [
"tabulate",
"pandas",
"markdown-it-py"
]
tests = [
"codecov",
"coverage[toml]",
"flake8",
"flake8-black",
"flake8-isort",
"pytest>6",
"pytest-cov"
]
Remi-Gau marked this conversation as resolved.
Show resolved Hide resolved

[project.scripts]
bst = "bidsschematools.__main__:cli"

[project.urls]
Homepage = "https://github.com/bids-standard/bids-specification"

Remi-Gau marked this conversation as resolved.
Show resolved Hide resolved
[tool.black]
line-length = 99
target-version = ['py39']
include = '\.pyi?$'
exclude = '''
Remi-Gau marked this conversation as resolved.
Show resolved Hide resolved
(
/(
Expand All @@ -20,19 +73,27 @@ exclude = '''
)/
)
'''
include = '\.pyi?$'
line-length = 99
target-version = ['py39']
Remi-Gau marked this conversation as resolved.
Show resolved Hide resolved

[tool.coverage.run]
omit = [
"*/*/tests/*",
"**/tests/*"
]
parallel = true

[tool.isort]
profile = "black"
multi_line_output = 3
profile = "black"

[tool.pytest.ini_options]
addopts = "-ra --strict-markers --strict-config"
log_cli = true
log_cli_level = "INFO"
markers = [
"validate_schema: tests that validate the schema itself",
]

[tool.coverage.run]
parallel = true
omit = [
"*/*/tests/*",
"**/tests/*"
"validate_schema: tests that validate the schema itself"
]
minversion = "6.0"
xfail_strict = true
79 changes: 0 additions & 79 deletions tools/schemacode/setup.cfg

This file was deleted.

Loading