pbi-parsers 0.7.12__tar.gz → 0.7.19__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.
- pbi_parsers-0.7.19/.github/workflows/deploy.yml +122 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/PKG-INFO +1 -1
- pbi_parsers-0.7.19/deploy.py +117 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/__init__.py +1 -1
- pbi_parsers-0.7.12/test.py +0 -17
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/.github/workflows/publish-to-pypi.yml +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/.gitignore +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/README.md +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/docs/docs/api/dax/formatter.md +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/docs/docs/api/dax/lexer.md +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/docs/docs/api/dax/parser.md +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/docs/docs/api/pq/formatter.md +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/docs/docs/api/pq/lexer.md +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/docs/docs/api/pq/parser.md +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/docs/docs/api/shared/lexer.md +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/docs/docs/api/shared/text_slice.md +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/docs/docs/api/shared/token.md +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/docs/docs/index.md +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/docs/mkdocs.yml +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/base/__init__.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/base/lexer.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/base/tokens.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/dax/__init__.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/dax/exprs/__init__.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/dax/exprs/_base.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/dax/exprs/_utils.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/dax/exprs/add_sub.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/dax/exprs/add_sub_unary.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/dax/exprs/array.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/dax/exprs/column.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/dax/exprs/comparison.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/dax/exprs/concatenation.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/dax/exprs/div_mul.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/dax/exprs/exponent.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/dax/exprs/function.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/dax/exprs/hierarchy.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/dax/exprs/identifier.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/dax/exprs/ins.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/dax/exprs/keyword.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/dax/exprs/literal_number.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/dax/exprs/literal_string.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/dax/exprs/logical.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/dax/exprs/measure.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/dax/exprs/none.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/dax/exprs/parens.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/dax/exprs/returns.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/dax/exprs/table.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/dax/exprs/variable.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/dax/formatter.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/dax/lexer.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/dax/main.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/dax/parser.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/dax/tokens.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/dax/utils.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/__init__.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/exprs/__init__.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/exprs/_base.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/exprs/_utils.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/exprs/add_sub.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/exprs/add_sub_unary.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/exprs/and_or_expr.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/exprs/array.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/exprs/arrow.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/exprs/column.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/exprs/comparison.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/exprs/concatenation.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/exprs/div_mul.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/exprs/each.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/exprs/ellipsis_expr.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/exprs/function.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/exprs/identifier.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/exprs/if_expr.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/exprs/is_expr.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/exprs/keyword.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/exprs/literal_number.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/exprs/literal_string.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/exprs/meta.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/exprs/negation.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/exprs/none.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/exprs/not_expr.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/exprs/parens.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/exprs/record.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/exprs/row.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/exprs/row_index.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/exprs/statement.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/exprs/try_expr.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/exprs/type_expr.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/exprs/variable.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/formatter.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/lexer.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/main.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/parser.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pbi_parsers/pq/tokens.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/pyproject.toml +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/tests/__init__.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/tests/test_dax/__init__.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/tests/test_dax/test_exprs/__init__.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/tests/test_dax/test_exprs/test_add_sub.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/tests/test_dax/test_exprs/test_add_sub_unary.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/tests/test_dax/test_exprs/test_array.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/tests/test_dax/test_exprs/test_column.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/tests/test_dax/test_exprs/test_comparison.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/tests/test_dax/test_exprs/test_concatenation.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/tests/test_dax/test_exprs/test_div_mul.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/tests/test_dax/test_exprs/test_exponent.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/tests/test_dax/test_exprs/test_function.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/tests/test_dax/test_exprs/test_hierarchy.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/tests/test_dax/test_exprs/test_identifier.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/tests/test_dax/test_exprs/test_ins.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/tests/test_dax/test_exprs/test_keyword.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/tests/test_dax/test_exprs/test_literal_number.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/tests/test_dax/test_exprs/test_literal_string.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/tests/test_dax/test_exprs/test_logical.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/tests/test_dax/test_exprs/test_measure.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/tests/test_dax/test_exprs/test_parens.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/tests/test_dax/test_exprs/test_returns.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/tests/test_dax/test_exprs/test_table.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/tests/test_dax/test_exprs/test_variable.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/tests/test_dax/test_formatter/__init__.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/tests/test_dax/test_formatter/test_basic.py +0 -0
- {pbi_parsers-0.7.12 → pbi_parsers-0.7.19}/tests/test_dax/test_lexer.py +0 -0
@@ -0,0 +1,122 @@
|
|
1
|
+
name: Tag and Release on Version Change
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- main
|
7
|
+
env:
|
8
|
+
PACKAGE_NAME: pbi_parsers # <- replace with your actual package name
|
9
|
+
|
10
|
+
jobs:
|
11
|
+
tag:
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
outputs:
|
14
|
+
version: ${{ steps.get_version.outputs.VERSION }}
|
15
|
+
tagged: ${{ steps.check_tag.outputs.TAG_EXISTS == 'false' }}
|
16
|
+
|
17
|
+
steps:
|
18
|
+
- name: Checkout repository
|
19
|
+
uses: actions/checkout@v4
|
20
|
+
|
21
|
+
- name: Set up Python
|
22
|
+
uses: actions/setup-python@v5
|
23
|
+
with:
|
24
|
+
python-version: '3.x'
|
25
|
+
|
26
|
+
- name: Get current version from file
|
27
|
+
id: get_version
|
28
|
+
run: |
|
29
|
+
VERSION=$(grep -oP '__version__ = \"\K[^\"]*' $PACKAGE_NAME/__init__.py)
|
30
|
+
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
|
31
|
+
|
32
|
+
- name: Check if tag already exists
|
33
|
+
id: check_tag
|
34
|
+
run: |
|
35
|
+
if git rev-parse "refs/tags/v${{ steps.get_version.outputs.VERSION }}" >/dev/null 2>&1; then
|
36
|
+
echo "TAG_EXISTS=true" >> $GITHUB_OUTPUT
|
37
|
+
else
|
38
|
+
echo "TAG_EXISTS=false" >> $GITHUB_OUTPUT
|
39
|
+
fi
|
40
|
+
|
41
|
+
- name: Create tag and GitHub release
|
42
|
+
if: steps.check_tag.outputs.TAG_EXISTS == 'false'
|
43
|
+
env:
|
44
|
+
VERSION: ${{ steps.get_version.outputs.VERSION }}
|
45
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
46
|
+
run: |
|
47
|
+
git config user.name "github-actions"
|
48
|
+
git config user.email "github-actions@github.com"
|
49
|
+
git tag -a "v$VERSION" -m "Release v$VERSION"
|
50
|
+
git push origin "v$VERSION"
|
51
|
+
|
52
|
+
gh release create "v$VERSION" \
|
53
|
+
--title "v$VERSION" \
|
54
|
+
--notes "Automated release for version $VERSION"
|
55
|
+
release:
|
56
|
+
needs: tag
|
57
|
+
if: needs.tag.outputs.tagged == 'true'
|
58
|
+
runs-on: ubuntu-latest
|
59
|
+
steps:
|
60
|
+
- name: Checkout code at tag
|
61
|
+
uses: actions/checkout@v4
|
62
|
+
with:
|
63
|
+
fetch-depth: 0 # Required to access tags
|
64
|
+
ref: "refs/tags/v${{ needs.tag.outputs.version }}"
|
65
|
+
|
66
|
+
- name: Set up Python
|
67
|
+
uses: actions/setup-python@v5
|
68
|
+
with:
|
69
|
+
python-version: '3.x'
|
70
|
+
|
71
|
+
- name: Build package (sdist and wheel)
|
72
|
+
run: |
|
73
|
+
python -m pip install --upgrade build
|
74
|
+
python -m build
|
75
|
+
|
76
|
+
- name: Get commit message for release notes
|
77
|
+
id: commit_message
|
78
|
+
run: |
|
79
|
+
MSG=$(git log -1 --pretty=%B)
|
80
|
+
echo "MSG<<EOF" >> $GITHUB_OUTPUT
|
81
|
+
echo "$MSG" >> $GITHUB_OUTPUT
|
82
|
+
echo "EOF" >> $GITHUB_OUTPUT
|
83
|
+
|
84
|
+
- name: Upload GitHub release
|
85
|
+
uses: softprops/action-gh-release@v1
|
86
|
+
with:
|
87
|
+
tag_name: "v${{ needs.tag.outputs.version }}"
|
88
|
+
name: "v${{ needs.tag.outputs.version }}"
|
89
|
+
body: "${{ steps.commit_message.outputs.MSG }}"
|
90
|
+
files: |
|
91
|
+
dist/*.whl
|
92
|
+
dist/*.tar.gz
|
93
|
+
env:
|
94
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
95
|
+
|
96
|
+
- name: Upload dist artifacts
|
97
|
+
uses: actions/upload-artifact@v4
|
98
|
+
with:
|
99
|
+
name: dist-files
|
100
|
+
path: dist/*
|
101
|
+
publish:
|
102
|
+
needs:
|
103
|
+
- release
|
104
|
+
- tag
|
105
|
+
if: needs.tag.outputs.tagged == 'true'
|
106
|
+
runs-on: ubuntu-latest
|
107
|
+
environment:
|
108
|
+
name: pypi
|
109
|
+
url: https://pypi.org/p/${{ env.PACKAGE_NAME }} # Replace <package-name> with your PyPI project name
|
110
|
+
permissions:
|
111
|
+
id-token: write # IMPORTANT: mandatory for trusted publishing
|
112
|
+
|
113
|
+
|
114
|
+
steps:
|
115
|
+
- name: Download dist artifacts
|
116
|
+
uses: actions/download-artifact@v4
|
117
|
+
with:
|
118
|
+
name: dist-files
|
119
|
+
path: dist
|
120
|
+
|
121
|
+
- name: Publish Package to PyPI
|
122
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
@@ -0,0 +1,117 @@
|
|
1
|
+
import subprocess # noqa: S404
|
2
|
+
import sys
|
3
|
+
|
4
|
+
import dotenv
|
5
|
+
import git
|
6
|
+
import github
|
7
|
+
|
8
|
+
import pbi_parsers
|
9
|
+
|
10
|
+
|
11
|
+
def create_release() -> None:
|
12
|
+
token = dotenv.get_key(dotenv_path=".env", key_to_get="GITHUB_TOKEN")
|
13
|
+
if not token:
|
14
|
+
msg = "GITHUB_TOKEN not found in .env file."
|
15
|
+
raise ValueError(msg)
|
16
|
+
token = github.Auth.Token(token=token)
|
17
|
+
api = github.Github(auth=token)
|
18
|
+
last_commit_message = git.Repo(".").head.commit.message
|
19
|
+
remote_repo = api.get_user().get_repo("pbi_parsers")
|
20
|
+
version = pbi_parsers.__version__
|
21
|
+
release = remote_repo.create_git_release(
|
22
|
+
tag=f"v{version}",
|
23
|
+
name=f"Release {version}",
|
24
|
+
message=f"Release {version}.\n\n{last_commit_message}",
|
25
|
+
draft=False,
|
26
|
+
prerelease=False,
|
27
|
+
)
|
28
|
+
release.upload_asset(
|
29
|
+
path=f"dist/pbi_parsers-{version}-py3-none-any.whl",
|
30
|
+
name=f"pbi_parsers-{version}-py3-none-any.whl",
|
31
|
+
label=f"pbi_parsers-{version}-py3-none-any.whl",
|
32
|
+
)
|
33
|
+
release.upload_asset(
|
34
|
+
path=f"dist/pbi_parsers-{version}.tar.gz",
|
35
|
+
name=f"pbi_parsers-{version}.tar.gz",
|
36
|
+
label=f"pbi_parsers-{version}.tar.gz",
|
37
|
+
)
|
38
|
+
|
39
|
+
|
40
|
+
def tagger() -> None:
|
41
|
+
"""Tags the current commit with the version from pbi_parsers.
|
42
|
+
|
43
|
+
This is useful for creating a release tag in the repository.
|
44
|
+
|
45
|
+
Raises:
|
46
|
+
ValueError: If the pbi_parsers version is not set.
|
47
|
+
|
48
|
+
"""
|
49
|
+
if not pbi_parsers.__version__:
|
50
|
+
msg = "pbi_parsers version is not set."
|
51
|
+
raise ValueError(msg)
|
52
|
+
|
53
|
+
current_version = f"v{pbi_parsers.__version__}"
|
54
|
+
print(f"Tagging version {current_version} in the repository.")
|
55
|
+
repo = git.Repo(".")
|
56
|
+
existing_tags = [t.name for t in repo.tags]
|
57
|
+
|
58
|
+
if current_version in existing_tags:
|
59
|
+
print(f"Tag {current_version} already exists.")
|
60
|
+
return
|
61
|
+
|
62
|
+
repo.create_tag(current_version, message=f"Release {pbi_parsers.__version__}")
|
63
|
+
print(f"Tag {current_version} created successfully.")
|
64
|
+
|
65
|
+
|
66
|
+
def builder() -> None:
|
67
|
+
repo = git.Repo(".")
|
68
|
+
existing_tags = [t.commit for t in repo.tags]
|
69
|
+
if repo.head.commit not in existing_tags:
|
70
|
+
return
|
71
|
+
|
72
|
+
try:
|
73
|
+
command = [sys.executable, "-m", "build", "."]
|
74
|
+
result = subprocess.run(command, check=True, capture_output=True, text=True) # noqa: S603
|
75
|
+
print("Build successful!")
|
76
|
+
print("STDOUT:")
|
77
|
+
print(result.stdout)
|
78
|
+
print("STDERR:")
|
79
|
+
print(result.stderr)
|
80
|
+
except subprocess.CalledProcessError as e:
|
81
|
+
print(f"Error during build process: {e}")
|
82
|
+
print("STDOUT:")
|
83
|
+
print(e.stdout)
|
84
|
+
print("STDERR:")
|
85
|
+
print(e.stderr)
|
86
|
+
except FileNotFoundError:
|
87
|
+
print(f"Error: Python executable '{sys.executable}' not found.")
|
88
|
+
except Exception as e:
|
89
|
+
print(f"An unexpected error occurred: {e}")
|
90
|
+
raise ValueError from e
|
91
|
+
|
92
|
+
|
93
|
+
def push_docs() -> None:
|
94
|
+
command = ["mkdocs", "gh-deploy", "--clean", "-f", "docs/mkdocs.yml"]
|
95
|
+
try:
|
96
|
+
result = subprocess.run(command, check=True, capture_output=True, text=True) # noqa: S603
|
97
|
+
print("Documentation pushed successfully!")
|
98
|
+
print("STDOUT:")
|
99
|
+
print(result.stdout)
|
100
|
+
print("STDERR:")
|
101
|
+
print(result.stderr)
|
102
|
+
except subprocess.CalledProcessError as e:
|
103
|
+
print(f"Error during documentation push: {e}")
|
104
|
+
print("STDOUT:")
|
105
|
+
print(e.stdout)
|
106
|
+
print("STDERR:")
|
107
|
+
print(e.stderr)
|
108
|
+
except Exception as e:
|
109
|
+
print(f"An unexpected error occurred: {e}")
|
110
|
+
raise ValueError from e
|
111
|
+
|
112
|
+
|
113
|
+
if __name__ == "__main__":
|
114
|
+
tagger()
|
115
|
+
builder()
|
116
|
+
push_docs()
|
117
|
+
create_release()
|
pbi_parsers-0.7.12/test.py
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
from pbi_parsers.dax import highlight_section, to_ast
|
2
|
-
|
3
|
-
input_dax = """
|
4
|
-
func.name(
|
5
|
-
arg1 +
|
6
|
-
1 +
|
7
|
-
2 + 3,
|
8
|
-
func(),
|
9
|
-
func(10000000000000),
|
10
|
-
arg2
|
11
|
-
)
|
12
|
-
"""
|
13
|
-
ast = to_ast(input_dax)
|
14
|
-
assert ast is not None, "AST should not be None"
|
15
|
-
section = ast.args[0].right
|
16
|
-
highlighted = highlight_section(section)
|
17
|
-
print(highlighted.to_console())
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|