pyrrange 0.1.0__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.
- pyrrange-0.1.0/.github/dependabot.yml +28 -0
- pyrrange-0.1.0/.github/workflows/release.yml +166 -0
- pyrrange-0.1.0/.github/workflows/test.yml +167 -0
- pyrrange-0.1.0/.gitignore +90 -0
- pyrrange-0.1.0/LICENSE +21 -0
- pyrrange-0.1.0/PKG-INFO +297 -0
- pyrrange-0.1.0/README.md +270 -0
- pyrrange-0.1.0/pyproject.toml +95 -0
- pyrrange-0.1.0/sonar-project.properties +19 -0
- pyrrange-0.1.0/src/pyrrange/__init__.py +10 -0
- pyrrange-0.1.0/src/pyrrange/_version.py +24 -0
- pyrrange-0.1.0/src/pyrrange/arrange.py +170 -0
- pyrrange-0.1.0/src/pyrrange/context.py +24 -0
- pyrrange-0.1.0/src/pyrrange/py.typed +0 -0
- pyrrange-0.1.0/src/pyrrange/scene.py +38 -0
- pyrrange-0.1.0/tests/__init__.py +0 -0
- pyrrange-0.1.0/tests/test_arrange.py +266 -0
- pyrrange-0.1.0/tests/test_context.py +53 -0
- pyrrange-0.1.0/tests/test_errors.py +84 -0
- pyrrange-0.1.0/tests/test_teardown.py +107 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: "github-actions"
|
|
4
|
+
directory: "/"
|
|
5
|
+
schedule:
|
|
6
|
+
interval: "weekly"
|
|
7
|
+
commit-message:
|
|
8
|
+
prefix: "ci"
|
|
9
|
+
labels:
|
|
10
|
+
- "dependencies"
|
|
11
|
+
groups:
|
|
12
|
+
actions:
|
|
13
|
+
patterns:
|
|
14
|
+
- "*"
|
|
15
|
+
|
|
16
|
+
- package-ecosystem: "uv"
|
|
17
|
+
directory: "/"
|
|
18
|
+
schedule:
|
|
19
|
+
interval: "weekly"
|
|
20
|
+
commit-message:
|
|
21
|
+
prefix: "deps"
|
|
22
|
+
labels:
|
|
23
|
+
- "dependencies"
|
|
24
|
+
- "python"
|
|
25
|
+
groups:
|
|
26
|
+
python-deps:
|
|
27
|
+
patterns:
|
|
28
|
+
- "*"
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*.*.*"
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
validate:
|
|
13
|
+
name: Validate Release
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
|
|
16
|
+
outputs:
|
|
17
|
+
version: ${{ steps.version.outputs.version }}
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- name: Checkout
|
|
21
|
+
uses: actions/checkout@v6
|
|
22
|
+
with:
|
|
23
|
+
fetch-depth: 0
|
|
24
|
+
persist-credentials: false
|
|
25
|
+
|
|
26
|
+
- name: Validate Branch
|
|
27
|
+
run: |
|
|
28
|
+
TAG_COMMIT=$(git rev-list -n 1 ${{ github.ref_name }})
|
|
29
|
+
|
|
30
|
+
if ! git merge-base --is-ancestor $TAG_COMMIT origin/master; then
|
|
31
|
+
echo "❌ ERROR: Tag ${{ github.ref_name }} is not on master branch"
|
|
32
|
+
echo "Tags must be created from commits that are on master."
|
|
33
|
+
exit 1
|
|
34
|
+
fi
|
|
35
|
+
|
|
36
|
+
echo "✅ Tag ${{ github.ref_name }} is on master branch"
|
|
37
|
+
|
|
38
|
+
- name: Extract Version
|
|
39
|
+
id: version
|
|
40
|
+
run: |
|
|
41
|
+
VERSION="${{ github.ref_name }}"
|
|
42
|
+
VERSION="${VERSION#v}"
|
|
43
|
+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
|
44
|
+
echo "📦 Version: $VERSION"
|
|
45
|
+
|
|
46
|
+
- name: Validate Version Format
|
|
47
|
+
run: |
|
|
48
|
+
VERSION="${{ steps.version.outputs.version }}"
|
|
49
|
+
if ! echo "$VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.]+)?$'; then
|
|
50
|
+
echo "❌ ERROR: Invalid version format: $VERSION"
|
|
51
|
+
echo "Expected: X.Y.Z or X.Y.Z-suffix"
|
|
52
|
+
exit 1
|
|
53
|
+
fi
|
|
54
|
+
echo "✅ Version format valid: $VERSION"
|
|
55
|
+
|
|
56
|
+
build:
|
|
57
|
+
name: Build Package
|
|
58
|
+
runs-on: ubuntu-latest
|
|
59
|
+
needs: [validate]
|
|
60
|
+
|
|
61
|
+
steps:
|
|
62
|
+
- name: Checkout
|
|
63
|
+
uses: actions/checkout@v6
|
|
64
|
+
with:
|
|
65
|
+
fetch-depth: 0
|
|
66
|
+
persist-credentials: false
|
|
67
|
+
|
|
68
|
+
- name: Install uv
|
|
69
|
+
uses: astral-sh/setup-uv@v7
|
|
70
|
+
|
|
71
|
+
- name: Set up Python
|
|
72
|
+
uses: actions/setup-python@v6
|
|
73
|
+
with:
|
|
74
|
+
python-version: "3.12"
|
|
75
|
+
|
|
76
|
+
- name: Build Package
|
|
77
|
+
run: uv build
|
|
78
|
+
|
|
79
|
+
- name: Verify Package
|
|
80
|
+
run: |
|
|
81
|
+
echo "📦 Built packages:"
|
|
82
|
+
ls -la dist/
|
|
83
|
+
|
|
84
|
+
- name: Upload Artifacts
|
|
85
|
+
uses: actions/upload-artifact@v7
|
|
86
|
+
with:
|
|
87
|
+
name: dist
|
|
88
|
+
path: dist/
|
|
89
|
+
retention-days: 5
|
|
90
|
+
|
|
91
|
+
test-install:
|
|
92
|
+
name: Test Install (py${{ matrix.python-version }})
|
|
93
|
+
runs-on: ubuntu-latest
|
|
94
|
+
needs: [build]
|
|
95
|
+
|
|
96
|
+
strategy:
|
|
97
|
+
matrix:
|
|
98
|
+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
|
|
99
|
+
|
|
100
|
+
steps:
|
|
101
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
102
|
+
uses: actions/setup-python@v6
|
|
103
|
+
with:
|
|
104
|
+
python-version: ${{ matrix.python-version }}
|
|
105
|
+
|
|
106
|
+
- name: Download Artifacts
|
|
107
|
+
uses: actions/download-artifact@v8
|
|
108
|
+
with:
|
|
109
|
+
name: dist
|
|
110
|
+
path: dist/
|
|
111
|
+
|
|
112
|
+
- name: Install Package
|
|
113
|
+
run: |
|
|
114
|
+
pip install dist/*.whl
|
|
115
|
+
pip show pyrrange
|
|
116
|
+
|
|
117
|
+
publish-pypi:
|
|
118
|
+
name: Publish to PyPI
|
|
119
|
+
runs-on: ubuntu-latest
|
|
120
|
+
needs: [validate, build, test-install]
|
|
121
|
+
environment: pypi
|
|
122
|
+
|
|
123
|
+
permissions:
|
|
124
|
+
id-token: write
|
|
125
|
+
|
|
126
|
+
steps:
|
|
127
|
+
- name: Download Artifacts
|
|
128
|
+
uses: actions/download-artifact@v8
|
|
129
|
+
with:
|
|
130
|
+
name: dist
|
|
131
|
+
path: dist/
|
|
132
|
+
|
|
133
|
+
- name: Publish to PyPI
|
|
134
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
135
|
+
with:
|
|
136
|
+
print-hash: true
|
|
137
|
+
|
|
138
|
+
github-release:
|
|
139
|
+
name: Create GitHub Release
|
|
140
|
+
runs-on: ubuntu-latest
|
|
141
|
+
needs: [validate, publish-pypi]
|
|
142
|
+
|
|
143
|
+
permissions:
|
|
144
|
+
contents: write
|
|
145
|
+
|
|
146
|
+
steps:
|
|
147
|
+
- name: Checkout
|
|
148
|
+
uses: actions/checkout@v6
|
|
149
|
+
with:
|
|
150
|
+
persist-credentials: false
|
|
151
|
+
|
|
152
|
+
- name: Download Artifacts
|
|
153
|
+
uses: actions/download-artifact@v8
|
|
154
|
+
with:
|
|
155
|
+
name: dist
|
|
156
|
+
path: dist/
|
|
157
|
+
|
|
158
|
+
- name: Create Release
|
|
159
|
+
uses: softprops/action-gh-release@v2
|
|
160
|
+
with:
|
|
161
|
+
tag_name: ${{ github.ref_name }}
|
|
162
|
+
name: Release ${{ needs.validate.outputs.version }}
|
|
163
|
+
draft: false
|
|
164
|
+
prerelease: ${{ contains(github.ref_name, '-') }}
|
|
165
|
+
generate_release_notes: true
|
|
166
|
+
files: dist/*
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
name: Test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [master]
|
|
8
|
+
types: [opened, synchronize, reopened]
|
|
9
|
+
|
|
10
|
+
concurrency:
|
|
11
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
12
|
+
cancel-in-progress: true
|
|
13
|
+
|
|
14
|
+
permissions:
|
|
15
|
+
contents: read
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
lint:
|
|
19
|
+
name: Lint
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
|
|
22
|
+
steps:
|
|
23
|
+
- name: Checkout
|
|
24
|
+
uses: actions/checkout@v6
|
|
25
|
+
with:
|
|
26
|
+
fetch-depth: 0
|
|
27
|
+
persist-credentials: false
|
|
28
|
+
|
|
29
|
+
- name: Install uv
|
|
30
|
+
uses: astral-sh/setup-uv@v7
|
|
31
|
+
|
|
32
|
+
- name: Set up Python
|
|
33
|
+
uses: actions/setup-python@v6
|
|
34
|
+
with:
|
|
35
|
+
python-version: "3.12"
|
|
36
|
+
|
|
37
|
+
- name: Install dependencies
|
|
38
|
+
run: uv sync --all-extras
|
|
39
|
+
|
|
40
|
+
- name: Check formatting
|
|
41
|
+
run: uv run ruff format --check src/ tests/
|
|
42
|
+
|
|
43
|
+
- name: Check linting
|
|
44
|
+
run: uv run ruff check src/ tests/
|
|
45
|
+
|
|
46
|
+
typecheck:
|
|
47
|
+
name: Type Check
|
|
48
|
+
runs-on: ubuntu-latest
|
|
49
|
+
|
|
50
|
+
steps:
|
|
51
|
+
- name: Checkout
|
|
52
|
+
uses: actions/checkout@v6
|
|
53
|
+
with:
|
|
54
|
+
fetch-depth: 0
|
|
55
|
+
persist-credentials: false
|
|
56
|
+
|
|
57
|
+
- name: Install uv
|
|
58
|
+
uses: astral-sh/setup-uv@v7
|
|
59
|
+
|
|
60
|
+
- name: Set up Python
|
|
61
|
+
uses: actions/setup-python@v6
|
|
62
|
+
with:
|
|
63
|
+
python-version: "3.12"
|
|
64
|
+
|
|
65
|
+
- name: Install dependencies
|
|
66
|
+
run: uv sync --all-extras
|
|
67
|
+
|
|
68
|
+
- name: Run mypy
|
|
69
|
+
run: uv run mypy src/pyrrange
|
|
70
|
+
continue-on-error: true
|
|
71
|
+
|
|
72
|
+
test:
|
|
73
|
+
name: Test (py${{ matrix.python-version }})
|
|
74
|
+
runs-on: ubuntu-latest
|
|
75
|
+
needs: [lint]
|
|
76
|
+
|
|
77
|
+
strategy:
|
|
78
|
+
fail-fast: false
|
|
79
|
+
matrix:
|
|
80
|
+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
|
|
81
|
+
|
|
82
|
+
steps:
|
|
83
|
+
- name: Checkout
|
|
84
|
+
uses: actions/checkout@v6
|
|
85
|
+
with:
|
|
86
|
+
fetch-depth: 0
|
|
87
|
+
persist-credentials: false
|
|
88
|
+
|
|
89
|
+
- name: Install uv
|
|
90
|
+
uses: astral-sh/setup-uv@v7
|
|
91
|
+
|
|
92
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
93
|
+
uses: actions/setup-python@v6
|
|
94
|
+
with:
|
|
95
|
+
python-version: ${{ matrix.python-version }}
|
|
96
|
+
|
|
97
|
+
- name: Install dependencies
|
|
98
|
+
run: uv sync --all-extras
|
|
99
|
+
|
|
100
|
+
- name: Run tests
|
|
101
|
+
run: uv run pytest --cov=pyrrange --cov-report=term-missing --cov-report=xml:coverage.xml --cov-fail-under=100
|
|
102
|
+
|
|
103
|
+
- name: Upload coverage artifact
|
|
104
|
+
if: matrix.python-version == '3.14'
|
|
105
|
+
uses: actions/upload-artifact@v7
|
|
106
|
+
with:
|
|
107
|
+
name: coverage-report
|
|
108
|
+
path: coverage.xml
|
|
109
|
+
|
|
110
|
+
sonarcloud:
|
|
111
|
+
name: SonarCloud Analysis
|
|
112
|
+
runs-on: ubuntu-latest
|
|
113
|
+
needs: [test]
|
|
114
|
+
|
|
115
|
+
steps:
|
|
116
|
+
- name: Checkout
|
|
117
|
+
uses: actions/checkout@v6
|
|
118
|
+
with:
|
|
119
|
+
fetch-depth: 0
|
|
120
|
+
persist-credentials: false
|
|
121
|
+
|
|
122
|
+
- name: Download coverage artifact
|
|
123
|
+
uses: actions/download-artifact@v8
|
|
124
|
+
with:
|
|
125
|
+
name: coverage-report
|
|
126
|
+
|
|
127
|
+
- name: SonarCloud Scan
|
|
128
|
+
uses: SonarSource/sonarqube-scan-action@v7
|
|
129
|
+
env:
|
|
130
|
+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
131
|
+
|
|
132
|
+
ci-success:
|
|
133
|
+
name: CI Success
|
|
134
|
+
runs-on: ubuntu-latest
|
|
135
|
+
needs: [lint, typecheck, test, sonarcloud]
|
|
136
|
+
if: always()
|
|
137
|
+
|
|
138
|
+
steps:
|
|
139
|
+
- name: Check all jobs
|
|
140
|
+
run: |
|
|
141
|
+
echo "===== Job Results ====="
|
|
142
|
+
echo "Lint: ${{ needs.lint.result }}"
|
|
143
|
+
echo "Typecheck: ${{ needs.typecheck.result }}"
|
|
144
|
+
echo "Test: ${{ needs.test.result }}"
|
|
145
|
+
echo "SonarCloud: ${{ needs.sonarcloud.result }}"
|
|
146
|
+
echo "======================="
|
|
147
|
+
|
|
148
|
+
if [ "${{ needs.lint.result }}" != "success" ]; then
|
|
149
|
+
echo "❌ Lint failed"
|
|
150
|
+
exit 1
|
|
151
|
+
fi
|
|
152
|
+
|
|
153
|
+
if [ "${{ needs.test.result }}" != "success" ]; then
|
|
154
|
+
echo "❌ Tests failed"
|
|
155
|
+
exit 1
|
|
156
|
+
fi
|
|
157
|
+
|
|
158
|
+
if [ "${{ needs.typecheck.result }}" == "failure" ]; then
|
|
159
|
+
echo "⚠️ Typecheck failed (non-blocking)"
|
|
160
|
+
fi
|
|
161
|
+
|
|
162
|
+
if [ "${{ needs.sonarcloud.result }}" != "success" ]; then
|
|
163
|
+
echo "❌ SonarCloud failed"
|
|
164
|
+
exit 1
|
|
165
|
+
fi
|
|
166
|
+
|
|
167
|
+
echo "✅ All required checks passed!"
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
env/
|
|
12
|
+
build/
|
|
13
|
+
develop-eggs/
|
|
14
|
+
dist/
|
|
15
|
+
downloads/
|
|
16
|
+
eggs/
|
|
17
|
+
.eggs/
|
|
18
|
+
lib/
|
|
19
|
+
lib64/
|
|
20
|
+
parts/
|
|
21
|
+
sdist/
|
|
22
|
+
var/
|
|
23
|
+
*.egg-info/
|
|
24
|
+
.installed.cfg
|
|
25
|
+
*.egg
|
|
26
|
+
|
|
27
|
+
# PyInstaller
|
|
28
|
+
# Usually these files are written by a python script from a template
|
|
29
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
30
|
+
*.manifest
|
|
31
|
+
*.spec
|
|
32
|
+
|
|
33
|
+
# Installer logs
|
|
34
|
+
pip-log.txt
|
|
35
|
+
pip-delete-this-directory.txt
|
|
36
|
+
|
|
37
|
+
# Unit test / coverage reports
|
|
38
|
+
htmlcov/
|
|
39
|
+
.tox/
|
|
40
|
+
.coverage
|
|
41
|
+
.coverage.*
|
|
42
|
+
.cache
|
|
43
|
+
nosetests.xml
|
|
44
|
+
coverage.xml
|
|
45
|
+
*,cover
|
|
46
|
+
.hypothesis/
|
|
47
|
+
.pytest_cache
|
|
48
|
+
|
|
49
|
+
# Translations
|
|
50
|
+
*.mo
|
|
51
|
+
*.pot
|
|
52
|
+
|
|
53
|
+
# Django stuff:
|
|
54
|
+
*.log
|
|
55
|
+
local_settings.py
|
|
56
|
+
|
|
57
|
+
# Flask instance folder
|
|
58
|
+
instance/
|
|
59
|
+
|
|
60
|
+
# Sphinx documentation
|
|
61
|
+
docs/_build/
|
|
62
|
+
|
|
63
|
+
# MkDocs documentation
|
|
64
|
+
/site/
|
|
65
|
+
|
|
66
|
+
# PyBuilder
|
|
67
|
+
target/
|
|
68
|
+
|
|
69
|
+
# IPython Notebook
|
|
70
|
+
.ipynb_checkpoints
|
|
71
|
+
|
|
72
|
+
# pyenv
|
|
73
|
+
.python-version
|
|
74
|
+
|
|
75
|
+
# virtual env
|
|
76
|
+
.venv/
|
|
77
|
+
|
|
78
|
+
# Auto-generated version file (hatch-vcs)
|
|
79
|
+
src/pyrrange/_version.py
|
|
80
|
+
|
|
81
|
+
# uv lock file
|
|
82
|
+
uv.lock
|
|
83
|
+
|
|
84
|
+
# claude and other AI tool files
|
|
85
|
+
.claude/
|
|
86
|
+
.serena/
|
|
87
|
+
.omc/
|
|
88
|
+
|
|
89
|
+
# Mac OS files
|
|
90
|
+
.DS_Store
|
pyrrange-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Unay Santisteban
|
|
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.
|