Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://doi.org/10.5281/zenodo.8277925
19 March 2025, 10:06:30 UTC
  • Code
  • Branches (0)
  • Releases (7)
  • Visits
    • Branches
    • Releases
      • 7
      • 7
      • 6
      • 5
      • 4
      • 3
      • 2
      • 1
    • c19241d
    • /
    • nfdi4cat-voc4cat-tool-8cf1fde
    • /
    • pyproject.toml
    Raw File Download
    Permalinks

    To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
    Select below a type of object currently browsed in order to display its associated SWHID and permalink.

    • content
    • directory
    • snapshot
    • release
    origin badgecontent badge Iframe embedding
    swh:1:cnt:86b1e9a5379e6e7f8a4c63a1332a21aad48b0e02
    origin badgedirectory badge Iframe embedding
    swh:1:dir:bff31c9abef8ac0f0f5b8ad1fd201009f3d6529c
    origin badgesnapshot badge
    swh:1:snp:f74baa1136b7b1b4945ba60db7f8045dea4463d7
    origin badgerelease badge
    swh:1:rel:e8bc433a64a296992f211f09c4910b0225ad1f90
    Citations

    This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
    Select below a type of object currently browsed in order to generate citations for them.

    • content
    • directory
    • snapshot
    • release
    Generate software citation in BibTex format (requires biblatex-software package)
    Generating citation ...
    Generate software citation in BibTex format (requires biblatex-software package)
    Generating citation ...
    Generate software citation in BibTex format (requires biblatex-software package)
    Generating citation ...
    Generate software citation in BibTex format (requires biblatex-software package)
    Generating citation ...
    pyproject.toml
    [build-system]
    requires = ["hatchling", "hatch-vcs"]
    build-backend = "hatchling.build"
    
    [project]
    # Storing project metadata in pyproject.toml https://peps.python.org/pep-0621/
    name = "voc4cat"
    description = "SKOS vocabulary management tool of NFDI4Cat."
    authors = [
      # Authors sorted by number of commits as of 2023-07-04
      {name = "David Linke", email = "david.linke@catalysis.de"},
      {name = "Peter Philips", email = "peter.philips@surroundaustralia.com"},
      {name = "Nicholas Car", email = "nick@kurrawong.net"},
      {name = "Jamie Feiss", email = "jamie.feiss@surroundaustralia.com"},
    ]
    maintainers = [
      {name = "David Linke", email = "david.linke@catalysis.de"},
    ]
    license = {text = "BSD-3-Clause"}
    readme = "README.md"
    requires-python = ">=3.10"
    
    keywords = ["SKOS", "vocabulary", "spreadsheet", "xlsx", "linked data", "rdf"]
    
    classifiers = [
      "Development Status :: 5 - Production/Stable",
      "Programming Language :: Python",
      "Environment :: Console",
      "Intended Audience :: Science/Research",
      "License :: OSI Approved :: BSD License",
      "Operating System :: OS Independent",
      "Programming Language :: Python :: 3.10",
      "Programming Language :: Python :: 3.11",
      "Programming Language :: Python :: 3.12",
      "Programming Language :: Python :: 3.13",
    ]
    
    dependencies = [
      "base32-crockford",
      "colorama",
      "curies < 0.7.10",  # due to pydantic 1.x use in voc4cat-tool
      "jinja2",
      "networkx",
      "openpyxl >= 3.1.5",
      "pillow",
      "pydantic < 2.0.0",
      "pyshacl",
      "rdflib",
      "tomli>=1.1.0; python_version < '3.11'",
    ]
    
    dynamic = ["version"]
    
    [project.urls]
    Homepage = "https://github.com/nfdi4cat/voc4cat-tool/"
    Documentation = "https://github.com/nfdi4cat/voc4cat-tool/"
    Changelog = "https://github.com/nfdi4cat/voc4cat-tool/blob/main/CHANGELOG.md"
    
    [project.optional-dependencies]
    tests = [
      "pytest",
      "pytest-subprocess",
      "coverage",
    ]
    lint = [
      "black",
    ]
    dev = [
        # Recursively including the project's own optional dependencies requires pip>=21.2
        "voc4cat[tests,lint]",
        "ruff",
    ]
    
    [project.scripts]
    voc4cat = "voc4cat.cli:run_cli_app"
    voc4cat-merge = "voc4cat.merge_vocab:main_cli"
    
    [tool.hatch.metadata]
    # Hatch disallows direct references for dependencies by default.
    # We need to enable them to allow installing NFDI4Cat's vocexcel from github.
    allow-direct-references = true
    
    # Build targets for hatch are defined as sections within tool.hatch.build.targets:
    [tool.hatch.build.targets.sdist]
    include = [
      "/src",
      "/templates",
    ]
    [tool.hatch.build.targets.wheel]
    packages = ["src/voc4cat"]
    
    # integrates git-tag-based versions into hatch, https://github.com/ofek/hatch-vcs
    [tool.hatch.version]
    source = "vcs"
    
    [tool.hatch.build.hooks.vcs]
    version-file = "src/voc4cat/_version.py"
    
    [tool.pytest.ini_options]
    # pytest configuration:
    # https://docs.pytest.org/en/stable/customize.html
    
    # Sets directories to be searched for tests. Useful when all project tests are
    # in a known location to speed up test collection and to avoid picking up
    # undesired tests by accident. (related: issue #95)
    testpaths = [
      "tests",
     ]
    
    # Directories that are not visited by pytest collector:
    norecursedirs = "dist build .tox .git .cache __pycache__ .venv"
    
    # Treat typos in function markers as an error (pytest)
    # --strict-markers
    # Raise an error instead of a warning for pytest related config issues (pytest)
    # --strict-config
    # Degree of detail of trace-backs (pytest)
    # --tb=short
    # Execute doctests in classes, functions, and test modules (pytest)
    # --doctest-modules
    addopts = "--strict-markers --strict-config --tb=short"
    
    [tool.coverage]
    [tool.coverage.run]
    # https://coverage.readthedocs.io/en/latest/config.html
    parallel = true
    branch = true
    source = ["voc4cat"]
    omit = [
        "**/voc4cat/_version.py",
    ]
    
    [tool.coverage.paths]
    # Specify where coverage schould look for source files.
    source = [
        "src",
        "**/site-packages", # for not using tox
        # ".tox/**/site-packages",
    ]
    
    [tool.coverage.report]
    # Show in report which lines are not covered
    show_missing = false
    # Any line of the source code that matches one of these regexes is excluded
    # from being reported as missing.
    exclude_lines = [
        # Have to re-enable the standard pragma
        "pragma: no cover",
        # Don't complain if tests don't hit defensive assertion code:
        "raise AssertionError",
        "raise NotImplementedError",
        "return NotImplemented",
        "if __name__ == .__main__.:",
    ]
    
    [tool.coverage.html]
    # Directory where to write the HTML report files.
    directory = ".htmlcov"
    title = "voc4cat coverage report"
    
    [tool.ruff]
    # https://beta.ruff.rs/docs/configuration/
    
    exclude = [
        "__pycache__",
        "*.egg",
        ".*",
    ]
    
    # Assume Python 3.10 syntax and semantics for linting.
    target-version = "py310"
    
    # Same as Black.
    line-length = 88
    
    [tool.ruff.lint]
    
    ignore = [
        "B905",  # zip() without an explicit strict= parameter set. (requires python >= 3.10)
        "E501",  # line too long
    ]
    
    # Avoid trying to fix these violations
    unfixable = [
        "B",  # flake8-bugbear
    ]
    # Rule selection https://beta.ruff.rs/docs/rules/
    select = [
        # sort order as in ruff docs
        "F",   # Pyflakes
        "E",   # pycodestyle (errors)
        "W",   # pycodestyle (warnings)
        "C90", # mccabe
        "I",   # isort
        "N",   # pep8-naming
        # "D",   # pydocstyle
        "UP",  # pyupgrade
        "YTT", # flake8-2020
        # flake8-annotations (ANN)
        # flake8-async (ASYNC)
        "S",   # flake8-bandit
        "B",   # flake8-bugbear
        "A",   # flake8-builtins
        "C4",  # flake8-comprehensions
        "DTZ", # flake8-datetimez
        "T10", # flake8-debugger
        # "DJ",  # flake8-django
        "EM",  # flake8-errmsg
        "ISC", # flake8-implicit-str-concat
        "G",   # flake8-logging-format
        "PIE", # flake8-pie
        "PT",  # flake8-pytest-style
        "Q",   # flake8-quotes
        "RET", # flake8-return
        "SIM", # flake8-simplify
        # "ARG", # flake8-unused-arguments (ARG)
        # "PTH", # flake8-use-pathlib (PTH)
        # "ERA", # eradicate (ERA) - commented out code
        # pandas-vet (PD)
        "PGH", # pygrep-hooks
        "PL",  # whole Pylint (Convention, Error, Refactor, Warning)
        "TRY", # tryceratops (TRY)
        # NumPy-specific rules (NPY)
        "RUF",  # Ruff-specific rules
    ]
    
    [tool.ruff.lint.per-file-ignores]
    "tests/*.py" = [
      "S101",   # assert in tests is OK
    ]
    
    [tool.ruff.lint.mccabe]
    # Flake8-mccabe uses a default level of 7, ruff of 10.
    max-complexity = 10
    
    [tool.ruff.lint.pep8-naming]
    # Allow Pydantic's `@validator` decorator to trigger class method treatment.
    classmethod-decorators = [
      "classmethod",
      # for pydantic 1.x
      "pydantic.validator", "pydantic.class_validators.root_validator"
    ]
    
    [tool.mypy]
    # https://mypy.readthedocs.io/en/latest/config_file.html#using-a-pyproject-toml-file
    # Suppress all missing import errors for all untyped libraries
    ignore_missing_imports = true
    
    [tool.codespell]
    skip = "*.xlsx,pyproject.toml,./vocabularies,./example,./tests/data,./tmp"
    # Note: words have to be lowercased for the ignore-words-list
    ignore-words-list = "linke"
    quiet-level = 3
    

    Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
    The source code of Software Heritage itself is available on our development forge.
    The source code files archived by Software Heritage are available under their own copyright and licenses.
    Terms of use: Archive access, API— Contact— JavaScript license information— Web API

    back to top