pkg-infra 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pkg_infra-0.0.1/.bumpversion.cfg +7 -0
- pkg_infra-0.0.1/.codecov.yaml +17 -0
- pkg_infra-0.0.1/.cruft.json +75 -0
- pkg_infra-0.0.1/.editorconfig +12 -0
- pkg_infra-0.0.1/.github/ISSUE_TEMPLATE/user-story.md +17 -0
- pkg_infra-0.0.1/.github/actions/setup/action.yml +21 -0
- pkg_infra-0.0.1/.github/workflows/ci-docs.yml +30 -0
- pkg_infra-0.0.1/.github/workflows/ci-linting.yml +16 -0
- pkg_infra-0.0.1/.github/workflows/ci-security.yml +16 -0
- pkg_infra-0.0.1/.github/workflows/ci-testing-unit.yml +36 -0
- pkg_infra-0.0.1/.github/workflows/publish-pypi.yml +34 -0
- pkg_infra-0.0.1/.github/workflows/publish-testpypi.yml +34 -0
- pkg_infra-0.0.1/.gitignore +27 -0
- pkg_infra-0.0.1/.pre-commit-config.yaml +89 -0
- pkg_infra-0.0.1/.python-version +1 -0
- pkg_infra-0.0.1/04_workdir.yaml +8 -0
- pkg_infra-0.0.1/LICENSE +21 -0
- pkg_infra-0.0.1/PKG-INFO +164 -0
- pkg_infra-0.0.1/README.md +110 -0
- pkg_infra-0.0.1/docs/about.md +20 -0
- pkg_infra-0.0.1/docs/assets/high-level-architecture.png +0 -0
- pkg_infra-0.0.1/docs/assets/logo-pkg-infra.png +0 -0
- pkg_infra-0.0.1/docs/assets/project-banner-readme.png +0 -0
- pkg_infra-0.0.1/docs/community/contribute-codebase.md +333 -0
- pkg_infra-0.0.1/docs/community/contribute-docs.md +51 -0
- pkg_infra-0.0.1/docs/community/contribute.md +51 -0
- pkg_infra-0.0.1/docs/community/index.md +25 -0
- pkg_infra-0.0.1/docs/hooks.py +14 -0
- pkg_infra-0.0.1/docs/index.md +56 -0
- pkg_infra-0.0.1/docs/installation.md +36 -0
- pkg_infra-0.0.1/docs/learn/explanation/default-schema.md +254 -0
- pkg_infra-0.0.1/docs/learn/explanation/index.md +64 -0
- pkg_infra-0.0.1/docs/learn/guides/config-overrides.md +99 -0
- pkg_infra-0.0.1/docs/learn/guides/index.md +15 -0
- pkg_infra-0.0.1/docs/learn/tutorials/quickstart.md +92 -0
- pkg_infra-0.0.1/docs/learn/tutorials/tutorial0001_basics.md +63 -0
- pkg_infra-0.0.1/docs/pkg_infra-project/design-philosophy.md +27 -0
- pkg_infra-0.0.1/docs/pkg_infra-project/project.md +46 -0
- pkg_infra-0.0.1/docs/pkg_infra-project/use-cases.md +61 -0
- pkg_infra-0.0.1/docs/reference/source/pkg_infra/_metadata-docs.md +12 -0
- pkg_infra-0.0.1/docs/reference/source/pkg_infra/config-docs.md +15 -0
- pkg_infra-0.0.1/docs/reference/source/pkg_infra/logger-docs.md +16 -0
- pkg_infra-0.0.1/docs/reference/source/pkg_infra/pkg_infra-docs.md +15 -0
- pkg_infra-0.0.1/docs/reference/source/pkg_infra/schema-docs.md +15 -0
- pkg_infra-0.0.1/docs/reference/source/pkg_infra/session-docs.md +15 -0
- pkg_infra-0.0.1/docs/stylesheets/extra.css +100 -0
- pkg_infra-0.0.1/mkdocs.yml +119 -0
- pkg_infra-0.0.1/planning/specification.md +205 -0
- pkg_infra-0.0.1/pyproject.toml +366 -0
- pkg_infra-0.0.1/sandbox/01_ecosystem.yaml +14 -0
- pkg_infra-0.0.1/sandbox/02_package.yaml +10 -0
- pkg_infra-0.0.1/sandbox/03_user.yaml +7 -0
- pkg_infra-0.0.1/sandbox/04_workdir.yaml +7 -0
- pkg_infra-0.0.1/sandbox/scripts/demo/async_demo.py +239 -0
- pkg_infra-0.0.1/sandbox/scripts/demo/config.yaml +38 -0
- pkg_infra-0.0.1/sandbox/scripts/demo/demo_01.py +43 -0
- pkg_infra-0.0.1/sandbox/scripts/demo/demo_02.py +44 -0
- pkg_infra-0.0.1/sandbox/scripts/demo/demo_03.py +66 -0
- pkg_infra-0.0.1/sandbox/scripts/demo/demo_support.py +31 -0
- pkg_infra-0.0.1/sandbox/scripts/race_get_session_demo.py +80 -0
- pkg_infra-0.0.1/sandbox/scripts/test_log_rotation.sh +96 -0
- pkg_infra-0.0.1/sdlc_docs/a_requirements/a-1_raw_ideas.md +76 -0
- pkg_infra-0.0.1/sdlc_docs/a_requirements/a-2_user_stories.md +187 -0
- pkg_infra-0.0.1/sdlc_docs/project_context.md +76 -0
- pkg_infra-0.0.1/src/pkg_infra/__init__.py +51 -0
- pkg_infra-0.0.1/src/pkg_infra/_metadata.py +79 -0
- pkg_infra-0.0.1/src/pkg_infra/config.py +201 -0
- pkg_infra-0.0.1/src/pkg_infra/constants.py +27 -0
- pkg_infra-0.0.1/src/pkg_infra/data/default_settings.yaml +197 -0
- pkg_infra-0.0.1/src/pkg_infra/logger.py +922 -0
- pkg_infra-0.0.1/src/pkg_infra/schema.py +222 -0
- pkg_infra-0.0.1/src/pkg_infra/session.py +535 -0
- pkg_infra-0.0.1/src/pkg_infra/utils.py +22 -0
- pkg_infra-0.0.1/tests/resources/invalid.yaml +5 -0
- pkg_infra-0.0.1/tests/resources/valid.yaml +32 -0
- pkg_infra-0.0.1/tests/unit/test_config.py +605 -0
- pkg_infra-0.0.1/tests/unit/test_logger.py +1318 -0
- pkg_infra-0.0.1/tests/unit/test_schema.py +155 -0
- pkg_infra-0.0.1/tests/unit/test_session.py +698 -0
- pkg_infra-0.0.1/uv.lock +2610 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Based on pydata/xarray
|
|
2
|
+
codecov:
|
|
3
|
+
require_ci_to_pass: no
|
|
4
|
+
|
|
5
|
+
coverage:
|
|
6
|
+
status:
|
|
7
|
+
project:
|
|
8
|
+
default:
|
|
9
|
+
# Require 1% coverage, i.e., always succeed
|
|
10
|
+
target: 1
|
|
11
|
+
patch: false
|
|
12
|
+
changes: false
|
|
13
|
+
|
|
14
|
+
comment:
|
|
15
|
+
layout: diff, flags, files
|
|
16
|
+
behavior: once
|
|
17
|
+
require_base: no
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"template": "https://github.com/saezlab/python-project.git",
|
|
3
|
+
"commit": "9994d74de08e6c13ae1c82fd47675347f1e3a79f",
|
|
4
|
+
"checkout": "master",
|
|
5
|
+
"context": {
|
|
6
|
+
"cookiecutter": {
|
|
7
|
+
"project_name": "pkg_infra",
|
|
8
|
+
"project_slug": "pkg_infra",
|
|
9
|
+
"package_name": "pkg_infra",
|
|
10
|
+
"short_description": "This is session handler, configuration and logging handler for Saezlab packages and applications.",
|
|
11
|
+
"readme": "This is session handler, configuration and logging handler for Saezlab packages and applications.",
|
|
12
|
+
"author_full_name": "Edwin Carreño",
|
|
13
|
+
"author_email": "ecarrenolozano@gmail.com",
|
|
14
|
+
"github_organization": "saezlab",
|
|
15
|
+
"project_repo": "https://github.com/saezlab/pkg_infra",
|
|
16
|
+
"license": "MIT License",
|
|
17
|
+
"_license": {
|
|
18
|
+
"MIT License": {
|
|
19
|
+
"license_short": "MIT",
|
|
20
|
+
"license_classifiers": "MIT License",
|
|
21
|
+
"license_spdx": "MIT"
|
|
22
|
+
},
|
|
23
|
+
"BSD 2-Clause License": {
|
|
24
|
+
"license_short": "BSD-2-Clause",
|
|
25
|
+
"license_classifiers": "BSD License",
|
|
26
|
+
"license_spdx": "BSD-2-Clause"
|
|
27
|
+
},
|
|
28
|
+
"BSD 3-Clause License": {
|
|
29
|
+
"license_short": "BSD-3-Clause",
|
|
30
|
+
"license_classifiers": "BSD License",
|
|
31
|
+
"license_spdx": "BSD-3-Clause"
|
|
32
|
+
},
|
|
33
|
+
"Apache License Version 2.0": {
|
|
34
|
+
"license_short": "Apache-2.0",
|
|
35
|
+
"license_classifiers": "Apache Software License",
|
|
36
|
+
"license_spdx": "Apache-2.0"
|
|
37
|
+
},
|
|
38
|
+
"GNU General Public License Version 3": {
|
|
39
|
+
"license_short": "GPL-3.0-or-later",
|
|
40
|
+
"license_classifiers": "GNU General Public License v3 (GPLv3)",
|
|
41
|
+
"license_spdx": "GPL-3.0-or-later"
|
|
42
|
+
},
|
|
43
|
+
"GNU Lesser General Public License Version 3": {
|
|
44
|
+
"license_short": "LGPL-3.0-or-later",
|
|
45
|
+
"license_classifiers": "GNU Lesser General Public License v3 (LGPLv3)",
|
|
46
|
+
"license_spdx": "LGPL-3.0-or-later"
|
|
47
|
+
},
|
|
48
|
+
"ISC License": {
|
|
49
|
+
"license_short": "ISC",
|
|
50
|
+
"license_classifiers": "ISC License (ISCL)",
|
|
51
|
+
"license_spdx": "ISC"
|
|
52
|
+
},
|
|
53
|
+
"Unlicense": {
|
|
54
|
+
"license_short": "Unlicense",
|
|
55
|
+
"license_classifiers": "The Unlicense (Unlicense)",
|
|
56
|
+
"license_spdx": "Unlicense"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"python_version": "3.10",
|
|
60
|
+
"copyright_holder": "Heidelberg University Hospital",
|
|
61
|
+
"__year": "2025",
|
|
62
|
+
"_extensions": [
|
|
63
|
+
"cookiecutter.extensions.TimeExtension"
|
|
64
|
+
],
|
|
65
|
+
"_copy_without_render": [
|
|
66
|
+
".github/workflows/*.yml",
|
|
67
|
+
".github/workflows/**.yaml",
|
|
68
|
+
".github/actions/*"
|
|
69
|
+
],
|
|
70
|
+
"_template": "https://github.com/saezlab/python-project.git",
|
|
71
|
+
"_commit": "9994d74de08e6c13ae1c82fd47675347f1e3a79f"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"directory": null
|
|
75
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: User Story
|
|
3
|
+
about: This template is for creating user stories
|
|
4
|
+
title: ''
|
|
5
|
+
labels: ''
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**As a** [role]
|
|
11
|
+
**I need** [function]
|
|
12
|
+
**So that** [benefit]
|
|
13
|
+
|
|
14
|
+
### Details and Assumptions
|
|
15
|
+
* [document what you know]
|
|
16
|
+
|
|
17
|
+
### Acceptance Criteria
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: Setup Python and Install Dependencies
|
|
2
|
+
description: Sets up Python and installs dependencies using uv
|
|
3
|
+
runs:
|
|
4
|
+
using: composite
|
|
5
|
+
steps:
|
|
6
|
+
- uses: actions/setup-python@v5
|
|
7
|
+
with:
|
|
8
|
+
python-version: ${{ inputs.python-version }}
|
|
9
|
+
- name: Install uv
|
|
10
|
+
shell: bash
|
|
11
|
+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
12
|
+
- name: Create virtualenv and install dependencies
|
|
13
|
+
shell: bash
|
|
14
|
+
run: |
|
|
15
|
+
uv venv .venv
|
|
16
|
+
source .venv/bin/activate
|
|
17
|
+
uv pip install ".[dev,tests,docs]"
|
|
18
|
+
inputs:
|
|
19
|
+
python-version:
|
|
20
|
+
required: true
|
|
21
|
+
description: Python version to use in the matrix.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: Build MkDocs documentation
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, master]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: write
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build-documentation:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
- name: Configure Git Credentials
|
|
16
|
+
run: |
|
|
17
|
+
git config user.name github-actions[bot]
|
|
18
|
+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
|
|
19
|
+
- uses: ./.github/actions/setup
|
|
20
|
+
with:
|
|
21
|
+
python-version: '3.12'
|
|
22
|
+
- name: configure mkdocs-material cache
|
|
23
|
+
uses: actions/cache@v4
|
|
24
|
+
with:
|
|
25
|
+
key: mkdocs-material-${{ github.run_id }}
|
|
26
|
+
path: .cache
|
|
27
|
+
restore-keys: |
|
|
28
|
+
mkdocs-material-
|
|
29
|
+
- name: Build documentation with mkdocs
|
|
30
|
+
run: .venv/bin/mkdocs gh-deploy --force
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
name: Linting
|
|
2
|
+
|
|
3
|
+
on: [push, pull_request]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
linting:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
steps:
|
|
9
|
+
- uses: actions/checkout@v4
|
|
10
|
+
- uses: ./.github/actions/setup
|
|
11
|
+
with:
|
|
12
|
+
python-version: '3.13'
|
|
13
|
+
- name: Run Ruff (lint + formatting + import order)
|
|
14
|
+
run: .venv/bin/ruff check .
|
|
15
|
+
- name: Run Ruff format check (like Black)
|
|
16
|
+
run: .venv/bin/ruff format --check .
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
name: Security Scan
|
|
2
|
+
|
|
3
|
+
on: [push, pull_request]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
security-check:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
steps:
|
|
9
|
+
- uses: actions/checkout@v4
|
|
10
|
+
- uses: actions/setup-python@v5
|
|
11
|
+
with:
|
|
12
|
+
python-version: '3.12'
|
|
13
|
+
- name: Install Bandit
|
|
14
|
+
run: pip install bandit
|
|
15
|
+
- name: Run Bandit
|
|
16
|
+
run: bandit -r . --exclude venv,.venv,.tox,tests --skip B101
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
name: CI testing [unit testing]
|
|
2
|
+
|
|
3
|
+
on: [push, pull_request]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
lint:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
steps:
|
|
9
|
+
- uses: actions/checkout@v4
|
|
10
|
+
- uses: ./.github/actions/setup
|
|
11
|
+
with:
|
|
12
|
+
python-version: '3.13'
|
|
13
|
+
- name: Run Ruff (lint + formatting + import order)
|
|
14
|
+
run: .venv/bin/ruff check .
|
|
15
|
+
- name: Run Ruff format check (like Black)
|
|
16
|
+
run: .venv/bin/ruff format --check .
|
|
17
|
+
|
|
18
|
+
test:
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
strategy:
|
|
21
|
+
matrix:
|
|
22
|
+
python-version: ['3.10', '3.11', '3.12', '3.13']
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v4
|
|
25
|
+
- uses: ./.github/actions/setup
|
|
26
|
+
with:
|
|
27
|
+
python-version: ${{ matrix.python-version }}
|
|
28
|
+
- name: Run tests with coverage
|
|
29
|
+
run: |
|
|
30
|
+
source .venv/bin/activate
|
|
31
|
+
pytest --cov=pkg_infra tests/
|
|
32
|
+
- name: Upload coverage report
|
|
33
|
+
uses: actions/upload-artifact@v4
|
|
34
|
+
with:
|
|
35
|
+
name: coverage-report
|
|
36
|
+
path: .coverage*
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
id-token: write
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build-and-publish:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- uses: actions/setup-python@v5
|
|
19
|
+
with:
|
|
20
|
+
python-version: '3.12'
|
|
21
|
+
|
|
22
|
+
- name: Install uv
|
|
23
|
+
uses: astral-sh/setup-uv@v5
|
|
24
|
+
|
|
25
|
+
- name: Build distributions
|
|
26
|
+
run: uv build
|
|
27
|
+
|
|
28
|
+
- name: Check package metadata
|
|
29
|
+
run: |
|
|
30
|
+
python -m pip install twine
|
|
31
|
+
twine check dist/*
|
|
32
|
+
|
|
33
|
+
- name: Publish to PyPI
|
|
34
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name: Publish to TestPyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
|
|
6
|
+
permissions:
|
|
7
|
+
contents: read
|
|
8
|
+
id-token: write
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build-and-publish:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
|
|
16
|
+
- uses: actions/setup-python@v5
|
|
17
|
+
with:
|
|
18
|
+
python-version: '3.12'
|
|
19
|
+
|
|
20
|
+
- name: Install uv
|
|
21
|
+
uses: astral-sh/setup-uv@v5
|
|
22
|
+
|
|
23
|
+
- name: Build distributions
|
|
24
|
+
run: uv build
|
|
25
|
+
|
|
26
|
+
- name: Check package metadata
|
|
27
|
+
run: |
|
|
28
|
+
python -m pip install twine
|
|
29
|
+
twine check dist/*
|
|
30
|
+
|
|
31
|
+
- name: Publish to TestPyPI
|
|
32
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
33
|
+
with:
|
|
34
|
+
repository-url: https://test.pypi.org/legacy/
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
*~
|
|
2
|
+
__pycache__/
|
|
3
|
+
/build/
|
|
4
|
+
/docs/_build/
|
|
5
|
+
/docs/generated/
|
|
6
|
+
.DS_Store
|
|
7
|
+
/.vscode/
|
|
8
|
+
/*.egg-info/
|
|
9
|
+
*.egg
|
|
10
|
+
*.prof
|
|
11
|
+
*.coverage
|
|
12
|
+
*.pickle
|
|
13
|
+
/out/
|
|
14
|
+
*.log
|
|
15
|
+
/dist/
|
|
16
|
+
*.pye
|
|
17
|
+
*.pyc
|
|
18
|
+
*.kate-swp
|
|
19
|
+
/.tox/
|
|
20
|
+
/.idea/
|
|
21
|
+
/.pytest_cache/
|
|
22
|
+
/.cache/
|
|
23
|
+
/data/
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
#Other
|
|
27
|
+
demo/*
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# pre-commit-config.yaml
|
|
2
|
+
# See https://pre-commit.com for docs and https://pre-commit.com/hooks.html for available hooks
|
|
3
|
+
|
|
4
|
+
# ======================================================
|
|
5
|
+
# ======= pre-commit configuration ========
|
|
6
|
+
# ======================================================
|
|
7
|
+
fail_fast: false
|
|
8
|
+
minimum_pre_commit_version: 3.0.0
|
|
9
|
+
default_language_version:
|
|
10
|
+
python: python3
|
|
11
|
+
default_stages:
|
|
12
|
+
- pre-commit
|
|
13
|
+
- pre-push
|
|
14
|
+
|
|
15
|
+
# ======================================================
|
|
16
|
+
# ======= repository hooks ========
|
|
17
|
+
# ======================================================
|
|
18
|
+
# UPDATE all the hooks regularly by running in the
|
|
19
|
+
# terminal:
|
|
20
|
+
# pre-commit autoupdate
|
|
21
|
+
|
|
22
|
+
repos:
|
|
23
|
+
# Fast Python linter and formatter with auto-fix support
|
|
24
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
25
|
+
rev: v0.15.8
|
|
26
|
+
hooks:
|
|
27
|
+
- id: ruff
|
|
28
|
+
args: [--fix, --show-fixes]
|
|
29
|
+
stages: [pre-commit]
|
|
30
|
+
files: \.py$
|
|
31
|
+
- id: ruff-format
|
|
32
|
+
stages: [pre-commit]
|
|
33
|
+
files: \.py$
|
|
34
|
+
|
|
35
|
+
# Official pre-commit-hooks for general checks
|
|
36
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
37
|
+
rev: v6.0.0 # Check for updates regularly
|
|
38
|
+
hooks:
|
|
39
|
+
- id: check-added-large-files
|
|
40
|
+
stages: [pre-commit, pre-push]
|
|
41
|
+
- id: check-ast
|
|
42
|
+
stages: [pre-commit]
|
|
43
|
+
- id: check-case-conflict
|
|
44
|
+
stages: [pre-commit]
|
|
45
|
+
- id: check-merge-conflict
|
|
46
|
+
stages: [pre-commit, pre-push]
|
|
47
|
+
- id: check-symlinks
|
|
48
|
+
stages: [pre-commit]
|
|
49
|
+
- id: check-yaml
|
|
50
|
+
args: [--unsafe]
|
|
51
|
+
stages: [pre-commit]
|
|
52
|
+
files: \.ya?ml$
|
|
53
|
+
- id: detect-private-key
|
|
54
|
+
stages: [pre-commit]
|
|
55
|
+
- id: end-of-file-fixer
|
|
56
|
+
stages: [pre-commit]
|
|
57
|
+
- id: mixed-line-ending
|
|
58
|
+
args: [--fix=lf]
|
|
59
|
+
exclude: ^docs/make.bat$
|
|
60
|
+
stages: [pre-commit]
|
|
61
|
+
- id: requirements-txt-fixer
|
|
62
|
+
stages: [pre-commit]
|
|
63
|
+
|
|
64
|
+
# Format code blocks in documentation files
|
|
65
|
+
- repo: https://github.com/asottile/blacken-docs
|
|
66
|
+
rev: 1.20.0
|
|
67
|
+
hooks:
|
|
68
|
+
- id: blacken-docs
|
|
69
|
+
stages: [pre-commit]
|
|
70
|
+
files: \.(md|rst)$
|
|
71
|
+
|
|
72
|
+
# Format TOML and YAML files with pretty-format hooks
|
|
73
|
+
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
|
|
74
|
+
rev: v2.16.0
|
|
75
|
+
hooks:
|
|
76
|
+
- id: pretty-format-toml
|
|
77
|
+
args:
|
|
78
|
+
- --autofix
|
|
79
|
+
- --indent
|
|
80
|
+
- '4'
|
|
81
|
+
stages: [pre-commit]
|
|
82
|
+
files: \.toml$
|
|
83
|
+
- id: pretty-format-yaml
|
|
84
|
+
args:
|
|
85
|
+
- --autofix
|
|
86
|
+
- --indent
|
|
87
|
+
- '4'
|
|
88
|
+
stages: [pre-commit]
|
|
89
|
+
files: \.ya?ml$
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
>=3.10
|
pkg_infra-0.0.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025, Edwin Carreño
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
pkg_infra-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pkg_infra
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: This is session handler, configuration and logging handler for Saezlab packages and applications.
|
|
5
|
+
Project-URL: Documentation, https://saezlab.github.io/pkg_infra
|
|
6
|
+
Project-URL: Homepage, https://github.com/saezlab/pkg_infra
|
|
7
|
+
Project-URL: Issues, https://github.com/saezlab/pkg_infra/issues
|
|
8
|
+
Project-URL: Repository, https://github.com/saezlab/pkg_infra
|
|
9
|
+
Author-email: Edwin Carreño <ecarrenolozano@gmail.com>
|
|
10
|
+
Maintainer-email: Edwin Carreño <ecarrenolozano@gmail.com>
|
|
11
|
+
License-Expression: MIT
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Requires-Dist: numpy>=2.2.6
|
|
22
|
+
Requires-Dist: omegaconf>=2.3.0
|
|
23
|
+
Requires-Dist: pandas>=2.3.3
|
|
24
|
+
Requires-Dist: platformdirs>=4.5.0
|
|
25
|
+
Requires-Dist: pydantic>=2.12.5
|
|
26
|
+
Requires-Dist: python-json-logger>=4.0.0
|
|
27
|
+
Requires-Dist: pyyaml>=6.0.3
|
|
28
|
+
Requires-Dist: toml
|
|
29
|
+
Provides-Extra: dev
|
|
30
|
+
Requires-Dist: bump2version; extra == 'dev'
|
|
31
|
+
Requires-Dist: distlib; extra == 'dev'
|
|
32
|
+
Requires-Dist: ipykernel; extra == 'dev'
|
|
33
|
+
Requires-Dist: pre-commit; extra == 'dev'
|
|
34
|
+
Requires-Dist: twine; extra == 'dev'
|
|
35
|
+
Provides-Extra: docs
|
|
36
|
+
Requires-Dist: mkdocs-material>=9.6.14; extra == 'docs'
|
|
37
|
+
Requires-Dist: mkdocs<2,>=1.6; extra == 'docs'
|
|
38
|
+
Requires-Dist: mkdocstrings[python]<0.30,>=0.29.1; extra == 'docs'
|
|
39
|
+
Requires-Dist: pymdown-extensions>=10.15; extra == 'docs'
|
|
40
|
+
Provides-Extra: security
|
|
41
|
+
Requires-Dist: bandit; extra == 'security'
|
|
42
|
+
Provides-Extra: semantic
|
|
43
|
+
Requires-Dist: rdflib>=6.0.0; extra == 'semantic'
|
|
44
|
+
Provides-Extra: tests
|
|
45
|
+
Requires-Dist: codecov-cli>=10.2.0; extra == 'tests'
|
|
46
|
+
Requires-Dist: coverage>=6.0; extra == 'tests'
|
|
47
|
+
Requires-Dist: diff-cover; extra == 'tests'
|
|
48
|
+
Requires-Dist: pytest-cov; extra == 'tests'
|
|
49
|
+
Requires-Dist: pytest>=6.0; extra == 'tests'
|
|
50
|
+
Requires-Dist: ruff; extra == 'tests'
|
|
51
|
+
Requires-Dist: tox-gh>=1.5.0; extra == 'tests'
|
|
52
|
+
Requires-Dist: tox>=3.20.1; extra == 'tests'
|
|
53
|
+
Description-Content-Type: text/markdown
|
|
54
|
+
|
|
55
|
+

|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
[](https://github.com/saezlab/pkg_infra/actions/workflows/ci-testing-unit.yml)
|
|
61
|
+
[](https://saezlab.github.io/pkg_infra/)
|
|
62
|
+

|
|
63
|
+
[](https://pypi.org/project/pkg_infra/)
|
|
64
|
+
[](https://pypi.org/project/pkg_infra/)
|
|
65
|
+
[](https://pypi.org/project/pkg_infra/)
|
|
66
|
+
[](https://pypi.org/project/pkg_infra/)
|
|
67
|
+

|
|
68
|
+

|
|
69
|
+

|
|
70
|
+
|
|
71
|
+
`pkg_infra` provides shared infrastructure for Saezlab Python packages. It
|
|
72
|
+
standardizes three pieces of runtime behavior that are often reimplemented
|
|
73
|
+
ad hoc across projects:
|
|
74
|
+
|
|
75
|
+
- Session metadata for reproducible runs and workspace-aware execution
|
|
76
|
+
- Layered YAML configuration with validation and predictable precedence
|
|
77
|
+
- Centralized logging based on Python's standard `logging` module
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
## What it includes
|
|
82
|
+
|
|
83
|
+
- `pkg_infra.get_session(...)` as the main entrypoint for initializing runtime
|
|
84
|
+
state
|
|
85
|
+
- Config loading from ecosystem, package default, user, working directory,
|
|
86
|
+
environment variable, and optional custom file sources
|
|
87
|
+
- Pydantic-based validation for the merged settings model
|
|
88
|
+
- Logging configuration generation with support for file handlers, JSON output,
|
|
89
|
+
package groups, and async queue-based logging
|
|
90
|
+
- A packaged baseline configuration in
|
|
91
|
+
`src/pkg_infra/data/default_settings.yaml`
|
|
92
|
+
|
|
93
|
+
## Installation
|
|
94
|
+
|
|
95
|
+
Install the package from PyPI:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
pip install pkg_infra
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Install it from a local checkout with docs or test extras when developing:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
pip install -e ".[docs,tests]"
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Quick Example
|
|
108
|
+
|
|
109
|
+
```python
|
|
110
|
+
from pathlib import Path
|
|
111
|
+
|
|
112
|
+
from pkg_infra import get_session
|
|
113
|
+
|
|
114
|
+
session = get_session(
|
|
115
|
+
workspace=Path("."),
|
|
116
|
+
include_location=False,
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
print(session)
|
|
120
|
+
print(session.get_config_dict())
|
|
121
|
+
|
|
122
|
+
corneto_settings = session.get_conf("corneto")
|
|
123
|
+
print(corneto_settings)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Configuration Precedence
|
|
127
|
+
|
|
128
|
+
`pkg_infra` merges configuration sources in this order, where later sources
|
|
129
|
+
override earlier ones:
|
|
130
|
+
|
|
131
|
+
1. Ecosystem config
|
|
132
|
+
2. Packaged default config
|
|
133
|
+
3. User config
|
|
134
|
+
4. Working-directory config
|
|
135
|
+
5. Config file pointed to by `PKG_INFRA_CONFIG`
|
|
136
|
+
6. Explicit custom config path passed by the caller
|
|
137
|
+
|
|
138
|
+
## Documentation
|
|
139
|
+
|
|
140
|
+
The full documentation is published at
|
|
141
|
+
<https://saezlab.github.io/pkg_infra/>.
|
|
142
|
+
|
|
143
|
+
To serve the docs locally without the current upstream Material warning banner:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
source .venv/bin/activate
|
|
147
|
+
export NO_MKDOCS_2_WARNING=1
|
|
148
|
+
PYTHONPATH=src mkdocs serve
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Recommended starting points:
|
|
152
|
+
|
|
153
|
+
- Installation: `docs/installation.md`
|
|
154
|
+
- Quickstart: `docs/learn/tutorials/quickstart.md`
|
|
155
|
+
- Project context and rationale: `docs/pkg_infra-project/`
|
|
156
|
+
|
|
157
|
+
## Contributing
|
|
158
|
+
|
|
159
|
+
Contributions are welcome. The repository includes dedicated guides for
|
|
160
|
+
documentation and code contributions in `docs/community/`.
|
|
161
|
+
|
|
162
|
+
## License
|
|
163
|
+
|
|
164
|
+
This project is distributed under the MIT License. See `LICENSE` for details.
|