Skip to content

Commit de4211a

Browse files
committed
covarage and move to src structure
1 parent b01d6fd commit de4211a

101 files changed

Lines changed: 3265 additions & 1378 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.coverage

-148 KB
Binary file not shown.

.github/workflows/ci.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: CI
2+
3+
on:
4+
push: {}
5+
pull_request: {}
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
python-version: [3.14]
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
22+
- name: Show Python and pip info (debug)
23+
run: |
24+
python -V
25+
python -c "import sys; print(sys.executable)"
26+
python -m pip --version
27+
python -m pip list
28+
29+
- name: Cache pip
30+
uses: actions/cache@v4
31+
with:
32+
path: ~/.cache/pip
33+
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
34+
restore-keys: |
35+
${{ runner.os }}-pip-${{ matrix.python-version }}-
36+
${{ runner.os }}-pip-
37+
38+
- name: Install build tools
39+
run: python -m pip install --upgrade pip build setuptools wheel
40+
41+
- name: Install package and test deps (editable)
42+
run: python -m pip install -e ".[testing]"
43+
44+
- name: Install pre-commit
45+
run: python -m pip install pre-commit
46+
47+
- name: Run pre-commit hooks
48+
run: pre-commit run --all-files
49+
- name: Ensure repo on PYTHONPATH (optional)
50+
run: echo "PYTHONPATH=$(pwd)" >> $GITHUB_ENV
51+
52+
- name: Debug Python path and import package
53+
run: |
54+
python - <<'PY'
55+
import sys, importlib
56+
print("=== sys.path ===")
57+
for p in sys.path:
58+
print(" -", p)
59+
print("=== Import package ===")
60+
61+
- name: Run tests with coverage
62+
run: pytest --cov=src --cov-report=xml
63+
64+
- name: Enforce coverage threshold
65+
env:
66+
BRANCH: ${{ github.ref_name }}
67+
run: |
68+
python tools/ci_check_coverage.py "$BRANCH"
69+
70+
- name: Upload coverage to artifact
71+
uses: actions/upload-artifact@v4
72+
with:
73+
name: coverage-xml
74+
path: coverage.xml

.github/workflows/publish-pypi.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Publish Python package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Set up Python
13+
uses: actions/setup-python@v4
14+
with:
15+
python-version: "3.14"
16+
- name: Install build tools
17+
run: python -m pip install --upgrade build twine
18+
- name: Build dist
19+
run: python -m build
20+
- name: Publish to PyPI
21+
uses: pypa/gh-action-pypi-publish@release/v1
22+
with:
23+
user: __token__
24+
password: ${{ secrets.PYPI_API_TOKEN }}

.pre-commit-config.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
repos:
2+
- repo: local
3+
hooks:
4+
- id: pytestCoverage
5+
name: pytest with coverage
6+
entry: python tools/checkCoverage.py
7+
language: system
8+
pass_filenames: false
9+
always_run: true
10+
- repo: https://github.com/psf/black
11+
rev: 24.1.0
12+
hooks:
13+
- id: black
14+
- repo: https://github.com/PyCQA/isort
15+
rev: 5.12.0
16+
hooks:
17+
- id: isort
18+
19+
20+

DataProsesing/DataHelperFunctions.py

Lines changed: 0 additions & 79 deletions
This file was deleted.

DataProsesing/map.py

Lines changed: 0 additions & 70 deletions
This file was deleted.

README.md

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,41 @@ in terminal for project
1111
py -m pip install git+https://github.com/VikingInOrbit/GabesPythonToolBox.git
1212
'''
1313

14-
Import what you need, when you need it.
15-
using "import GabesPythonToolBox as GTB" for all
16-
or import "GabesPythonToolBox.Category.lib as (XX)"
17-
That’s it. You're good to go.
14+
15+
## How to install
16+
17+
Quick install for development and testing:
18+
19+
```bash
20+
python -m venv .venv
21+
python -m pip install pip-tools
22+
pip-compile requirements.in
23+
python -m pip install -r requirements.txt
24+
python -m pip install -e .
25+
```
26+
27+
## Development Setup
28+
29+
How to commit code destined for dev:
30+
31+
```bash
32+
pip install pre-commit
33+
pre-commit install
34+
pre-commit install --hook-type pre-push
35+
pre-commit install --hook-type commit-msg
36+
pre-commit run --all-files
37+
```
38+
39+
40+
If pre-commit fails:
41+
42+
```bash
43+
pytest -q --maxfail=1
44+
tox
45+
isort .
46+
black .
47+
```
48+
1849

1950
### comands
2051
#### unit test

0 commit comments

Comments
 (0)