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
34 changes: 34 additions & 0 deletions .github/workflows/various_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "Various Checks [for now: just type check]"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.15-dev"

steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: dev/dev-requirements.txt
- name: Install "for development", with "dev" dependencies
run: |
./dev-install.bash
- name: Type check with mypy
run: |
./dev/venv/bin/python3 -m mypy -p certlib.log
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ library by running (typically, in a [*virtual environment*](https://packaging.py
the command: **`python3 -m pip install certlib.log`**

The library is compatible with Python 3.10 and all newer versions of
Python. It makes use *only* of the Python's standard library, i.e.,
it **does *not* depend on any third-party packages**.
Python. It uses *only* the Python's standard library, i.e., it **does
*not* depend on any third-party packages**.


## Examples
Expand Down Expand Up @@ -90,8 +90,8 @@ def example_with_text_message_formatting(city, humidity, error_summary=None):
'Today is day #{today:%j} of the year {today:%Y}',
today=dt.date.today(),

# (arbitrary data items can be given, which this is especially
# useful when `certlib.log.StructuredLogsFormatter` is in use)
# (arbitrary data items can be given, which is especially useful
# when `certlib.log.StructuredLogsFormatter` is in use)
some_extra_item=42,
other_arbitrary_stuff={'foo': [
{'my-ip': ipaddress.IPv4Address('192.168.0.1')},
Expand Down
7 changes: 4 additions & 3 deletions dev-install.bash
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ python3 -m pip install --upgrade --require-virtualenv --use-pep517 pip 2>/dev/nu

echo "Activating the '${CERTLIB_LOG_DEV_VENV_DIR}' virtual environment..."
source "${CERTLIB_LOG_DEV_VENV_DIR}/bin/activate" || exit 1
echo "OK, "${CERTLIB_LOG_DEV_VENV_DIR}" activated."
echo "OK, ${CERTLIB_LOG_DEV_VENV_DIR} activated."
python3 -m pip install --upgrade --require-virtualenv --use-pep517 pip || exit 1
}
[[ "$?" != 0 ]] && exit 1
Expand All @@ -43,8 +43,9 @@ else
fi

echo "** BUT PLEASE NOTE that it is a *development*-only installation" \
"(e.g., for running tests with 'pytest', or building docs with" \
"'mkdocs build -f docs/mkdocs.yml')."
"(just for running tests with 'pytest', or building docs with" \
"'mkdocs build -f docs/mkdocs.yml', or performing type check" \
"with 'mypy -p certlib.log --strict', etc.)."

if [[ -v CERTLIB_LOG_DEV_VENV_DIR ]]; then
echo "**** ALSO, PLEASE NOTE that to run/import the installed stuff" \
Expand Down
6 changes: 3 additions & 3 deletions dev-regen.bash
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash

# We want to use the oldest supported version of Python:
# We want to use the oldest version of Python supported by us:
CERTLIB_LOG_DEV_REQ_REGEN_PYTHON=python3.10
CERTLIB_LOG_DEV_REQ_REGEN_VENV_DIR='./dev/.venv-temporary-for-req-regen'
if [[ -n "$@" ]]; then
CERTLIB_LOG_DEV_REQ_REGEN_ARGS_ANNOTATION=" (passing to pip-compile the extra argument(s): $@)"
if [[ -n "$*" ]]; then
CERTLIB_LOG_DEV_REQ_REGEN_ARGS_ANNOTATION=" (passing to pip-compile the extra argument(s): $*)"
else
CERTLIB_LOG_DEV_REQ_REGEN_ARGS_ANNOTATION=""
fi
Expand Down
1 change: 1 addition & 0 deletions dev/dev-requirements.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
-r ../docs/doc-requirements.txt
-r ../tests/test-requirements.txt
build
mypy
pip
pip-tools
setuptools>=80
Expand Down
8 changes: 8 additions & 0 deletions dev/dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ jinja2==3.1.6
# mkdocs
# mkdocs-material
# mkdocstrings
librt==0.8.1
# via mypy
markdown==3.10.2
# via
# -r ../docs/doc-requirements.txt
Expand Down Expand Up @@ -109,10 +111,13 @@ mkdocstrings==1.0.3
# mkdocstrings-python
mkdocstrings-python==2.0.3
# via -r ../docs/doc-requirements.txt
mypy==1.20.0
# via -r dev-requirements.in
mypy-extensions==1.1.0
# via
# -r ../docs/doc-requirements.txt
# black
# mypy
packaging==26.0
# via
# -r ../docs/doc-requirements.txt
Expand All @@ -133,6 +138,7 @@ pathspec==1.0.4
# -r ../docs/doc-requirements.txt
# black
# mkdocs
# mypy
pip-tools==7.5.3
# via -r dev-requirements.in
platformdirs==4.9.4
Expand Down Expand Up @@ -196,6 +202,7 @@ tomli==2.4.1
# -r ../tests/test-requirements.txt
# black
# build
# mypy
# pip-tools
# pytest
# setuptools-scm
Expand All @@ -207,6 +214,7 @@ typing-extensions==4.15.0
# black
# exceptiongroup
# mkdocstrings-python
# mypy
# setuptools-scm
# vcs-versioning
urllib3==2.6.3
Expand Down
10 changes: 10 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,13 @@ where = ["src"]
[tool.setuptools.dynamic.optional-dependencies.dev]

file = ["dev/dev-requirements.txt"]


#
# Settings for other tools
#


[tool.mypy]

strict = true
Loading