liquid-xml-objects-runtime 21.6.2__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.
Potentially problematic release.
This version of liquid-xml-objects-runtime might be problematic. Click here for more details.
- liquid_xml_objects_runtime-21.6.2/.gitattributes +2 -0
- liquid_xml_objects_runtime-21.6.2/.github/workflows/ci.yml +55 -0
- liquid_xml_objects_runtime-21.6.2/.github/workflows/release.yml +137 -0
- liquid_xml_objects_runtime-21.6.2/.gitignore +221 -0
- liquid_xml_objects_runtime-21.6.2/.vscode/extensions.json +9 -0
- liquid_xml_objects_runtime-21.6.2/.vscode/launch.json +85 -0
- liquid_xml_objects_runtime-21.6.2/.vscode/settings.json +41 -0
- liquid_xml_objects_runtime-21.6.2/.vscode/tasks.json +112 -0
- liquid_xml_objects_runtime-21.6.2/CHANGELOG.md +30 -0
- liquid_xml_objects_runtime-21.6.2/LICENSE.txt +76 -0
- liquid_xml_objects_runtime-21.6.2/MANIFEST.in +2 -0
- liquid_xml_objects_runtime-21.6.2/PKG-INFO +271 -0
- liquid_xml_objects_runtime-21.6.2/README.md +183 -0
- liquid_xml_objects_runtime-21.6.2/pyproject.toml +49 -0
- liquid_xml_objects_runtime-21.6.2/requirements-dev.txt +4 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/__init__.py +82 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/_version.py +24 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/attribution/__init__.py +145 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/attribution/attributes.py +905 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/attribution/enums.py +116 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/constants.py +13 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/convert_string_to_xsd.py +385 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/convert_xsd_to_string.py +192 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/deserializer/__init__.py +1 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/deserializer/look_ahead_mode.py +15 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/deserializer/lx_compositor_readers.py +568 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/deserializer/lx_element_reader.py +282 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/deserializer/lx_reader.py +188 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/deserializer/type_deserialization_order.py +48 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/deserializer/xpath_alternatives.py +208 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/errors.py +148 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/licensing.py +132 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/lx_extensions.py +45 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/lx_nillable.py +42 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/lx_reader_settings.py +85 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/lx_serializer.py +334 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/lx_settings.py +13 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/lx_union.py +43 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/lx_writer_settings.py +116 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/metadata_type_info_cache.py +233 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/number_formatting.py +268 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/py.typed +0 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/qname.py +151 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/schema_model/__init__.py +1 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/schema_model/conversion_error_type.py +13 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/schema_model/conversion_result.py +37 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/schema_model/meta_data_extensions.py +85 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/schema_model/metadata_class.py +42 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/schema_model/metadata_class_compositor.py +125 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/schema_model/metadata_class_container.py +133 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/schema_model/metadata_class_union.py +19 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/schema_model/parsed_simple_type_data.py +721 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/serializer/__init__.py +1 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/serializer/class_element_writers.py +447 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/serializer/document_writer.py +106 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/serializer/element_writers.py +345 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/serializer/lx_writer.py +159 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/serializer/namespace_manager.py +46 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/serializer/writer_factory.py +78 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/serializer_base.py +32 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/string_utilities.py +25 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/types/__init__.py +1 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/types/lx_date_time.py +1061 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/types/lx_duration.py +416 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/whitespace_utilities.py +41 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/xml/__init__.py +1 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/xml/x_element.py +174 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/xml/xml_reader.py +471 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/xml/xml_writer.py +291 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/xsd_names.py +144 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/xsd_regex.py +456 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/xsd_type_info.py +214 -0
- liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects/xsd_value_comparer.py +22 -0
- liquid_xml_objects_runtime-21.6.2/tests/__init__.py +0 -0
- liquid_xml_objects_runtime-21.6.2/tests/conftest.py +17 -0
- liquid_xml_objects_runtime-21.6.2/tests/models/__init__.py +0 -0
- liquid_xml_objects_runtime-21.6.2/tests/models/bookstore.py +122 -0
- liquid_xml_objects_runtime-21.6.2/tests/run_generated.py +185 -0
- liquid_xml_objects_runtime-21.6.2/tests/test_convert_string_to_xsd.py +241 -0
- liquid_xml_objects_runtime-21.6.2/tests/test_licensing.py +83 -0
- liquid_xml_objects_runtime-21.6.2/tests/test_number_formatting.py +82 -0
- liquid_xml_objects_runtime-21.6.2/tests/test_runtime_requirements.py +87 -0
- liquid_xml_objects_runtime-21.6.2/tests/test_serializer.py +503 -0
- liquid_xml_objects_runtime-21.6.2/tests/test_version.py +30 -0
- liquid_xml_objects_runtime-21.6.2/tests/test_whitespace_and_regex.py +129 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
# Runs on demand : Actions > CI > Run workflow (choose the branch to build).
|
|
4
|
+
on:
|
|
5
|
+
workflow_dispatch:
|
|
6
|
+
push:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
test:
|
|
14
|
+
name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
|
|
15
|
+
runs-on: ${{ matrix.os }}
|
|
16
|
+
strategy:
|
|
17
|
+
fail-fast: false
|
|
18
|
+
matrix:
|
|
19
|
+
os: [ubuntu-latest, windows-latest]
|
|
20
|
+
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v4
|
|
23
|
+
with:
|
|
24
|
+
fetch-depth: 0
|
|
25
|
+
- uses: actions/setup-python@v5
|
|
26
|
+
with:
|
|
27
|
+
python-version: ${{ matrix.python-version }}
|
|
28
|
+
cache: pip
|
|
29
|
+
cache-dependency-path: |
|
|
30
|
+
pyproject.toml
|
|
31
|
+
requirements-dev.txt
|
|
32
|
+
- name: Install
|
|
33
|
+
run: python -m pip install -e . -r requirements-dev.txt
|
|
34
|
+
- name: Lint
|
|
35
|
+
run: |
|
|
36
|
+
python -m ruff check src tests
|
|
37
|
+
python -m ruff format --check src tests
|
|
38
|
+
- name: Type check
|
|
39
|
+
run: python -m mypy src
|
|
40
|
+
- name: Test
|
|
41
|
+
run: python -m pytest -q
|
|
42
|
+
|
|
43
|
+
build:
|
|
44
|
+
name: Build the distribution
|
|
45
|
+
runs-on: ubuntu-latest
|
|
46
|
+
steps:
|
|
47
|
+
- uses: actions/checkout@v4
|
|
48
|
+
with:
|
|
49
|
+
fetch-depth: 0
|
|
50
|
+
- uses: actions/setup-python@v5
|
|
51
|
+
with:
|
|
52
|
+
python-version: "3.12"
|
|
53
|
+
- run: python -m pip install build twine
|
|
54
|
+
- run: python -m build
|
|
55
|
+
- run: python -m twine check dist/*
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
name: Build and publish
|
|
2
|
+
|
|
3
|
+
# Runs on demand : Actions > Build and publish > Run workflow (choose the branch to build).
|
|
4
|
+
#
|
|
5
|
+
# It checks the code (lint, types, tests) and builds the distribution, which is attached to the run as the artifact 'dist'. Then, if you ask for them :
|
|
6
|
+
# publish uploads the distribution to the package index
|
|
7
|
+
# github_release creates the GitHub release (and the tag) v<version> with the distribution attached
|
|
8
|
+
# The version is the one in src/liquid_xml_objects/_version.py (the only place it is written), change it before you publish :
|
|
9
|
+
# an index does not accept the same version twice.
|
|
10
|
+
#
|
|
11
|
+
# Configuration (repository settings > Secrets and variables > Actions)
|
|
12
|
+
# Variables
|
|
13
|
+
# PYPI_REPOSITORY_URL where to publish, i.e. https://test.pypi.org/legacy/ (https://upload.pypi.org/legacy/ for the real PyPI)
|
|
14
|
+
# PYPI_PROJECT_URL optional, shown as the environment url, i.e. https://test.pypi.org/project/liquid-xml-objects/
|
|
15
|
+
# Secrets
|
|
16
|
+
# PYPI_API_TOKEN the API token for the index named by PYPI_REPOSITORY_URL (it must be a token of that index: a token from
|
|
17
|
+
# pypi.org does not work on test.pypi.org, and a token limited to one project can only be created after
|
|
18
|
+
# the first upload, so the first upload needs a token with the scope 'Entire account').
|
|
19
|
+
# If it is not set the upload uses Trusted Publishing.
|
|
20
|
+
|
|
21
|
+
on:
|
|
22
|
+
push:
|
|
23
|
+
tags: ["v*"]
|
|
24
|
+
workflow_dispatch:
|
|
25
|
+
inputs:
|
|
26
|
+
publish:
|
|
27
|
+
description: Publish the distribution to the package index (PYPI_REPOSITORY_URL)
|
|
28
|
+
type: boolean
|
|
29
|
+
default: true
|
|
30
|
+
github_release:
|
|
31
|
+
description: Create the GitHub release v<version> with the distribution attached
|
|
32
|
+
type: boolean
|
|
33
|
+
default: true
|
|
34
|
+
|
|
35
|
+
permissions:
|
|
36
|
+
contents: read
|
|
37
|
+
|
|
38
|
+
jobs:
|
|
39
|
+
build:
|
|
40
|
+
name: Check and build the distribution
|
|
41
|
+
runs-on: ubuntu-latest
|
|
42
|
+
outputs:
|
|
43
|
+
version: ${{ steps.version.outputs.version }}
|
|
44
|
+
steps:
|
|
45
|
+
- uses: actions/checkout@v4
|
|
46
|
+
- uses: actions/setup-python@v5
|
|
47
|
+
with:
|
|
48
|
+
python-version: "3.12"
|
|
49
|
+
cache: pip
|
|
50
|
+
cache-dependency-path: |
|
|
51
|
+
pyproject.toml
|
|
52
|
+
requirements-dev.txt
|
|
53
|
+
- name: Tag Reader
|
|
54
|
+
if: github.ref_type == 'tag'
|
|
55
|
+
run: echo "Tag ${{ github.ref_name }}"
|
|
56
|
+
- name: Install
|
|
57
|
+
run: python -m pip install -e . -r requirements-dev.txt build twine
|
|
58
|
+
- name: Lint
|
|
59
|
+
run: |
|
|
60
|
+
python -m ruff check src tests
|
|
61
|
+
python -m ruff format --check src tests
|
|
62
|
+
- name: Type check
|
|
63
|
+
run: python -m mypy src
|
|
64
|
+
- name: Test
|
|
65
|
+
run: python -m pytest -q
|
|
66
|
+
- name: Version
|
|
67
|
+
id: version
|
|
68
|
+
run: echo "version=$(python -c 'import liquid_xml_objects; print(liquid_xml_objects.__version__)')" >> "$GITHUB_OUTPUT"
|
|
69
|
+
- name: Build
|
|
70
|
+
run: |
|
|
71
|
+
python -m build
|
|
72
|
+
python -m twine check dist/*
|
|
73
|
+
- uses: actions/upload-artifact@v4
|
|
74
|
+
with:
|
|
75
|
+
name: dist
|
|
76
|
+
path: dist/
|
|
77
|
+
if-no-files-found: error
|
|
78
|
+
|
|
79
|
+
publish:
|
|
80
|
+
name: Publish to the package index
|
|
81
|
+
needs: build
|
|
82
|
+
if: ${{ inputs.publish || github.ref_type == 'tag' }}
|
|
83
|
+
runs-on: ubuntu-latest
|
|
84
|
+
environment:
|
|
85
|
+
name: package-index
|
|
86
|
+
url: ${{ vars.PYPI_PROJECT_URL }}
|
|
87
|
+
permissions:
|
|
88
|
+
contents: read
|
|
89
|
+
id-token: write # Trusted Publishing
|
|
90
|
+
env:
|
|
91
|
+
HAS_TOKEN: ${{ secrets.PYPI_API_TOKEN != '' }}
|
|
92
|
+
steps:
|
|
93
|
+
- uses: actions/download-artifact@v4
|
|
94
|
+
with:
|
|
95
|
+
name: dist
|
|
96
|
+
path: dist/
|
|
97
|
+
# Trusted Publishing (preferred, no secret): register this workflow (release.yml) and the environment (package-index) as a trusted
|
|
98
|
+
# publisher for the project on the index, and do not set PYPI_API_TOKEN.
|
|
99
|
+
# API token : set PYPI_API_TOKEN. The user name for a token is always __token__, so it is not configurable.
|
|
100
|
+
- name: Publish (API token)
|
|
101
|
+
if: ${{ env.HAS_TOKEN == 'true' }}
|
|
102
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
103
|
+
with:
|
|
104
|
+
repository-url: ${{ vars.PYPI_REPOSITORY_URL }}
|
|
105
|
+
user: __token__
|
|
106
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
107
|
+
attestations: false
|
|
108
|
+
verbose: true
|
|
109
|
+
- name: Publish (Trusted Publishing)
|
|
110
|
+
if: ${{ env.HAS_TOKEN != 'true' }}
|
|
111
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
112
|
+
with:
|
|
113
|
+
repository-url: ${{ vars.PYPI_REPOSITORY_URL }}
|
|
114
|
+
verbose: true
|
|
115
|
+
|
|
116
|
+
github-release:
|
|
117
|
+
name: Create the GitHub release
|
|
118
|
+
needs: [build, publish]
|
|
119
|
+
# (after the publish, so there is no release for a version that failed to publish, whether or not it was asked for)
|
|
120
|
+
if: ${{ always() && (inputs.github_release || github.ref_type == 'tag') && needs.build.result == 'success' && needs.publish.result != 'failure' && needs.publish.result != 'cancelled' }}
|
|
121
|
+
runs-on: ubuntu-latest
|
|
122
|
+
permissions:
|
|
123
|
+
contents: write
|
|
124
|
+
steps:
|
|
125
|
+
- uses: actions/download-artifact@v4
|
|
126
|
+
with:
|
|
127
|
+
name: dist
|
|
128
|
+
path: dist/
|
|
129
|
+
- name: Create the release
|
|
130
|
+
env:
|
|
131
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
132
|
+
run: >
|
|
133
|
+
gh release create "v${{ needs.build.outputs.version }}" dist/*
|
|
134
|
+
--repo "${{ github.repository }}"
|
|
135
|
+
--target "${{ github.sha }}"
|
|
136
|
+
--title "v${{ needs.build.outputs.version }}"
|
|
137
|
+
--generate-notes
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
src/liquid_xml_objects/_version.py
|
|
29
|
+
|
|
30
|
+
# PyInstaller
|
|
31
|
+
# Usually these files are written by a python script from a template
|
|
32
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
33
|
+
*.manifest
|
|
34
|
+
*.spec
|
|
35
|
+
|
|
36
|
+
# Installer logs
|
|
37
|
+
pip-log.txt
|
|
38
|
+
pip-delete-this-directory.txt
|
|
39
|
+
|
|
40
|
+
# Unit test / coverage reports
|
|
41
|
+
htmlcov/
|
|
42
|
+
.tox/
|
|
43
|
+
.nox/
|
|
44
|
+
.coverage
|
|
45
|
+
.coverage.*
|
|
46
|
+
.cache
|
|
47
|
+
nosetests.xml
|
|
48
|
+
coverage.xml
|
|
49
|
+
*.cover
|
|
50
|
+
*.py.cover
|
|
51
|
+
*.lcov
|
|
52
|
+
.hypothesis/
|
|
53
|
+
.pytest_cache/
|
|
54
|
+
cover/
|
|
55
|
+
|
|
56
|
+
# Translations
|
|
57
|
+
*.mo
|
|
58
|
+
*.pot
|
|
59
|
+
|
|
60
|
+
# Django stuff:
|
|
61
|
+
*.log
|
|
62
|
+
local_settings.py
|
|
63
|
+
db.sqlite3
|
|
64
|
+
db.sqlite3-journal
|
|
65
|
+
|
|
66
|
+
# Flask stuff:
|
|
67
|
+
instance/
|
|
68
|
+
.webassets-cache
|
|
69
|
+
|
|
70
|
+
# Scrapy stuff:
|
|
71
|
+
.scrapy
|
|
72
|
+
|
|
73
|
+
# Sphinx documentation
|
|
74
|
+
docs/_build/
|
|
75
|
+
|
|
76
|
+
# PyBuilder
|
|
77
|
+
.pybuilder/
|
|
78
|
+
target/
|
|
79
|
+
|
|
80
|
+
# Jupyter Notebook
|
|
81
|
+
.ipynb_checkpoints
|
|
82
|
+
|
|
83
|
+
# IPython
|
|
84
|
+
profile_default/
|
|
85
|
+
ipython_config.py
|
|
86
|
+
|
|
87
|
+
# pyenv
|
|
88
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
89
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
90
|
+
# .python-version
|
|
91
|
+
|
|
92
|
+
# pipenv
|
|
93
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
94
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
95
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
96
|
+
# install all needed dependencies.
|
|
97
|
+
# Pipfile.lock
|
|
98
|
+
|
|
99
|
+
# uv
|
|
100
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
101
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
102
|
+
# commonly ignored for libraries.
|
|
103
|
+
# uv.lock
|
|
104
|
+
|
|
105
|
+
# poetry
|
|
106
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
107
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
108
|
+
# commonly ignored for libraries.
|
|
109
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
110
|
+
# poetry.lock
|
|
111
|
+
# poetry.toml
|
|
112
|
+
|
|
113
|
+
# pdm
|
|
114
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
115
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
116
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
117
|
+
# pdm.lock
|
|
118
|
+
# pdm.toml
|
|
119
|
+
.pdm-python
|
|
120
|
+
.pdm-build/
|
|
121
|
+
|
|
122
|
+
# pixi
|
|
123
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
124
|
+
# pixi.lock
|
|
125
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
126
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
127
|
+
.pixi/*
|
|
128
|
+
!.pixi/config.toml
|
|
129
|
+
|
|
130
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
131
|
+
__pypackages__/
|
|
132
|
+
|
|
133
|
+
# Celery stuff
|
|
134
|
+
celerybeat-schedule*
|
|
135
|
+
celerybeat.pid
|
|
136
|
+
|
|
137
|
+
# Redis
|
|
138
|
+
*.rdb
|
|
139
|
+
*.aof
|
|
140
|
+
*.pid
|
|
141
|
+
|
|
142
|
+
# RabbitMQ
|
|
143
|
+
mnesia/
|
|
144
|
+
rabbitmq/
|
|
145
|
+
rabbitmq-data/
|
|
146
|
+
|
|
147
|
+
# ActiveMQ
|
|
148
|
+
activemq-data/
|
|
149
|
+
|
|
150
|
+
# SageMath parsed files
|
|
151
|
+
*.sage.py
|
|
152
|
+
|
|
153
|
+
# Environments
|
|
154
|
+
.env
|
|
155
|
+
.envrc
|
|
156
|
+
.venv
|
|
157
|
+
env/
|
|
158
|
+
venv/
|
|
159
|
+
ENV/
|
|
160
|
+
env.bak/
|
|
161
|
+
venv.bak/
|
|
162
|
+
|
|
163
|
+
# Spyder project settings
|
|
164
|
+
.spyderproject
|
|
165
|
+
.spyproject
|
|
166
|
+
|
|
167
|
+
# Rope project settings
|
|
168
|
+
.ropeproject
|
|
169
|
+
|
|
170
|
+
# mkdocs/Zensical documentation
|
|
171
|
+
/site
|
|
172
|
+
|
|
173
|
+
# mypy
|
|
174
|
+
.mypy_cache/
|
|
175
|
+
.dmypy.json
|
|
176
|
+
dmypy.json
|
|
177
|
+
|
|
178
|
+
# Pyre type checker
|
|
179
|
+
.pyre/
|
|
180
|
+
|
|
181
|
+
# pytype static type analyzer
|
|
182
|
+
.pytype/
|
|
183
|
+
|
|
184
|
+
# Cython debug symbols
|
|
185
|
+
cython_debug/
|
|
186
|
+
|
|
187
|
+
# PyCharm
|
|
188
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
189
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
190
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
191
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
192
|
+
# .idea/
|
|
193
|
+
|
|
194
|
+
# Abstra
|
|
195
|
+
# Abstra is an AI-powered process automation framework.
|
|
196
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
197
|
+
# Learn more at https://abstra.io/docs
|
|
198
|
+
.abstra/
|
|
199
|
+
|
|
200
|
+
# Visual Studio Code
|
|
201
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore that
|
|
202
|
+
# can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
203
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer, you
|
|
204
|
+
# could uncomment the following to ignore the entire vscode folder
|
|
205
|
+
# .vscode/
|
|
206
|
+
# Temporary file for partial code execution
|
|
207
|
+
tempCodeRunnerFile.py
|
|
208
|
+
|
|
209
|
+
# Ruff stuff:
|
|
210
|
+
.ruff_cache/
|
|
211
|
+
|
|
212
|
+
# PyPI configuration file
|
|
213
|
+
.pypirc
|
|
214
|
+
|
|
215
|
+
# Marimo
|
|
216
|
+
marimo/_static/
|
|
217
|
+
marimo/_lsp/
|
|
218
|
+
__marimo__/
|
|
219
|
+
|
|
220
|
+
# Streamlit
|
|
221
|
+
.streamlit/secrets.toml
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.2.0",
|
|
3
|
+
"configurations": [
|
|
4
|
+
{
|
|
5
|
+
"name": "Python: current file",
|
|
6
|
+
"type": "debugpy",
|
|
7
|
+
"request": "launch",
|
|
8
|
+
"program": "${file}",
|
|
9
|
+
"console": "integratedTerminal",
|
|
10
|
+
"cwd": "${workspaceFolder}",
|
|
11
|
+
"env": { "PYTHONPATH": "${workspaceFolder}/src" },
|
|
12
|
+
"justMyCode": false
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "pytest: all tests",
|
|
16
|
+
"type": "debugpy",
|
|
17
|
+
"request": "launch",
|
|
18
|
+
"module": "pytest",
|
|
19
|
+
"args": ["-x", "-q", "tests"],
|
|
20
|
+
"console": "integratedTerminal",
|
|
21
|
+
"cwd": "${workspaceFolder}",
|
|
22
|
+
"env": { "PYTHONPATH": "${workspaceFolder}/src" },
|
|
23
|
+
"justMyCode": false
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "pytest: current file",
|
|
27
|
+
"type": "debugpy",
|
|
28
|
+
"request": "launch",
|
|
29
|
+
"module": "pytest",
|
|
30
|
+
"args": ["-x", "-q", "${file}"],
|
|
31
|
+
"console": "integratedTerminal",
|
|
32
|
+
"cwd": "${workspaceFolder}",
|
|
33
|
+
"env": { "PYTHONPATH": "${workspaceFolder}/src" },
|
|
34
|
+
"justMyCode": false
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"name": "pytest: test by name (-k)",
|
|
38
|
+
"type": "debugpy",
|
|
39
|
+
"request": "launch",
|
|
40
|
+
"module": "pytest",
|
|
41
|
+
"args": ["-x", "-q", "tests", "-k", "${input:testName}"],
|
|
42
|
+
"console": "integratedTerminal",
|
|
43
|
+
"cwd": "${workspaceFolder}",
|
|
44
|
+
"env": { "PYTHONPATH": "${workspaceFolder}/src" },
|
|
45
|
+
"justMyCode": false
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "Generated projects: round trip all (run_generated.py)",
|
|
49
|
+
"type": "debugpy",
|
|
50
|
+
"request": "launch",
|
|
51
|
+
"program": "${workspaceFolder}/tests/run_generated.py",
|
|
52
|
+
"args": [],
|
|
53
|
+
"console": "integratedTerminal",
|
|
54
|
+
"cwd": "${workspaceFolder}",
|
|
55
|
+
"env": { "PYTHONPATH": "${workspaceFolder}/src" },
|
|
56
|
+
"justMyCode": false
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "Generated projects: round trip one (run_generated.py)",
|
|
60
|
+
"type": "debugpy",
|
|
61
|
+
"request": "launch",
|
|
62
|
+
"program": "${workspaceFolder}/tests/run_generated.py",
|
|
63
|
+
// --worker runs the project in this process, so breakpoints in the runtime and in the generated code are hit.
|
|
64
|
+
// The folder is one written by PythonGeneratorTest (RegressionTests\Temp\PythonSampleGenerator\<schema>_<model>)
|
|
65
|
+
"args": ["--worker", "${input:generatedProjectFolder}", "--verbose"],
|
|
66
|
+
"console": "integratedTerminal",
|
|
67
|
+
"cwd": "${workspaceFolder}",
|
|
68
|
+
"env": { "PYTHONPATH": "${workspaceFolder}/src" },
|
|
69
|
+
"justMyCode": false
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
"inputs": [
|
|
73
|
+
{
|
|
74
|
+
"id": "testName",
|
|
75
|
+
"type": "promptString",
|
|
76
|
+
"description": "pytest -k expression (part of the name of the test)"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"id": "generatedProjectFolder",
|
|
80
|
+
"type": "promptString",
|
|
81
|
+
"description": "The generated project folder",
|
|
82
|
+
"default": "${workspaceFolder}/../LiquidTechnologies.XmlObjects.RegressionTests/Temp/PythonSampleGenerator/Choice001_Simple"
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
// The interpreter is the virtual environment in the project (python -m venv .venv), VS Code finds it by itself.
|
|
3
|
+
"python.terminal.activateEnvironment": true,
|
|
4
|
+
"python.analysis.extraPaths": ["${workspaceFolder}/src"],
|
|
5
|
+
"python.analysis.typeCheckingMode": "standard",
|
|
6
|
+
"terminal.integrated.env.windows": { "PYTHONPATH": "${workspaceFolder}\\src" },
|
|
7
|
+
"terminal.integrated.env.linux": { "PYTHONPATH": "${workspaceFolder}/src" },
|
|
8
|
+
"terminal.integrated.env.osx": { "PYTHONPATH": "${workspaceFolder}/src" },
|
|
9
|
+
|
|
10
|
+
// Tests (the Testing view): pytest, the settings are in pyproject.toml
|
|
11
|
+
"python.testing.pytestEnabled": true,
|
|
12
|
+
"python.testing.unittestEnabled": false,
|
|
13
|
+
"python.testing.pytestArgs": ["tests"],
|
|
14
|
+
|
|
15
|
+
// Lint and format : ruff (settings in pyproject.toml), types : mypy (strict, settings in pyproject.toml)
|
|
16
|
+
"mypy-type-checker.args": ["--config-file=${workspaceFolder}/pyproject.toml"],
|
|
17
|
+
"mypy-type-checker.importStrategy": "fromEnvironment",
|
|
18
|
+
"ruff.importStrategy": "fromEnvironment",
|
|
19
|
+
"[python]": {
|
|
20
|
+
"editor.defaultFormatter": "charliermarsh.ruff",
|
|
21
|
+
"editor.formatOnSave": true,
|
|
22
|
+
"editor.rulers": [140],
|
|
23
|
+
"editor.codeActionsOnSave": {
|
|
24
|
+
"source.fixAll.ruff": "explicit",
|
|
25
|
+
"source.organizeImports.ruff": "explicit"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
"files.eol": "\n",
|
|
30
|
+
"files.exclude": {
|
|
31
|
+
"**/__pycache__": true,
|
|
32
|
+
"**/.mypy_cache": true,
|
|
33
|
+
"**/.pytest_cache": true,
|
|
34
|
+
"**/.ruff_cache": true,
|
|
35
|
+
"**/*.egg-info": true
|
|
36
|
+
},
|
|
37
|
+
"search.exclude": {
|
|
38
|
+
"**/.venv": true,
|
|
39
|
+
"dist": true
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "2.0.0",
|
|
3
|
+
"options": {
|
|
4
|
+
"env": { "PYTHONPATH": "${workspaceFolder}/src" }
|
|
5
|
+
},
|
|
6
|
+
"tasks": [
|
|
7
|
+
{
|
|
8
|
+
"label": "Install (editable, with the dev tools)",
|
|
9
|
+
"type": "shell",
|
|
10
|
+
"command": "${command:python.interpreterPath}",
|
|
11
|
+
"args": ["-m", "pip", "install", "-e", ".", "-r", "requirements-dev.txt"],
|
|
12
|
+
"problemMatcher": []
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"label": "Compile (byte compile the sources)",
|
|
16
|
+
"type": "shell",
|
|
17
|
+
"command": "${command:python.interpreterPath}",
|
|
18
|
+
"args": ["-m", "compileall", "-q", "src", "tests"],
|
|
19
|
+
"group": "build",
|
|
20
|
+
"problemMatcher": "$python"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"label": "Type check (mypy --strict)",
|
|
24
|
+
"type": "shell",
|
|
25
|
+
"command": "${command:python.interpreterPath}",
|
|
26
|
+
"args": ["-m", "mypy", "src"],
|
|
27
|
+
"group": "build",
|
|
28
|
+
"problemMatcher": {
|
|
29
|
+
"owner": "mypy",
|
|
30
|
+
"fileLocation": ["relative", "${workspaceFolder}"],
|
|
31
|
+
"pattern": {
|
|
32
|
+
"regexp": "^(.+?):(\\d+):(?:(\\d+):)?\\s+(error|warning|note):\\s+(.*)$",
|
|
33
|
+
"file": 1,
|
|
34
|
+
"line": 2,
|
|
35
|
+
"column": 3,
|
|
36
|
+
"severity": 4,
|
|
37
|
+
"message": 5
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"label": "Lint (ruff)",
|
|
43
|
+
"type": "shell",
|
|
44
|
+
"command": "${command:python.interpreterPath}",
|
|
45
|
+
"args": ["-m", "ruff", "check", "--output-format", "concise", "src", "tests"],
|
|
46
|
+
"group": "build",
|
|
47
|
+
"problemMatcher": {
|
|
48
|
+
"owner": "ruff",
|
|
49
|
+
"fileLocation": ["relative", "${workspaceFolder}"],
|
|
50
|
+
"pattern": {
|
|
51
|
+
"regexp": "^(.+?):(\\d+):(\\d+):\\s+(\\S+)\\s+(.*)$",
|
|
52
|
+
"file": 1,
|
|
53
|
+
"line": 2,
|
|
54
|
+
"column": 3,
|
|
55
|
+
"code": 4,
|
|
56
|
+
"message": 5
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"label": "Format check (ruff format)",
|
|
62
|
+
"type": "shell",
|
|
63
|
+
"command": "${command:python.interpreterPath}",
|
|
64
|
+
"args": ["-m", "ruff", "format", "--check", "src", "tests"],
|
|
65
|
+
"problemMatcher": []
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"label": "Format (ruff format)",
|
|
69
|
+
"type": "shell",
|
|
70
|
+
"command": "${command:python.interpreterPath}",
|
|
71
|
+
"args": ["-m", "ruff", "format", "src", "tests"],
|
|
72
|
+
"problemMatcher": []
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"label": "Test (pytest)",
|
|
76
|
+
"type": "shell",
|
|
77
|
+
"command": "${command:python.interpreterPath}",
|
|
78
|
+
"args": ["-m", "pytest", "-q"],
|
|
79
|
+
"group": { "kind": "test", "isDefault": true },
|
|
80
|
+
"problemMatcher": "$python"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"label": "Round trip the generated projects (run_generated.py)",
|
|
84
|
+
"type": "shell",
|
|
85
|
+
"command": "${command:python.interpreterPath}",
|
|
86
|
+
"args": ["tests/run_generated.py"],
|
|
87
|
+
"group": "test",
|
|
88
|
+
"problemMatcher": []
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"label": "Build the distribution (wheel + sdist)",
|
|
92
|
+
"type": "shell",
|
|
93
|
+
"command": "${command:python.interpreterPath}",
|
|
94
|
+
"args": ["-m", "build"],
|
|
95
|
+
"group": "build",
|
|
96
|
+
"problemMatcher": []
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"label": "Check (compile, lint, format, types, tests)",
|
|
100
|
+
"dependsOrder": "sequence",
|
|
101
|
+
"dependsOn": [
|
|
102
|
+
"Compile (byte compile the sources)",
|
|
103
|
+
"Lint (ruff)",
|
|
104
|
+
"Format check (ruff format)",
|
|
105
|
+
"Type check (mypy --strict)",
|
|
106
|
+
"Test (pytest)"
|
|
107
|
+
],
|
|
108
|
+
"group": { "kind": "build", "isDefault": true },
|
|
109
|
+
"problemMatcher": []
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
}
|