Skip to content
Merged
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
10 changes: 2 additions & 8 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# -*- coding: utf-8 -*-
#
# This file is part of base32-lib
# Copyright (C) 2015, 2016 CERN.
#
# base32-lib is free software; you can redistribute it and/or modify
# it under the terms of the Revised BSD License; see LICENSE file for
# more details.
# SPDX-FileCopyrightText: 2015, 2016 CERN.
# SPDX-License-Identifier: BSD-3-Clause
#
# In applying this license, CERN does not waive the privileges and immunities
# granted to it by virtue of its status as an Intergovernmental Organization
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ on:
jobs:
Python:
uses: inveniosoftware/workflows/.github/workflows/tests-python.yml@master
with:
extras: "tests,docs"
9 changes: 3 additions & 6 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
..
This file is part of base32-lib
Copyright (C) 2019 CERN.
Copyright (C) 2019 Northwestern University.

base32-lib is free software; you can redistribute it and/or modify it
under the terms of the MIT License; see LICENSE file for more details.
SPDX-FileCopyrightText: 2019 CERN.
SPDX-FileCopyrightText: 2019 Northwestern University.
SPDX-License-Identifier: MIT


Authors
Expand Down
9 changes: 3 additions & 6 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
..
This file is part of base32-lib
Copyright (C) 2019 CERN.
Copyright (C) 2019 Northwestern University.

base32-lib is free software; you can redistribute it and/or modify it
under the terms of the MIT License; see LICENSE file for more details.
SPDX-FileCopyrightText: 2019 CERN.
SPDX-FileCopyrightText: 2019 Northwestern University.
SPDX-License-Identifier: MIT

Changes
=======
Expand Down
13 changes: 5 additions & 8 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# -*- coding: utf-8 -*-
#
# This file is part of base32-lib
# Copyright (C) 2019 CERN.
# Copyright (C) 2019 Northwestern University.

# base32-lib is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
# SPDX-FileCopyrightText: 2019 CERN.
# SPDX-FileCopyrightText: 2019 Northwestern University.
# SPDX-License-Identifier: MIT

exclude .git-blame-ignore-revs
exclude uv.lock
include *.rst
include *.toml
include .coveragerc
Expand Down
9 changes: 3 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
..
This file is part of base32-lib
Copyright (C) 2019 CERN.
Copyright (C) 2019 Northwestern University.

base32-lib is free software; you can redistribute it and/or modify it
under the terms of the MIT License; see LICENSE file for more details.
SPDX-FileCopyrightText: 2019 CERN.
SPDX-FileCopyrightText: 2019 Northwestern University.
SPDX-License-Identifier: MIT


=================
Expand Down
14 changes: 4 additions & 10 deletions base32_lib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
# -*- coding: utf-8 -*-
#
# This file is part of base32-lib
# Copyright (C) 2019 CERN.
# Copyright (C) 2019 Northwestern University,
# Galter Health Sciences Library & Learning Center.
# Copyright (C) 2025 Front Matter.

# base32-lib is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
# SPDX-FileCopyrightText: 2019 CERN.
# SPDX-FileCopyrightText: 2019 Northwestern University,
# SPDX-FileCopyrightText: 2025 Front Matter.
# SPDX-License-Identifier: MIT

"""Small library to generate, encode and decode random base32 identifiers."""

Expand Down
13 changes: 4 additions & 9 deletions base32_lib/base32.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
# -*- coding: utf-8 -*-
#
# This file is part of base32-lib
# Copyright (C) 2019 CERN.
# Copyright (C) 2019 Northwestern University.
# Copyright (C) 2025 Front Matter.

# base32-lib is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
# SPDX-FileCopyrightText: 2019 CERN.
# SPDX-FileCopyrightText: 2019 Northwestern University.
# SPDX-FileCopyrightText: 2025 Front Matter.
# SPDX-License-Identifier: MIT

