Skip to content

Commit

Permalink
Quick logging fix for v0.28.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleysommer committed Oct 25, 2024
1 parent 1af1b71 commit 5a2b5f8
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 12 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Python PEP 440 Versioning](https://www.python.org/d
## [Unreleased]
- Nothing yet

## [0.28.1] - 2024-10-25

### Fixed
- PySHACL no longer overwrites the Python `root` logger and removes all its handlers. How Rude.

## [0.28.0] - 2024-10-23
### Added
- owl:imports now works with bnode values, where it contains the following:
Expand Down Expand Up @@ -1177,7 +1182,8 @@ just leaves the files open. Now it is up to the command-line client to close the

- Initial version, limited functionality

[Unreleased]: https://github.com/RDFLib/pySHACL/compare/v0.28.0...HEAD
[Unreleased]: https://github.com/RDFLib/pySHACL/compare/v0.28.1...HEAD
[0.28.1]: https://github.com/RDFLib/pySHACL/compare/v0.28.0...v0.28.1
[0.28.0]: https://github.com/RDFLib/pySHACL/compare/v0.27.0...v0.28.0
[0.27.0]: https://github.com/RDFLib/pySHACL/compare/v0.26.0...v0.27.0
[0.26.0]: https://github.com/RDFLib/pySHACL/compare/v0.25.0...v0.26.0
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ authors:
given-names: "Nicholas"
orcid: "http://orcid.org/0000-0002-8742-7730"
title: "pySHACL"
version: 0.28.0
version: 0.28.1
doi: 10.5281/zenodo.4750840
license: Apache-2.0
date-released: 2022-01-13
date-released: 2024-10-25
url: "https://github.com/RDFLib/pySHACL"
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ WORKDIR /home/pyshacl
RUN addgroup -g 1000 -S pyshacl &&\
adduser --disabled-password --gecos "" --home "$(pwd)" --ingroup "pyshacl" --no-create-home --uid 1000 pyshacl
WORKDIR /app
LABEL org.opencontainers.image.version="0.28.0"
LABEL org.opencontainers.image.version="0.28.1"
COPY . .
RUN chown -R pyshacl:pyshacl /home/pyshacl /app && chmod -R 775 /home/pyshacl /app
USER pyshacl
ENV PATH="/home/pyshacl/.local/bin:$PATH"
RUN pip3 install "poetry>=1.8.3,<2.0"
RUN pip3 install "poetry>=1.8.4,<2.0"
RUN poetry install --no-dev --extras "js http"
USER root
RUN apk del build-dependencies
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ requires-python = ">=3.8.1"

[tool.poetry]
name = "pyshacl"
version = "0.28.0"
version = "0.28.1"
# Don't forget to change the version number in __init__.py, Dockerfile, and CITATION.cff along with this one
description = "Python SHACL Validator"
license = "Apache-2.0"
Expand Down Expand Up @@ -211,7 +211,7 @@ toxworkdir={env:TOX_WORK_DIR:.tox}
[testenv]
deps =
poetry>=1.8.2
poetry>=1.8.4
passenv =
DBUS_SESSION_BUS_ADDRESS
PIP_KEYRING_PROVIDER
Expand Down
2 changes: 1 addition & 1 deletion pyshacl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from .validator import Validator

# version compliant with https://www.python.org/dev/peps/pep-0440/
__version__ = '0.28.0'
__version__ = '0.28.1'
# Don't forget to change the version number in pyproject.toml, Dockerfile, and CITATION.cff along with this one

__all__ = ['validate', 'shacl_rules', 'Validator', 'RuleExpandRunner', '__version__', 'Shape', 'ShapesGraph']
9 changes: 5 additions & 4 deletions pyshacl/entrypoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,12 @@ def meta_validate(shacl_graph: Union[GraphLike, str], inference: Optional[str] =
return validate(shacl_graph, shacl_graph=shacl_shacl_graph, inference=inference, **kwargs)


def make_default_logger(name: Union[str, None] = None, debug: bool = False) -> logging.Logger:
def make_default_logger(name: Union[str, None] = None, debug: bool = False, clear_handlers: bool = True) -> logging.Logger:
log_handler = logging.StreamHandler(stderr)
log = logging.getLogger()
for h in log.handlers:
log.removeHandler(h) # pragma:no cover
log = logging.getLogger(name)
if clear_handlers:
for h in log.handlers:
log.removeHandler(h) # pragma:no cover
log.addHandler(log_handler)
log.setLevel(logging.INFO if not debug else logging.DEBUG)
log_handler.setLevel(logging.INFO if not debug else logging.DEBUG)
Expand Down

0 comments on commit 5a2b5f8

Please sign in to comment.