Skip to content

Commit

Permalink
[MAINT] switch bidsschematools to pyproject.toml (#1948)
Browse files Browse the repository at this point in the history
* switch to pyproject.toml

* msic

* add manifest

* fix

* try  packaging data

* fix

* rm manifest

* fix: packages.find.include

* Apply suggestions from code review

Co-authored-by: Chris Markiewicz <[email protected]>

* reorder

---------

Co-authored-by: Chris Markiewicz <[email protected]>
  • Loading branch information
Remi-Gau and effigies authored Oct 11, 2024
1 parent 2e86e99 commit f2771e1
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 91 deletions.
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', --no-sort]
- 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
99 changes: 88 additions & 11 deletions tools/schemacode/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,82 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
requires = ["setuptools"]

[project]
name = "bidsschematools"
description = " Python tools for working with the BIDS schema."
authors = [{name = "bids-standard developers"}]
maintainers = [{name = "bids-standard developers", email = " [email protected]"}]
license = {text = "MIT"}
readme = "README.md"
requires-python = ">=3.9"
dependencies = [
"click",
"pyyaml",
"jsonschema"
]
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"
]
dynamic = ["version"]

[project.optional-dependencies]
expressions = ["pyparsing"]
render = [
"tabulate",
"pandas",
"markdown-it-py"
]
tests = [
"bidsschematools[expressions,render]",
"codecov",
"coverage[toml]",
"flake8",
"flake8-black",
"flake8-isort",
"pytest>6",
"pytest-cov"
]
doc = [
"sphinx>=1.5.3",
"sphinx_rtd_theme"
]
all = [
"bidsschematools[doc,tests]"
]

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

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

[tool.setuptools.dynamic]
version = {file = "bidsschematools/data/schema/SCHEMA_VERSION"}

[tool.setuptools.package-data]
bidsschematools = [
"data/metaschema.json",
"data/schema/BIDS_VERSION",
"data/schema/SCHEMA_VERSIO",
"data/schema/**/*.yaml",
"tests/data/**/*",
"tests/data/**/.bidsignore"
]

[tool.setuptools.packages.find]
include = ["bidsschematools*"]

[tool.black]
line-length = 99
target-version = ['py39']
include = '\.pyi?$'
exclude = '''
(
Expand All @@ -21,18 +93,23 @@ exclude = '''
)
'''

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

0 comments on commit f2771e1

Please sign in to comment.