Skip to content

Commit

Permalink
Merge branch 'release/1.7.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
RazerM committed Oct 3, 2023
2 parents 2cd4675 + a42fdb0 commit e339dc1
Show file tree
Hide file tree
Showing 21 changed files with 430 additions and 272 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
open-pull-requests-limit: 1024
20 changes: 13 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: "actions/checkout@v3"
- uses: "actions/checkout@v4"
- uses: "actions/setup-python@v4"
with:
python-version: "${{ matrix.python-version }}"
cache: pip
allow-prereleases: true
- name: "Install dependencies"
run: |
set -xe
Expand All @@ -52,18 +54,20 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
arch: ["x86", "x64"]

env:
ENABLE_LOGBOOK_NTEVENTLOG_TESTS: "1"

steps:
- uses: "actions/checkout@v3"
- uses: "actions/checkout@v4"
- uses: "actions/setup-python@v4"
with:
python-version: "${{ matrix.python-version }}"
architecture: "${{ matrix.arch }}"
cache: pip
allow-prereleases: true

- run: python -VV
- run: python -m site
Expand All @@ -80,14 +84,16 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: "actions/checkout@v3"
- uses: "actions/checkout@v4"
- uses: "actions/setup-python@v4"
with:
python-version: "${{ matrix.python-version }}"
architecture: "${{ matrix.arch }}"
cache: pip
allow-prereleases: true
- name: "Install dependencies"
run: |
set -xe
Expand All @@ -102,6 +108,6 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: pre-commit/action@v3.0.0
6 changes: 3 additions & 3 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
id-token: write
steps:
- name: Download artifacts
uses: dawidd6/action-download-artifact@246dbf436b23d7c49e21a7ab8204ca9ecd1fe615 # v2.27.0
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e # v2.28.0
with:
path: artifacts/
run_id: ${{ github.event.inputs.run_id || github.event.workflow_run.id }}
Expand All @@ -42,13 +42,13 @@ jobs:
mv artifacts/wheels/*.whl dist/
- name: Publish to pypi.org
uses: pypa/gh-action-pypi-publish@f8c70e705ffc13c3b4d1221169b84f12a75d6ca8 # v1.8.8
uses: pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e # v1.8.10
if: github.event_name == 'workflow_run' || (github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'pypi')
with:
packages-dir: dist/

- name: Publish to test.pypi.org
uses: pypa/gh-action-pypi-publish@f8c70e705ffc13c3b4d1221169b84f12a75d6ca8 # v1.8.8
uses: pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e # v1.8.10
if: github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'testpypi'
with:
repository-url: https://test.pypi.org/legacy/
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/wheel-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
name: Build sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
# The tag to build or the tag received by the tag event
ref: ${{ github.event.inputs.version || github.ref }}
Expand All @@ -36,7 +36,7 @@ jobs:
run: .venv/bin/pip install -U pip build
- name: Make sdist
run: .venv/bin/python -m build --sdist
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: sdist
path: dist/*.tar.gz
Expand All @@ -50,16 +50,16 @@ jobs:
os: [ubuntu-20.04, windows-2019, macos-11]

steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
# The tag to build or the tag received by the tag event
ref: ${{ github.event.inputs.version || github.ref }}
persist-credentials: false

- name: Build wheels
uses: pypa/cibuildwheel@f21bb8376a051ffb6cb5604b28ccaef7b90e8ab7 # v2.14.1
uses: pypa/cibuildwheel@7da7df1efc530f07d1945c00934b8cfd34be0d50 # v2.16.1

- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: wheels
path: ./wheelhouse/*.whl
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ repos:
rev: v3.7.0
hooks:
- id: pyupgrade
args: [--py37-plus]
args: [--py38-plus]
- repo: https://github.com/timothycrosley/isort
rev: 5.12.0
hooks:
Expand Down
10 changes: 10 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
Logbook Changelog
=================

Version 1.7.0
-------------

Released on October 3rd, 2023

- Dropped support for Python 3.7
- Passing (keyfile, certfile) to MailHandler's ``secure`` argument is deprecated
in favour of passing an ``ssl.SSLContext``.
- Python 3.12 support

Version 1.6.0
-------------

Expand Down
7 changes: 1 addition & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

import sys

if sys.version_info < (3, 8):
from importlib_metadata import distribution
else:
from importlib.metadata import distribution
from importlib.metadata import distribution

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
Expand Down
16 changes: 13 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ maintainers = [
]
classifiers = [
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
requires-python = ">=3.7"
requires-python = ">=3.8"
dynamic = ["version"]

[project.urls]
Expand All @@ -40,7 +40,17 @@ jinja = ["Jinja2"]
compression = ["brotli"]
all = ["Logbook[execnet,sqlalchemy,redis,zmq,jinja,compression,nteventlog]"]
nteventlog = ["pywin32; platform_system == 'Windows'"]
docs = ["Sphinx", "importlib_metadata; python_version < '3.8'"]
docs = ["Sphinx"]

[tool.setuptools.dynamic]
version = { attr = "logbook.__version__" }

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

[tool.setuptools.packages.find]
where = ["src"]
namespaces = false

[tool.pytest.ini_options]
testpaths = ["tests"]
Expand Down
11 changes: 0 additions & 11 deletions setup.cfg

This file was deleted.

2 changes: 1 addition & 1 deletion src/logbook/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.6.0"
__version__ = "1.7.0"
20 changes: 14 additions & 6 deletions src/logbook/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
from weakref import ref as weakref

from logbook.concurrency import greenlet_get_ident, thread_get_ident, thread_get_name
from logbook.helpers import cached_property, parse_iso8601, to_safe_json
from logbook.helpers import (
cached_property,
datetime_utcnow,
parse_iso8601,
to_safe_json,
)

_has_speedups = False
try:
Expand All @@ -39,7 +44,7 @@
group_reflected_property,
)

_datetime_factory = datetime.utcnow
_datetime_factory = datetime_utcnow


def set_datetime_format(datetime_format):
Expand Down Expand Up @@ -94,7 +99,7 @@ def utc_tz():
"""
global _datetime_factory
if datetime_format == "utc":
_datetime_factory = datetime.utcnow
_datetime_factory = datetime_utcnow
elif datetime_format == "local":
_datetime_factory = datetime.now
elif callable(datetime_format):
Expand Down Expand Up @@ -142,13 +147,16 @@ def level_name_property():
the internal level attribute.
"""

def _get_level_name(self):
@property
def level_name(self):
"""The level as unicode string"""
return get_level_name(self.level)

def _set_level_name(self, level):
@level_name.setter
def level_name(self, level):
self.level = lookup_level(level)

return property(_get_level_name, _set_level_name, doc="The level as unicode string")
return level_name


def lookup_level(level):
Expand Down

0 comments on commit e339dc1

Please sign in to comment.