Skip to content
Open
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
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "python -m pip install -U pip setuptools wheel scikit-build pytest && python setup.py build_ext --inplace --build Debug",
"postCreateCommand": "python -m pip install -U pip setuptools wheel pytest && pip install -e . --config-settings=cmake.build-type=\"Debug\"",

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/hypothesis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:
- uses: actions/checkout@v4
- name: Install requirements and package
run: |
python -m pip install -U scikit-build
python -m pip install -v .

- name: Run pytest on hypothesis tests
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ jobs:
- name: Install requirements and package
run: |
python -m pip install -U pip
python -m pip install scikit-build
python -m pip install -v .
- name: Setup Pages
uses: actions/configure-pages@v4
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,10 @@ jobs:
# Using 'latest' branch, the most recent CMake and ninja are installed.
uses: lukka/get-cmake@latest
- name: Install dependencies
run: python -m pip install -U pip setuptools wheel scikit-build ninja cmake pytest gcovr pytest-cov
run: python -m pip install -U pip setuptools wheel pytest gcovr pytest-cov
- name: Run Coverage
run: |
python -m pip install -v -e .
python setup.py build_ext --inplace --build-type Debug -DCOVERAGE=ON
python -m pip install -v -e . --config-settings=cmake.args=-DCOVERAGE=ON;
python -m pytest --cov=src tests
coverage xml -o coverage_python.xml
gcov _skbuild/linux-x86_64-3.10/cmake-build/CMakeFiles/_picologging.dir/src/picologging/*.gcda
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ jobs:
- uses: actions/checkout@v4
- name: Install requirements and package
run: |
python -m pip install -U scikit-build
python -m pip install -v .[dev]
python -m pip install -v .[dev]

- name: Run pytest
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
matrix:
# macos-13 is an intel runner, macos-14 is apple silicon
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-13, macos-14]
os: [ubuntu-latest, windows-latest, macos-14]

steps:
- uses: actions/checkout@v4
Expand Down
11 changes: 5 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.4...3.22)
cmake_minimum_required(VERSION 3.15...3.30)

option(COVERAGE "Enable coverage reporting" OFF)
option(CACHE_FILEPATH "Enable cache filepath" ON)
project(picologging)
project(${SKBUILD_PROJECT_NAME})

find_package(PythonExtensions REQUIRED)
find_package(Python COMPONENTS Interpreter Development.Module REQUIRED)

add_library(_picologging MODULE src/picologging/_picologging.cxx src/picologging/logrecord.cxx src/picologging/formatstyle.cxx src/picologging/formatter.cxx src/picologging/logger.cxx src/picologging/handler.cxx src/picologging/filterer.cxx src/picologging/streamhandler.cxx src/picologging/filepathcache.cxx)
python_add_library(_picologging MODULE WITH_SOABI src/picologging/_picologging.cxx src/picologging/logrecord.cxx src/picologging/formatstyle.cxx src/picologging/formatter.cxx src/picologging/logger.cxx src/picologging/handler.cxx src/picologging/filterer.cxx src/picologging/streamhandler.cxx src/picologging/filepathcache.cxx)

if (MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++latest")
Expand Down Expand Up @@ -44,5 +44,4 @@ if(FUZZING)
target_link_options(_picologging PRIVATE -fsanitize=address,fuzzer)
endif(FUZZING)

python_extension_module(_picologging)
install(TARGETS _picologging LIBRARY DESTINATION src/picologging)
install(TARGETS _picologging LIBRARY DESTINATION ${SKBUILD_PROJECT_NAME})
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ This project comes bundled with a dev container which sets up an appropriate env
Once opened in the dev container, run:

```console
pip install -e ".[dev]"
pre-commit install
python setup.py build_ext --inplace --build-type Debug
pip install -e ".[dev]" --config-settings=cmake.build-type="Debug"
```

Run the build command whenever you make changes to the files.
Expand Down
61 changes: 56 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,62 @@
[build-system]
requires = [
"setuptools>=65.4.1",
"scikit-build>=0.18.0",
"cmake>=3.18",
"ninja",
"scikit-build-core"
]
build-backend = "setuptools.build_meta"
build-backend = "scikit_build_core.build"

[project]
name = "picologging"
version = "0.9.5"
description = "A fast and lightweight logging library for Python"
readme = "README.md"
license = {text = "MIT License"}
authors = [
{name = "Microsoft"}
]
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Topic :: System :: Logging",
"Programming Language :: Python :: Implementation :: CPython",
"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",
"Programming Language :: Python :: 3.13",
]
requires-python = ">=3.8"
dependencies = []

[project.optional-dependencies]
dev = [
"rich",
"pytest",
"pytest-cov",
"hypothesis",
"flaky",
"black",
"pre-commit",
]
memray = [
"memray>=1.10.0",
"pytest-memray>=1.5.0",
]

[project.urls]
Homepage = "https://github.com/microsoft/picologging"
Source = "https://github.com/microsoft/picologging"
Documentation = "https://microsoft.github.io/picologging/"

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

[tool.setuptools.package-data]
picologging = ["py.typed", "__init__.pyi", "config.pyi", "handlers.pyi"]

[tool.cibuildwheel]
# skip musl and pypy
Expand All @@ -28,4 +79,4 @@ archs = ["x86", "AMD64", "ARM64"]
disable = "C0114,C0115,C0116"

[tool.isort]
profile = "black"
profile = "black"
58 changes: 0 additions & 58 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/picologging/handlers.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class QueueListener:
self,
queue: SimpleQueue[Any] | Queue[Any],
*handlers: Handler,
respect_handler_level: bool = ...
respect_handler_level: bool = ...,
) -> None: ...
def dequeue(self, block: bool) -> LogRecord: ...
def prepare(self, record: LogRecord) -> Any: ...
Expand Down
Loading