"""Generate, encode and decode random base32 identifiers.

Expand Down
29 changes: 9 additions & 20 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
# -*- coding: utf-8 -*-
#
# This file is part of base32-lib
# Copyright (C) 2019 CERN.
# Copyright (C) 2019 Northwestern University,
# Galter Health Sciences Library & Learning Center.

# base32-lib is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
# SPDX-FileCopyrightText: 2019 CERN.
# SPDX-FileCopyrightText: 2019 Northwestern University,
# SPDX-License-Identifier: MIT

"""Sphinx configuration."""

from __future__ import print_function

import os

from base32_lib import __version__

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down Expand Up @@ -64,21 +57,15 @@
#
# The short X.Y version.

# Get the version string. Cannot be done with import!
g = {}
with open(os.path.join("..", "base32_lib", "version.py"), "rt") as fp:
exec(fp.read(), g)
version = g["__version__"]

# The full version, including alpha/beta/rc tags.
release = version
release = __version__

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = "en"

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
Expand Down Expand Up @@ -328,4 +315,6 @@


# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {"https://docs.python.org/": None}
intersphinx_mapping = {
"python": ("https://docs.python.org/", None),
}
9 changes: 3 additions & 6 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
..
This file is part of base32-lib
Copyright (C) 2019 CERN.
Copyright (C) 2019 Northwestern University.

base32-lib is free software; you can redistribute it and/or modify it
under the terms of the MIT License; see LICENSE file for more details.
SPDX-FileCopyrightText: 2019 CERN.
SPDX-FileCopyrightText: 2019 Northwestern University.
SPDX-License-Identifier: MIT

.. currentmodule:: base32-lib

Expand Down
15 changes: 5 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
# -*- coding: utf-8 -*-
#
# This file is part of base32-lib
# Copyright (C) 2019 CERN.
# Copyright (C) 2019 Northwestern University.
# Copyright (C) 2025 Front Matter.

# base32-lib is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
# SPDX-FileCopyrightText: 2019 CERN.
# SPDX-FileCopyrightText: 2019 Northwestern University.
# SPDX-FileCopyrightText: 2025 Front Matter.
# SPDX-License-Identifier: MIT

[build-system]
requires = ["setuptools>=61", "wheel"]
Expand All @@ -17,7 +12,7 @@ name = "base32-lib"
dynamic = ["version"]
description = "Small library to generate, encode and decode random base32 strings."
readme = "README.rst"
requires-python = ">=3.10"
requires-python = ">=3.8"
license = { text = "MIT License" }
authors = [{ name = "Invenio Software", email = "info@inveniosoftware.org" }]
keywords = ["base32", "identifiers"]
Expand Down
49 changes: 36 additions & 13 deletions run-tests.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,37 @@
#!/bin/sh
#!/usr/bin/env bash
# SPDX-FileCopyrightText: 2019-2021 CERN.
# SPDX-FileCopyrightText: 2019-2020 Northwestern University.
# SPDX-FileCopyrightText: 2021-2026 TU Wien.
# SPDX-FileCopyrightText: 2022 Graz University of Technology.
# SPDX-License-Identifier: MIT
#
# This file is part of base32-lib
# Copyright (C) 2019 CERN.
# Copyright (C) 2019 Northwestern University.

# base32-lib is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.

pydocstyle base32-lib tests && \
isort --recursive --check-only --diff **/*.py && \
check-manifest --ignore ".travis-*" && \
sphinx-build -qnNW docs docs/_build/html && \
python setup.py test
# Usage:
# ./run-tests.sh [pytest options and args...]

# Quit on errors
set -o errexit

# Quit on unbound symbols
set -o nounset

# Check for arguments
# Note: "-k" would clash with "pytest"
pytest_args=()
for arg in $@; do
# from the CLI args, filter out some known values and forward the rest to "pytest"
# note: we don't use "getopts" here b/c of some limitations (e.g. long options),
# which means that we can't combine short options (e.g. "./run-tests -Kk pattern")
case ${arg} in
*)
pytest_args+=( ${arg} )
;;
esac
done

python -m check_manifest
python -m sphinx.cmd.build -qnN docs docs/_build/html
# Note: expansion of pytest_args looks like below to not cause an unbound
# variable error when 1) "nounset" and 2) the array is empty.
python -m pytest ${pytest_args[@]+"${pytest_args[@]}"}
tests_exit_code=$?
exit "$tests_exit_code"
12 changes: 3 additions & 9 deletions tests/test_base32.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
# -*- coding: utf-8 -*-
#
# This file is part of base32-lib
# Copyright (C) 2019 CERN.
# Copyright (C) 2019 Northwestern University,
# Galter Health Sciences Library & Learning Center.

# base32-lib is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
# SPDX-FileCopyrightText: 2019 CERN.
# SPDX-FileCopyrightText: 2019 Northwestern University,
# SPDX-License-Identifier: MIT

"""Provider tests."""

Expand Down
Loading