Skip to content

Commit 2add408

Browse files
Merge pull request #1 from datamasque/dm-python-release
datamasque-python 1.0.0 release
2 parents 8561fca + 58f3683 commit 2add408

70 files changed

Lines changed: 11536 additions & 0 deletions

Some content is hidden

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

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
indent_style = space
7+
indent_size = 4
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
charset = utf-8
11+
end_of_line = lf
12+
13+
[*.bat]
14+
indent_style = tab
15+
end_of_line = crlf
16+
17+
[LICENSE]
18+
insert_final_newline = false
19+
20+
[Makefile]
21+
indent_style = tab

.github/workflows/ci.yml

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
concurrency:
10+
group: ci-${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
12+
13+
jobs:
14+
lint:
15+
name: Lint (ruff)
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up uv
21+
uses: astral-sh/setup-uv@v5
22+
with:
23+
enable-cache: true
24+
25+
- name: Set up Python
26+
run: uv python install 3.12
27+
28+
- name: Install dependencies
29+
run: uv sync --frozen
30+
31+
- name: ruff check
32+
run: uv run ruff check datamasque tests
33+
34+
- name: ruff format --check
35+
run: uv run ruff format --check datamasque tests
36+
37+
typecheck:
38+
name: Typecheck (mypy)
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v4
42+
43+
- name: Set up uv
44+
uses: astral-sh/setup-uv@v5
45+
with:
46+
enable-cache: true
47+
48+
- name: Set up Python
49+
run: uv python install 3.12
50+
51+
- name: Install dependencies
52+
run: uv sync --frozen
53+
54+
- name: mypy
55+
run: uv run mypy datamasque
56+
57+
test:
58+
name: Tests (py${{ matrix.python-version }})
59+
runs-on: ubuntu-latest
60+
strategy:
61+
fail-fast: false
62+
matrix:
63+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
64+
steps:
65+
- uses: actions/checkout@v4
66+
67+
- name: Set up uv
68+
uses: astral-sh/setup-uv@v5
69+
with:
70+
enable-cache: true
71+
72+
- name: Set up Python ${{ matrix.python-version }}
73+
run: uv python install ${{ matrix.python-version }}
74+
75+
- name: Install dependencies
76+
run: uv sync --frozen --python ${{ matrix.python-version }}
77+
78+
- name: pytest
79+
run: >-
80+
uv run --python ${{ matrix.python-version }}
81+
pytest tests/
82+
--junitxml=report.xml
83+
--cov=datamasque
84+
--cov-report=term
85+
--cov-report=xml:coverage.xml
86+
--import-mode=importlib
87+
88+
- name: Upload test results
89+
if: always()
90+
uses: actions/upload-artifact@v4
91+
with:
92+
name: test-results-py${{ matrix.python-version }}
93+
path: |
94+
report.xml
95+
coverage.xml
96+
retention-days: 7
97+
98+
docs:
99+
name: Docs (sphinx)
100+
runs-on: ubuntu-latest
101+
steps:
102+
- uses: actions/checkout@v4
103+
104+
- name: Set up uv
105+
uses: astral-sh/setup-uv@v5
106+
with:
107+
enable-cache: true
108+
109+
- name: Set up Python
110+
run: uv python install 3.12
111+
112+
- name: Install dependencies
113+
run: uv sync --frozen
114+
115+
- name: sphinx-build
116+
run: uv run sphinx-build -b html -W --keep-going docs docs/_build/html
117+
118+
- name: Upload built docs
119+
if: always()
120+
uses: actions/upload-artifact@v4
121+
with:
122+
name: docs-html
123+
path: docs/_build/html
124+
retention-days: 7

.github/workflows/release.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
jobs:
9+
build:
10+
name: Build sdist and wheel
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up uv
16+
uses: astral-sh/setup-uv@v5
17+
with:
18+
enable-cache: true
19+
20+
- name: Set up Python
21+
run: uv python install 3.12
22+
23+
- name: Verify tag matches package version
24+
run: |
25+
TAG_VERSION="${GITHUB_REF_NAME#v}"
26+
PKG_VERSION="$(uv run python -c 'import tomllib,sys; print(tomllib.loads(open("pyproject.toml","rb").read().decode())["project"]["version"])')"
27+
echo "Tag version: ${TAG_VERSION}"
28+
echo "Package version: ${PKG_VERSION}"
29+
if [ "${TAG_VERSION}" != "${PKG_VERSION}" ]; then
30+
echo "::error::Tag ${GITHUB_REF_NAME} does not match pyproject.toml version ${PKG_VERSION}"
31+
exit 1
32+
fi
33+
34+
- name: Build
35+
run: uv build
36+
37+
- name: Upload distributions
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: dist
41+
path: dist/
42+
retention-days: 7
43+
44+
publish:
45+
name: Publish to PyPI
46+
needs: build
47+
runs-on: ubuntu-latest
48+
environment:
49+
name: pypi
50+
url: https://pypi.org/p/datamasque-python
51+
permissions:
52+
id-token: write
53+
contents: read
54+
steps:
55+
- name: Download distributions
56+
uses: actions/download-artifact@v4
57+
with:
58+
name: dist
59+
path: dist/
60+
61+
- name: Publish to PyPI
62+
uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# Distribution / packaging
7+
.Python
8+
build/
9+
develop-eggs/
10+
dist/
11+
downloads/
12+
eggs/
13+
.eggs/
14+
lib/
15+
lib64/
16+
parts/
17+
sdist/
18+
var/
19+
wheels/
20+
*.egg-info/
21+
.installed.cfg
22+
*.egg
23+
24+
# Unit test / coverage reports
25+
htmlcov/
26+
.tox/
27+
.coverage
28+
.coverage.*
29+
.cache
30+
coverage.xml
31+
report.xml
32+
*.cover
33+
.hypothesis/
34+
.pytest_cache/
35+
36+
# Sphinx documentation
37+
docs/_build/
38+
39+
# pyenv
40+
.python-version
41+
42+
# dotenv
43+
.env
44+
45+
# virtualenv
46+
.venv
47+
venv/
48+
ENV/
49+
50+
# mypy
51+
.mypy_cache/
52+
53+
# IDE settings
54+
.vscode/
55+
.idea/

.readthedocs.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Read the Docs configuration file
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
version: 2
5+
6+
build:
7+
os: ubuntu-24.04
8+
tools:
9+
python: "3.13"
10+
jobs:
11+
post_create_environment:
12+
- pip install uv
13+
post_install:
14+
- UV_PROJECT_ENVIRONMENT=$READTHEDOCS_VIRTUALENV_PATH uv sync --frozen --all-groups
15+
16+
sphinx:
17+
configuration: docs/conf.py
18+
fail_on_warning: true

0 commit comments

Comments
 (0)