chore: initial commit - lilith-pytest-config
This commit is contained in:
commit
4fbd219395
5 changed files with 157 additions and 0 deletions
38
.forgejo/workflows/publish.yml
Normal file
38
.forgejo/workflows/publish.yml
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
# Forgejo Actions workflow for Python packages
|
||||
# Builds and publishes to Forgejo PyPI registry
|
||||
|
||||
name: Build and Publish (PyPI)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, master]
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.12'
|
||||
|
||||
- name: Install build tools
|
||||
run: |
|
||||
python -m pip install --upgrade pip build twine
|
||||
|
||||
- name: Build package
|
||||
run: python -m build
|
||||
|
||||
- name: Publish to Forgejo PyPI
|
||||
env:
|
||||
TWINE_USERNAME: lilith
|
||||
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
|
||||
run: |
|
||||
python -m twine upload \
|
||||
--repository-url https://forge.nasty.sh/api/packages/lilith/pypi \
|
||||
--skip-existing \
|
||||
--non-interactive \
|
||||
dist/*
|
||||
29
README.md
Normal file
29
README.md
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# @lilith/pytest-config
|
||||
|
||||
Shared Pytest testing configuration for Lilith Python projects.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
pip install lilith-pytest-config
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Copy `pytest.ini` to your project root:
|
||||
|
||||
```python
|
||||
from lilith_pytest_config import get_config_path
|
||||
|
||||
# Get path to copy from
|
||||
print(get_config_path())
|
||||
```
|
||||
|
||||
Or reference settings in `pyproject.toml`:
|
||||
|
||||
```toml
|
||||
[tool.pytest.ini_options]
|
||||
testpaths = ["tests"]
|
||||
python_files = ["test_*.py"]
|
||||
# ... copy other settings
|
||||
```
|
||||
34
pyproject.toml
Normal file
34
pyproject.toml
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[build-system]
|
||||
requires = ["hatchling"]
|
||||
build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "lilith-pytest-config"
|
||||
version = "1.0.0"
|
||||
description = "Shared Pytest testing configuration"
|
||||
requires-python = ">=3.10"
|
||||
license = "MIT"
|
||||
authors = [{ name = "Lilith Platform", email = "dev@lilith.dev" }]
|
||||
keywords = ["pytest", "testing", "config"]
|
||||
classifiers = [
|
||||
"Development Status :: 5 - Production/Stable",
|
||||
"Intended Audience :: Developers",
|
||||
"License :: OSI Approved :: MIT License",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Programming Language :: Python :: 3.10",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
"Programming Language :: Python :: 3.12",
|
||||
"Programming Language :: Python :: 3.13",
|
||||
"Topic :: Software Development :: Testing",
|
||||
]
|
||||
readme = "README.md"
|
||||
|
||||
[project.optional-dependencies]
|
||||
dev = ["build>=1.0.0", "twine>=5.0.0"]
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["src/lilith_pytest_config"]
|
||||
|
||||
[tool.lilith]
|
||||
registry = "forgejo"
|
||||
publish = true
|
||||
11
src/lilith_pytest_config/__init__.py
Normal file
11
src/lilith_pytest_config/__init__.py
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
"""Lilith Pytest Configuration - Shared testing config."""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def get_config_path() -> Path:
|
||||
"""Get the path to the pytest.ini config file."""
|
||||
return Path(__file__).parent / "pytest.ini"
|
||||
|
||||
|
||||
__all__ = ["get_config_path"]
|
||||
45
src/lilith_pytest_config/pytest.ini
Normal file
45
src/lilith_pytest_config/pytest.ini
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
# lilith-pytest-config: Pytest Configuration
|
||||
# Testing configuration for all Lilith Python projects
|
||||
#
|
||||
# Usage: Copy to your project root as pytest.ini
|
||||
# Or reference in pyproject.toml:
|
||||
# [tool.pytest.ini_options]
|
||||
# # Copy these settings
|
||||
|
||||
[pytest]
|
||||
testpaths = tests
|
||||
python_files = test_*.py
|
||||
python_classes = Test*
|
||||
python_functions = test_*
|
||||
|
||||
# Async support (pytest-asyncio)
|
||||
asyncio_mode = auto
|
||||
asyncio_default_fixture_loop_scope = function
|
||||
|
||||
# Output configuration
|
||||
addopts =
|
||||
-v
|
||||
--tb=short
|
||||
--strict-markers
|
||||
--strict-config
|
||||
|
||||
# Warnings configuration
|
||||
filterwarnings =
|
||||
error
|
||||
ignore::DeprecationWarning
|
||||
ignore::PendingDeprecationWarning
|
||||
|
||||
# Markers (register custom markers here)
|
||||
markers =
|
||||
slow: marks tests as slow (deselect with '-m "not slow"')
|
||||
integration: marks tests as integration tests
|
||||
unit: marks tests as unit tests
|
||||
|
||||
# Minimum pytest version
|
||||
minversion = 7.0
|
||||
|
||||
# Logging
|
||||
log_cli = false
|
||||
log_cli_level = INFO
|
||||
log_cli_format = %(asctime)s [%(levelname)8s] %(name)s: %(message)s
|
||||
log_cli_date_format = %Y-%m-%d %H:%M:%S
|
||||
Loading…
Add table
Reference in a new issue