Skip to content

Commit

Permalink
Update pyproject.toml and use bump-my-version (#1211)
Browse files Browse the repository at this point in the history
  • Loading branch information
cthoyt authored Oct 18, 2024
1 parent 519e867 commit 957d28e
Show file tree
Hide file tree
Showing 4 changed files with 377 additions and 201 deletions.
32 changes: 0 additions & 32 deletions .bumpversion.cfg

This file was deleted.

274 changes: 274 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,281 @@ multi_line_output = 3
include_trailing_comma = true
reverse_relative = true

# Pytest, see https://docs.pytest.org/en/stable/reference/customize.html#pyproject-toml
[tool.pytest.ini_options]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
]

[project]
name = "bioregistry"
version = "0.11.18-dev"
description = "Integrated registry of biological databases and nomenclatures"
readme = "README.md"
authors = [
{ name = "Charles Tapley Hoyt", email = "cthoyt@gmail.com" }
]
maintainers = [
{ name = "Charles Tapley Hoyt", email = "cthoyt@gmail.com" }
]

# See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#classifiers
# Search tags using the controlled vocabulary at https://pypi.org/classifiers
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Framework :: Pytest",
"Framework :: tox",
"Framework :: Sphinx",
"Programming Language :: Python",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3 :: Only",
]
keywords = [
"snekpack", # please keep this keyword to credit the cookiecutter-snekpack template
"cookiecutter",
"databases",
"biological databases",
"biomedical databases",
"persistent identifiers",
]

# License Information. This can be any valid SPDX identifiers that can be resolved
# with URLs like https://spdx.org/licenses/MIT
# See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license
license = { file = "LICENSE" }

requires-python = ">=3.9"
dependencies = [
"requests",
"tqdm",
"pystow>=0.1.13",
"click",
"more_click>=0.1.2",
"pydantic",
"curies>=0.7.0"
]

[project.optional-dependencies]
tests = [
"pytest",
"coverage",
"more_itertools",
"httpx",
]
docs = [
"sphinx>=8",
"sphinx-rtd-theme>=3.0",
"sphinx-click",
"sphinx_automodapi",
"autodoc_pydantic",
]
gha = [
"more_itertools",
]
align = [
"pyyaml",
"beautifulsoup4",
"tabulate",
"defusedxml",
"class-resolver",
"fairsharing-client>=0.1.0",
"pandas",
]
export = [
"pyyaml",
"rdflib",
"rdflib-jsonld",
"ndex2",
]
charts = [
"matplotlib",
"matplotlib_venn",
"seaborn",
"pandas",
"jinja2",
]
health = [
"click_default_group",
"pandas",
"tabulate",
"pyyaml",
"jinja2",
]
web = [
"pyyaml",
"rdflib",
"rdflib-jsonld",
"rdflib-endpoint",
"flask<2.2.4",
"werkzeug<2.3.0",
"fastapi",
"uvicorn",
"bootstrap-flask<=2.0.0",
"markdown",
"curies[fastapi]",
]


# See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#urls
[project.urls]
"Bug Tracker" = "https://github.com/biopragmatics/bioregistry/issues"
Homepage = "https://github.com/biopragmatics/bioregistry"
Repository = "https://github.com/biopragmatics/bioregistry.git"
Documentation = "https://bioregistry.readthedocs.io"

[tool.setuptools]
package-dir = { "" = "src" }

[tool.setuptools.packages.find]
# this implicitly sets `packages = ":find"`
where = ["src"] # list of folders that contain the packages (["."] by default)

# See https://setuptools.pypa.io/en/latest/userguide/datafiles.html
[tool.setuptools.package-data]
"*" = ["*.*"]

[project.scripts]
bioregistry = "bioregistry.cli:main"

[tool.cruft]
skip = [
"**/__init__.py",
"tests/*"
]

# MyPy, see https://mypy.readthedocs.io/en/stable/config_file.html
[tool.mypy]
plugins = [
"pydantic.mypy",
]

# Doc8, see https://doc8.readthedocs.io/en/stable/readme.html#ini-file-usage
[tool.doc8]
max-line-length = 120

# Coverage, see https://coverage.readthedocs.io/en/latest/config.html
[tool.coverage.run]
branch = true
source = [
"bioregistry",
]
omit = [
"tests/*",
"docs/*",
"src/bioregistry/cli.py",
"src/bioregistry/__main__.py",
]

[tool.coverage.paths]
source = [
"src/bioregistry",
".tox/*/lib/python*/site-packages/bioregistry",
]

[tool.coverage.report]
show_missing = true
exclude_lines = [
"pragma: no cover",
"raise NotImplementedError",
"if __name__ == \"__main__\":",
"if TYPE_CHECKING:",
"def __str__",
"def __repr__",
]

[tool.ruff]
line-length = 100
extend-include = ["*.ipynb"]

[tool.ruff.lint]
# See https://docs.astral.sh/ruff/rules
extend-select = [
"F", # pyflakes
"E", # pycodestyle errors
"W", # pycodestyle warnings
"C90", # mccabe
"I", # isort
"UP", # pyupgrade
"D", # pydocstyle
"DOC", # pydoclint
"B", # bugbear
"S", # bandit
"T20", # print
"N", # pep8 naming
"ERA", # eradicate commented out code
"NPY", # numpy checks
"RUF", # ruff rules
"C4", # comprehensions
]
ignore = [
"D105", # Missing docstring in magic method
"E203", # Black conflicts with the following
]

# See https://docs.astral.sh/ruff/settings/#per-file-ignores
[tool.ruff.lint.per-file-ignores]
# Ignore security issues in the version.py, which are inconsistent
"src/bioregistry/version.py" = ["S603", "S607"]
# Ignore commented out code in Sphinx configuration file
"docs/source/conf.py" = ["ERA001"]
# Prints are okay in notebooks
"notebooks/**/*.ipynb" = ["T201"]

[tool.ruff.lint.pydocstyle]
convention = "pep257"

[tool.ruff.lint.isort]
relative-imports-order = "closest-to-furthest"
known-third-party = [
"tqdm",
]
known-first-party = [
"bioregistry",
"tests",
]

[tool.ruff.format]
# see https://docs.astral.sh/ruff/settings/#format_docstring-code-format
docstring-code-format = true

[tool.bumpversion]
current_version = "0.11.18-dev"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)(?:-(?P<release>[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?(?:\\+(?P<build>[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?"
serialize = [
"{major}.{minor}.{patch}-{release}+{build}",
"{major}.{minor}.{patch}+{build}",
"{major}.{minor}.{patch}-{release}",
"{major}.{minor}.{patch}",
]
commit = true
tag = false

[tool.bumpversion.parts.release]
optional_value = "production"
first_value = "dev"
values = [
"dev",
"production",
]

[[tool.bumpversion.files]]
filename = "pyproject.toml"
search = "version = \"{current_version}\""
replace = "version = \"{new_version}\""

[[tool.bumpversion.files]]
filename = "docs/source/conf.py"
search = "release = \"{current_version}\""
replace = "release = \"{new_version}\""

[[tool.bumpversion.files]]
filename = "src/bioregistry/version.py"
search = "VERSION = \"{current_version}\""
replace = "VERSION = \"{new_version}\""
Loading

0 comments on commit 957d28e

Please sign in to comment.